Sample DNS Configuration Files

The DNS resolver uses /etc/resolv.conf to determine the local subdomain, up to three name servers, and a search path (see Figure 2-2). The name server daemon named reads its configuration file /etc/ named.conf (or /etc/named.boot) to locate the directory (such as /var/ named) for the database files, as shown in Figure 2-4. Database files such as db.cache point to other name servers, as shown in Figure 2-5. The two main database record types are address and pointer. Address records contain the IP addresses of names in a subdomain (see Figure 2-6). Pointer records contain the names corresponding to IP addresses (see Figure 2-7).

Figure 2-2. /etc/resolv.conf.

The UNIX operating systems use the text file /etc/resolv.conf to store the DNS resolver configuration entries. BIND version 8 resolver will append each of the search domains to the query name in an attempt to find a match.

search north.acme.com south.acme.com acme.com
nameserver 127.0.0.1
nameserver 10.121.119.60
nameserver 10.121.120.60

Figure 2-4. /etc/named.conf,

The DNS name server daemon, named, reads its default configuration file /etc/named.conf every time it starts or restarts. Therefore, when the database files change, named must be restarted to make the database changes effective.

options {
directory “/var/named”; 
};
// named.local defines localhost 
zone “0.0.127.in-addr.arpa” { 
type master; 
file “named.local”; 
}; 
// db.10.121.119 defines  pointer records for north.acme.com 
zone “119.121.10.in-addr.arpa” { 
type master; 
file “db.10.121.119”; 
}; 
// db.10.121.120 defines  pointer records for north.acme.com 
zone “120.121.10.in-addr.arpa” { 
type master;
file “db.10.121.120”; 
}; 
// db.10.121.121 defines  pointer records for north.acme.com 
zone “121.121.10.in-addr.arpa” { 
type master; 
file “db.10.121.121”; 
};
// db.15.24.44 defines pointer records for blommers.org 
zone “44.24.15.in-addr.arpa” { 
type master;
file “db.15.24.44”; 
}; 
// named.north defines address records for north.acme.com 
zone “north.acme.com” {
type master;
file “named.north”; 
};
// named.blommers defines address records for blommers.org 
zone “blommers.org” {
type master;
file “named.blommers”;
}; 
// db.15.24.42 defines address records for blommers.org 
zone “42.24.15.in-addr.arpa” { 
type master; 
file “db.15.24.42”; 
};

Figure 2-5. /etc/named.cache.

The name server uses this file to locate the root name servers. This example cites the Internet’s root name servers at the time of this writing. For name servers inside a firewalled intranet, the private root name servers will be specified here.

;       This file holds the information on root name servers needed to 
;       initialize cache of Internet domain name servers 
.                        3600000  IN  NS    A.ROOT-SERVERS.NET. 
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4 
.                        3600000      NS    B.ROOT-SERVERS.NET. 
B.ROOT-SERVERS.NET.      3600000      A     128.9.0.107 
.                        3600000      NS    C.ROOT-SERVERS.NET. 
C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12 
.                        3600000      NS    D.ROOT-SERVERS.NET. 
D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90 
.                        3600000      NS    E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10 
.                        3600000      NS    F.ROOT-SERVERS.NET. 
F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241 
.                        3600000      NS    G.ROOT-SERVERS.NET. 
G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4 
.                        3600000      NS    H.ROOT-SERVERS.NET. 
H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53 
.                        3600000      NS    I.ROOT-SERVERS.NET. 
I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17 
.                        3600000      NS    J.ROOT-SERVERS.NET. 
J.ROOT-SERVERS.NET.      3600000      A     198.41.0.10 
.                        3600000      NS    K.ROOT-SERVERS.NET. 
K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129 
.                        3600000      NS    L.ROOT-SERVERS.NET. 
L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12 
.                        3600000      NS    M.ROOT-SERVERS.NET. 
M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33 
; End of File

Figure 2-6. /var/adm/named.north.

This name server configuration file contains the names and corresponding IP addresses of all systems in the domain north.acme.com.

                                      1997022700 ; Serial 
                                      28800      ; Refresh 
                                      14400      ; Retry 
                                      3600000    ; Expire 
                                      86400 )    ; Minimum 
; 
; Name servers 
; 
north.acme.com.                 IN      NS    mylinux.blommers.org. 
; 
; Addresses for the canonical names 
; 
localhost.blommers.org.         IN      A     127.0.0.1 

router.north.acme.com.          IN      A     10.121.119.64 
router.north.acme.com.          IN      A     10.121.120.64 
router.north.acme.com.          IN      A     10.121.121.64 

email.north.acme.com.           IN      A     10.121.121.60 
fileserver.north.acme.com.      IN      A     10.121.121.61 
imacdv.north.acme.com.          IN      A     10.121.121.62 
printer.north.acme.com.         IN      A     10.121.121.63 
same.north.acme.com.            IN      A     10.121.121.200

Figure 2-7. /var/adm/db.121.121.10.

This name server configuration file contains the IP addresses and corresponding names of all systems in the 10.121.121 range.

121.121.10.in-addr.arpa. IN SOA mylinux.blommers.org. root.mylinux.blommers.org.  (
                                      1997022700 ; Serial 
                                      28800      ; Refresh 
                                      14400      ; Retry 
                                      3600000    ; Expire 
                                      86400 )    ; Minimum
; 
; Name servers 
; 
44.24.15.in-addr.arpa.IN NS mylinux.blommers.org. 

; 
; Addresses point to canonical names 
; 
60.121.121.10.in-addr.arpa. IN PTR    email.north.acme.com. 
61.121.121.10.in-addr.arpa. IN PTR    fileserver.north.acme.com. 
62.121.121.10.in-addr.arpa. IN PTR    imacdv.north.acme.com. 
63.121.121.10.in-addr.arpa. IN PTR    printer.north.acme.com. 
64.121.121.10.in-addr.arpa. IN PTR    router.north.acme.com. 
200.121.121.10.in-addr.arpa. IN PTR   same.north.acme.com.

In the interest of completeness, the equivalent to /etc/resolv.conf in the Windows world is a GUI buried in the Network Control Panel. See Figure 2-3 for an example.

At this point it is important to emphasize that the period at the end of domain names is absolutely critical when configuring your own name server database files. To troubleshoot name server configurations, use nslookup, dig, or named itself (by sending it a SIGINT signal to dump its database to a file for inspection). To build an initial set of database files from /etc/hosts, your system may have a utility such as hosts2named or h2d.

When a client attempts to resolve a name, a period at the end of that name implies a fully specified domain, otherwise the SEARCH domains are tried along with domain name pruning until the name server succeeds or the SEARCH and pruning process is exhausted.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.184.75