Solaris Naming Setup and Configuration Guide

Setting Up the hosts File

The hosts file contains all the data about every machine in your zone. If a zone covers more than one domain, all machines in all the domains covered by the zone are listed in the zone's host file (see "Setting Up Subdomains--Same Zone").


Note -

The name hosts is a generic name indicating the file's purpose and content. But to avoid confusion with /etc/hosts, you should name this file something other than hosts. If you have more than one zone, each zone must have its own hosts file and each of these zone hosts files must have a unique name. For example, if your DNS domain is divided into doc.com and sales.doc.com zones, you could name one hosts file db.doc and the other sales.db.doc.


There must be a separate, uniquely named, hosts file for each zone. If you have more than one zone, each zone's host file must include information about the master (primary and secondary) servers of the other zones, as described in "Setting Up Subdomains--Different Zones".


Example 13-6 Sample hosts File


;
; SOA rec
doc.com  IN SOA sirius.doc.com sysop.centauri.doc.com (
                 1997071401       ;  serial number (YYYYMMDD##)
                      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      IN  A   111.22.3.4
; aliases
durvasa                   IN  CNAME sirius.doc.com
dnsmastr                  IN  CNAME sirius.doc.com
dnssales                  IN  CNAME altair.sales.doc.com

A hosts file usually contains these elements:

(See Solaris Naming Administration Guide for detailed descriptions of these resource record types.)