Networking Guide
Chapter 6, Configuring the Domain Name Service

Sample hosts file

Sample hosts file

This file contains the resource records pertaining to the machines in a particular zone. Its filename often contains the name of the zone, such as ucb-hosts or mynet.hosts. This allows multiple hosts files for machines that serve multiple zones.

Each hosts file must begin with the SOA (start of authority) and NS (name server) resource records, which are generally followed by information on each of the domain's hosts, including records of addresses (A), nicknames (CNAME), host-specific information (HINFO), and well-known services (WKS) available to the domain.

   ;
   ;    @(#)mynet.hosts    2.0       94/05/27
   ;
   @            IN   SOA   volga.mynet.COM. dave.mynet.COM (
                           1993091901 ; Serial
                           10800     ; Refresh
                           1800      ; Retry
                           3600000   ; Expire
                           259200 )   ; Minimum
                IN   NS    volga.mynet.COM
                IN   NS    istanbul.mynet.COM
   localhost    IN   A     127.1
   volga        IN   A     132.147.118.1
                IN   A     132.147.246.1
                IN   HINFO Intel i486 UNIX
                IN   WKS   132.147.118.1 UDP echo tftp time
                IN   WKS   132.147.118.1 TCP ( telnet
                           discard sunrpc sftp
                           uucp-path systat daytime
                           netstat qotd nntp
                           link chargen ftp
                           auth whois mtp
                           pop rje finger smtp
                           supdup hostnames
                           domain
                           nameserver )
   volga-cities IN   CNAME volga
   columbia     IN   A     132.147.118.2
   thames       IN   A     132.147.118.3
   seine        IN   A     132.147.118.4
                IN   HINFO Intel i386 UNIX
   yangtze      IN   A     132.147.118.5
   mekong       IN   A     132.147.118.6
   ; other machine names follow; deleted in example to save space
   istanbul     IN   A     132.147.246.25
   nairobi      IN   A     132.147.246.26
                IN   HINFO Intel i386 UNIX
   dublin       IN   A     132.147.246.27

See also: