3.14 DNS server configuration

 <  Day Day Up  >  

As a starting point we use the default caching only nameserver configuration provided by SuSE. The caching only name server forwards requests to other nameservers provided by keyword forwarders and caches the answers for better performance. This configuration is good enough if you only need to resolve names and addresses in the Internet.

In order to use local name resolution too, we add two new zone records: residency.local (name to IP address), and 100.168.192.rev for reverse name resolution (IP address to name). For debugging, we add the logging section because it forces the name server daemon to log all requests in /var/log/messages. [18]

[18] For more information see BIND 9 Administrator Reference Manual : http://www.bind9.net/Bv9ARM.html

Example 3-27. /etc/named.conf
 options { directory "/var/named";         forwarders {       ;                 }; listen-on { any;}; notify no;         forward first; }; zone "localhost" in {         type master;         file "localhost.zone"; }; zone "0.0.127.in-addr.arpa" in {         type master;         file "127.0.0.zone"; }; zone "." in { type hint;         file "root.hint"; }; # You can insert further zone records for your own domains below. logging {         category queries {                 default_syslog;                 };         category update {                 default_syslog;                 };         }; zone "residency.local" {         type master;         file "/var/named/residency.local.hosts";         }; zone "100.168.192.in-addr.arpa" { type master;         file "/var/named/100.168.192.rev";         }; 

Now we create our own local zone files: residency.local, and for reverse lookup, 100.168.192.rev. We need a residency.local file in order to be able to resolve names to IP addresses.

Example 3-28. /var/named/residency.local
 $ttl 38400 residency.local.   IN    SOA root.p630sles. (                         0310221736    ; serial                         10800         ; refresh                         3600          ; retry                         604800        ; expiry                         38400 )       ; minimum residency.local.        IN      NS  $GENERATE 111-254      node-$   A       192.168.100.$  lpar8.residency.local.  IN      A lpar7.residency.local.  IN      A lpar6.residency.local.  IN      A lpar5.residency.local.  IN      A lpar4.residency.local.  IN      A lpar3.residency.local.  IN      A lpar2.residency.local.  IN      A lpar1.residency.local.  IN      A p630sles.residency.local.       IN      A 


Every time you change something in the zone file, you need to change the serial number in the second line.

In order to resolve addresses to names, we need a file for reverse name resolution. In this file, addresses are written in opposite order:, instead of

Example 3-29. /var/named/100.168.192.rev
 $ttl 38400100.168.192.in-addr.arpa.  IN    SOA    p630sles. root.p630sles. (                         9998899999                         10800                         3600                         604800                         38400 ) 100.168.192.in-addr.arpa.       IN      NS      p630sles    IN      PTR     lpar1.    IN      PTR     lpar2.    IN      PTR     lpar3.    IN      PTR     lpar4.    IN      PTR     lpar5.    IN      PTR     lpar6.    IN      PTR     lpar7.    IN      PTR     lpar8.   IN      PTR     p630sles.  $GENERATE 111-254 $            PTR     node-$  . 


The trick in both zone files is in the line starting with $GENERATE: it will assign all nodes above 111 names; that is, node-111, node-112 and so on. This is a useful feature in combination with a dhcpd server for a larger environment or cluster, because you do not need to add nodes one by one anymore.

 <  Day Day Up  >  

Quintero - Deploying Linux on IBM E-Server Pseries Clusters
Quintero - Deploying Linux on IBM E-Server Pseries Clusters
Year: 2003
Pages: 108

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net