It’s very easy to Install and configure DNS Server in Windows Server 2008. Now after installing and configuring DNS Server we will need to create various DNS resource record for the recently created forward lookup zone. Every domain hosted requires at least following DNS resource records to be created:
- SOA (Start of Authority) DNS resource record. SOA record has already been created while Creating Forward Lookup Zone. All parameters related to SOA record are updated during the Configuration of Forward Lookup Zone. SOA record for gopalthorve.com looks as below:
@ 3600 IN SOA ns1.gopalthorve.com. hostmaster.gopalthorve.com. ( 2012032809 ; serial number 86400 ; refresh 7200 ; retry 604800 ; expire 86400 ) ; default TTL
- At least two Name Server (NS) DNS resource records. Primary NS record pointing to primary name server (ns1.gopalthorve.com) and secondary NS record pointing to secondary name server (ns2.gopalthorve.com). These records have already been created during the Configuration of Forward Lookup Zone. The name server records and name server host records looks as pasted below:
@ NS ns1.gopalthorve.com. @ NS ns2.gopalthorve.com.
ns1 A 192.168.0.98 ns2 A 192.168.0.99
- Host (A or AAAA) DNS resource record for the parent domain (say gopalthorve.com >> 192.168.0.98). Host (A or AAAA) record for www sub domain (www.gopalthorve.com >> 192.168.0.98) or CNAME record for www sub domain pointing to the parent domain (www.gopalthorve.com >> gopalthorve.com).
@ A 192.168.0.98 www A 192.168.0.98
- Host (A or AAAA) DNS resource record for FTP Server host for the domain e.g. ftp.gopalthorve.com >> 192.168.0.98.
ftp A 192.168.0.98
- Mail Exchanger (MX) DNS resource record for Email Server host for the domain. e.g. MX record for gopalthorve.com is mail.gopalthorve.com and mail.gopalthorve.com points to host 192.168.0.99.
mail A 192.168.0.99
@ MX 10 mail.gopalthorve.com.
Create Host (A or AAAA) DNS resource record
- Open DNS Manager by clicking Start > Administrative Tools > DNS
- Right click on the forward lookup zone and then click New Host (A or AAAA)…
- Enter name in the first text box. If you want to create a parent domain (leave it blank). To create www record type www in this text box.
- Enter IP address in the third text box to which this host record will point to.
- Click Add Host button to create host resource record.
Create Mail Exchanger (MX) DNS resource record
- As discussed in MX Record, before creating an MX record we have to create a host (A or AAAA) resource record pointing to the IP address of the host where email services for the domain is hosted. I created mail.gopalthorve.com pointing to 192.168.0.99 (mail.gopalthorve.com >> 192.168.0.99).
mail A 192.168.0.99
- Host or child domain: If you want to create Mail Exchanger record for parent domain say gopalthorve.com then leave this field blank otherwise type the name of sub domain for which you want to create mail exchanger (MX) record for.
- Fully Qualified domain name (FQDN) of mail server: Enter FQDN of the host where email services for the domain is hosted. Enter mail.gopalthorve.com i.e. the host resource record we recently created pointing towards email server.
- Mail server priority: Enter the priority (preference) value for this Mail Server, the lower the value the higher the preference. We have discussed this in detail at MX Record.
@ MX 10 mail.gopalthorve.com.
Create SPF (TXT) DNS resource record
- To know more about SPF visit SPF Record and construct your SPF record text.
- From DNS Manager right-click on the zone and then click Other New Records…
- Select Text (TXT) from the window and then click Create Record… button
- Record name: Leave blank for creating this SPF (TXT) DNS resource record for parent domain i.e. gopalthorve.com otherwise enter the name of sub domain for which you want to create this DNS resource record for.
- Text: Visit SPF Record to construct SPF DNS resource record text and enter text in this box.
- Click OK to create the record.
@ TXT ( "v=spf1 a mx ~all" )
Create Alias (CNAME) DNS resource record
- From DNS Manager right click on the forward lookup zone and click New Alias (CNAME)…
- Alias name: Enter the alias or canonical name here e.g. I want to identify parent domain gopalthorve.com with the alias name of www2.gopalthorve.com then enter www2 in this text box.
- FQDN for target host: Enter the FQDN of target host here. In our example this will be gopalthorve.com
One more example: I want to create a Alias name for google.com as google.gopalthorve.com then in alias name text box I will enter google and in target host text box I will enter google.com.
www2 CNAME gopalthorve.com.
google CNAME google.com.
Looking at Zone File
Entire zone file (gopalthorve.com.dns located under %systemroot%\system32\dns folder) for gopalthorve.com looks like below:
; ; Database file gopalthorve.com.dns for gopalthorve.com zone. ; Zone version: 2012040913 ; @ 3600 IN SOA ns1.gopalthorve.com. hostmaster.gopalthorve.com. ( 2012040913 ; serial number 86400 ; refresh 7200 ; retry 604800 ; expire 86400 ) ; default TTL ; ; Zone NS records ; @ NS ns1.gopalthorve.com. @ NS ns2.gopalthorve.com. ; ; Zone records ; @ A 192.168.0.98 @ MX 10 mail.gopalthorve.com. @ TXT ( "v=spf1 a mx ~all" ) ftp A 192.168.0.98 mail A 192.168.0.99 ns1 A 192.168.0.98 ns2 A 192.168.0.99 www A 192.168.0.98