This section shows the files you need to implement DNS for a sample Internet-connected network, based on the examples used in this chapter.
The IP addresses and network numbers used in examples and code samples in this manual are for illustration purposes only. Do not use them as shown because they might have been assigned to an actual network or host.
This example assumes the following.
An environment connected to the Internet
Two networks, each with its own domain (doc.com and sales.doc.com) and its own DNS zone
The doc.com domain and zone is the top zone over the sales.doc.com subdomain and zone
Each network has its own network number
|
Name and Zone |
Number |
|---|---|
|
doc.com |
123.45.6 |
|
sales.doc.com |
111.22.3 |
Each zone has a master and one slave server, and the slave server of sales.doc.com is also the master server of doc.com:
|
Zone |
Host Name |
Function |
Address | CNAME |
|---|---|---|---|---|
|
doc.com |
sirius |
master for doc.com |
123.45.6.1 | dnsmaster |
|
doc.com |
deneb |
slave for doc.com |
111.22.3.5 | dnssecond |
|
sales.doc.com |
altair |
master for sales.doc.com |
111.22.3.4 | dnssales |
|
sales.doc.com |
altair |
slave for sales.doc.com |
123.45.6.1 | dnsmaster |
The following code examples show boot files for the three servers in the two networks:
; named.boot file on the dnsmastr (sirius) ; ; files required by in.named are located here directory /var/named ; here are the names of the master files cache . named.ca master doc.com db.doc master 0.0.127.in-addr.arpa named.local master 6.45.123.in-addr.arpa doc.rev ;This system is also the slave for the sales.doc.com domain slave sales.doc.com 111.22.3.4 db.sales slave 3.22.111.in-addr.arpa 111.22.3.4 sales.rev |
; named.boot file on the dnssales (altair) ; ; in.named is located here directory /var/named ; here are the names of the master files cache . named.ca master sales.doc.com db.sales master 0.0.127.in-addr.arpa db.127.0.0 master 3.22.111.in-addr.arpa db.192.168.8 |
; named.boot file on the dnsecond (deneb) directory /var/named cache . named.ca slave doc.com 123.45.6.1 doc.com slave 6.45.123.in-addr.arpa 123.45.6.1 doc.123.45.6 |
The following code examples show resolv.conf files for the three servers in the two networks. If the host in question is not running in.named, the local host address should not be used as a name server.
; ; /etc/resolv.conf file for dnsmaster (sirius) ; domain doc.com nameserver 0.0.0.0 nameserver 111.22.3.5 |
; ; /etc/resolv.conf file for dnssales (altair) ; domain sales.doc.com nameserver 111.22.3.4 nameserver 123.45.6.1 |
; ; /etc/resolv.conf for dnssecond ; domain doc.com nameserver 111.22.3.5 nameserver 123.45.6.1 |
The following code example shows the named.local file used by the two master servers on the two networks. Both servers have the same file.
; SOA rec
0.0.127.in-addr.arpa. IN SOA siriusdoc.com. sysop.centauri.doc.com.(
19970331 ; serial number
10800 ; refresh every 3 hours
10800 ; retry every 3 hours
604800 ; expire after a week
86400 ) ; TTL of 1 day
; Name Servers
0.0.127.in-addr.arpa. IN NS sirius.doc.com.
0.0.127.in_addr.arpa IN NS dnssecond.doc.com
1 IN PTR localhost.
|
The following code examples show db.doc and db.sales files for the two master servers on the two networks.
; SOA rec
doc.com. IN SOA sirius.doc.com. sysop.centauri.doc.com. (
19970332 ; serial number
10800 ; refresh every 3 hours
10800 ; retry every 3 hours
604800 ; expire after a week
86400 ) ; TTL of 1 day
; Name Servers
doc.com. IN NS sirius.doc.com.
sales.doc.com. IN NS altair.sales.doc.com.
; Addresses
localhost IN A 127.0.0.1
sirius IN A 123.45.6.1
rigel IN A 123.45.6.112
antares IN A 123.45.6.90
polaris IN A 123.45.6.101
procyon IN A 123.45.6.79
tauceti IN A 123.45.6.69
altair.sales.doc.com. N A 111.22.3.4
; aliases
dnsmastr IN CNAME sirius.doc.com.
dnssecond.doc.com IN CNAME deneb.doc.com
|
; SOA rec
sales.doc.com. IN SOA altair.sales.doc.com. sysop.polaris.doc.com. (
19970332 ; serial number
10800 ; refresh every 3 hours
10800 ; retry every 3 hours
604800 ; expire after a week
86400 ) ; TTL of 1 day
; Name Servers
doc.com. IN NS sirius.doc.com.
sales.doc.com. IN NS altair.sales.doc.com.
; Addresses
altair IN A 111.22.3.4
localhost IN A 127.0.0.1
sirius.doc.com. IN A 123.45.6.1
luna IN A 192.168.8.22
phoebus IN A 192.168.8.24
deimos IN A 192.168.8.25
ganymede IN A 192.168.8.27
europa IN A 192.168.8.28
callisto IN A 192.168.8.29
;
; aliases
dnssales.sales.doc.com IN CNAME altair.sales.doc.com
|
The following code examples show hosts.rev files for the two master servers on the two networks:
; SOA rec
6.45.123.in-addr.arpa. IN SOA sirius.doc.com. sysop.centauri.doc.com. (
19970331 ; serial number
10800 ; refresh every 3 hours
10800 ; retry every 3 hours
604800 ; expire after a week
86400 ) ; TTL of 1 day
; Name Servers
6.45.123.in-addr.arpa. IN NS sirius.doc.com.
;Pointer records for 123.45.6
1 IN PTR sirius.doc.com.
112 IN PTR rigel.doc.com.
90 IN PTR antares.doc.com.
101 IN PTR polaris.doc.com.
79 IN PTR procyon.doc.com.
69 IN PTR tauceti.doc.com.
|
; SOA rec
3.22.111.in-addr.arpa. IN SOA altair.sales.doc.com. \
sysop.polaris.doc.com.(
19970331 ; serial number
10800 ; refresh every 3 hours
10800 ; retry every 3 hours
604800 ; expire after a week
86400 ) ; TTL of 1 day
; Name Servers
3.22.111.in-addr.arpa. IN NS altair.sales.doc.com.; \
Pointer records for 111.22.3
22 IN PTR luna
23 IN PTR deneb
24 IN PTR phoebus
25 IN PTR deimos
26 IN PTR altair
27 IN PTR ganymede
28 IN PTR europa
29 IN PTR callisto
|
The following code example shows the named.ca file that is stored on each of the two master servers on the two networks. Both servers use identical named.ca files.
; ; formerly NS1.ISI.EDU . 3600000 NS B.ROOT-SERVERS.NET. B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107 ; ; formerly C.PSI.NET . 3600000 NS C.ROOT-SERVERS.NET. C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 ; ; formerly TERP.UMD.EDU . 3600000 NS D.ROOT-SERVERS.NET. D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 ; ; formerly NS.NASA.GOV ;. 3600000 NS E.ROOT-SERVERS.NET. E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 ; ; formerly NS.ISC.ORG . 3600000 NS F.ROOT-SERVERS.NET. F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 ; ; formerly NS.NIC.DDN.MIL . 3600000 NS G.ROOT-SERVERS.NET. G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 ; ; formerly AOS.ARL.ARMY.MIL . 3600000 NS H.ROOT-SERVERS.NET. H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53 ; ; formerly NIC.NORDU.NET . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 ; ; temporarily housed at NSI (InterNIC) . 3600000 NS J.ROOT-SERVERS.NET. J.ROOT-SERVERS.NET. 3600000 A 198.41.0.10 ; ; temporarily housed at NSI (InterNIC) . 3600000 NS K.ROOT-SERVERS.NET. K.ROOT-SERVERS.NET. 3600000 A 198.41.0.11 ; ; temporarily housed at ISI (IANA) . 3600000 NS L.ROOT-SERVERS.NET. L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12 ; ; temporarily housed at ISI (IANA) . 3600000 NS M.ROOT-SERVERS.NET. M.ROOT-SERVERS.NET. 3600000 A 198.32.65.12 ; End of File |