Create Office365 DNS Template for ISPConfig

This is a guide prepared with latest version of ISPConfig as on Dec 2014 version 3.0.5.4.p5

ISPConfig comes with option to define DNS Templates. Any user can select a template and enter domain name, all DNS settings will get configured based on template.

I prepared a guide each to prepare templates for Google Apps as well as Office 365. This guide helps you to configure Office 365. Unlike Google Apps, Office365 has a unique record for every domain name MX, so we need to edit 1 file in ISPConfig source to get this working.

By the end of this guide, you will be able to create a ISPConfig DNS Template that autoconfigures any domain name with Office 365, MX, SPF, Lync Auto discover records, basically every DNS record which Microsoft has specified to start using Office 365.

 

Microsoft has mx in format domain-tld.mail.protection.outlook.com

for example mx record for abc.com would be abc-com.mail.protection.outlook.com

We need to add 1 line to ISPConfig source file to have the domain name with – (hyphen) instead of .(dot) in a variable.

 

Goto your SSH Terminal

Open the file /usr/local/ispconfig/interface/web/dns/dns_wizard.php

Search for $tpl_content = $template_record[‘template’];

Add these lines below it

$domain2 = str_replace('.', '-', $domain2);
$tpl_content = str_replace('{DOMAIN2}', $domain2, $tpl_content);

Goto your ISPConfig Control Panel > DNS > Templates

Create a new template with the below template code.
[ZONE]
origin={DOMAIN}.
ns={NS1}.
mbox={EMAIL}.
refresh=7200
retry=540
expire=604800
minimum=86400
ttl=3600

[DNS_RECORDS]
A|{DOMAIN}.|{IP}|0|7200
CNAME|www|{DOMAIN}.|0|7200
A|mail|167.160.94.214|0|7200
NS|{DOMAIN}.|{NS1}.|0|7200
NS|{DOMAIN}.|{NS2}.|0|7200
MX|{DOMAIN}.|{DOMAIN2}.mail.protection.outlook.com.|1|7200
TXT|{DOMAIN}.|v=spf1 mx a ip4:{IP} include:spf.protection.outlook.com ~all|0|7200
CNAME|autodiscover|autodiscover.outlook.com.|0|7200
CNAME|sip|sipdir.online.lync.com.|0|7200
CNAME|lyncdiscover|webdir.online.lync.com.|0|7200
CNAME|msoid|clientconfig.microsoftonline-p.net.|0|7200
SRV|_sip._tls|1 443 sipdir.online.lync.com.|100|7200
SRV|_sipfederationtls._tcp|1 5061 sipfed.online.lync.com.|100|7200

Be First to Comment

    Leave a Reply