The named.hosts File

Start of authority SOA Marks the beginning of a zones data and defines parameters that affect the entire zone Name server NS Identifies a domains name server Address A Converts a host name to an IP address Pointer PTR Converts an IP address to a host name Mail exchange MX Identifies where to deliver e−mail for a given hosts domain name Canonical name CNAME Defines an alias host name Host information HINFO Describes a hosts hardware and OS Well−known services WKS Advertises hosts network services The format of a resource record is: name ttl IN type data where name The name of DNS object the RR references; it can be an individual host, or an entire domain. The name is relative to the current domain unless it ends with a dot; if a name is omitted, the RR applies to the last named object. ttl Time−to−live defines the length of time, in seconds, that the information in this RR should be kept in the cache. Usually it is omitted and the default minimal value set for the entire zone is applied. IN An Internet class of the RR type Identifies the RR type according to the previous table data The information specific to the RR type: SOA A list of appropriate parameters for the zone NS A name server domain name A An IP address PTR A host domain name CNAME An alias host name MX A mail exchange host name HINFO Abbreviated hardware and OS descriptions WKS A list of implemented network services, etc.

16.3.1.3 The Resource Record Files

Individual RR files are discussed in more detail in this section.

16.3.1.3.1 The named.hosts File

The named.hosts file contains most of the domain information. This file converts host names to IP addresses. Obviously A records are prevailing, but the file also contains NS, MX, CNAME, and other records. This file only exists on the primary name server. All other servers get this information from the primary server. 385 cat varnamednamed.hosts ; varnamednamed.hosts ; ; for last update see the serial of the SOA record ; ==================================================== ; NAME TTL CLASS TYPE RDATA ; ==================================================== ; IN SOA pegasus.myschool.scps.edu.sajhc.myschool. scps.edu. 9906091 ; Serial − corresponds to update date 3600 ; Refresh every 1 hour 600 ; Retry every 10 minutes 2419200 ; Expire after 4 weeks 86400 ; Default min. TTL value of 1 day ; IN NS pegasus.myscool.scps.edu. IN NS orion.myschool.scps.edu. IN NS acme.ucc.cuny.edu. IN NS nis.ans.net. IN NS ns.ans.net. IN NS cunixd.cc.columbia.edu. ; ; loopback loopback IN A 127.0.0.1 localhost IN CNAME loopback ; ; ; ; MY SCHOOL ; ; ; ORIGIN myschool.scps.edu. pegasus IN A 146.98.1.12 IN HINFO Sun SunOS IN MX 10 pegasus patsy IN A 146.98.1.11 IN HINFO Sparc1 SunOS IN MX 10 patsy mvaxgr IN A 146.98.1.4 IN HINFO VAX VMS IN MX 10 mvaxgr.myschool.scps.edu. hcgate1 IN A 146.98.1.15 IN HINFO CISCO MGS ; ..... ; ..... ORIGIN ph.myschool.scps.edu. ; Physics and Astronomy ; bjl IN A 146.98.8.11 IN HINFO PC DOS bjlnote IN A 146.98.8.22 IN HINFO ZNOTE DOS ; ..... ..... The named.hosts file begins with an SOA record. The sign refers to the last previously defined domain here, in the named.boot file, which is still the actual one. A few NS records follow, defining name servers for this domain. The rest are A records predominantly, HINFO records, and MX 386 The SOA record defines very important file parameters: Serial number of the file — every time the file is updated the serial should be increased • Refresh time — the time period in seconds that secondary servers must query the primary server for possible changes update of the file • Retry time — the time period in seconds that the secondary server must retry its query if the previous one did not succeed • Expire time — the time period in seconds that the database is considered as the actual one after the primary name server has stopped running and does not respond to any query • Minimum TTL — default time−to−live of records stored in the cache • It is extremely important to increase the serial number after any update of the named.hosts file. For secondary name servers, this is the only sign that the file has been updated. When querying the primary server, a secondary server actually checks the current serial of the file; after comparing this value with the serial of the files copy that it already keeps, the decision about the files transfer is made. Obviously any file update without a serial number increase is useless, because it will not be spread toward secondary servers. It can be useful to implement the current date as the serial number for a current file update, in order to continue the increasing order of the sequence of serials. A serial is a 32−bit number up to 4 billion, so even the full date is acceptable. An example is presented for the update done on May 23, 2000: 2000052302 The last two digits are a daily version — the second version for this day

16.3.1.3.2 The named.local File