0 Replies Latest reply: Dec 3, 2011 5:24 AM by 448563 RSS

    /etc/hosts and /etc/resolv.conf questions

    448563
      Hi.
      <br>
      <b>Q1.</b> is:
      <br>
           Does anyone know what happens when the ordering of the hostname and the IP address on a line in /etc/hosts is reversed to what it usually is ?
      <br>
           Usually entries in /etc/hosts are:
      <br>
                     ip_address hostname     e.g. 127.0.0.1 localhost
      <br>
           What happens when there is an entry that is by mistake:
      <br>
                     hostname ip_address     e.g. localhost 127.0.0.1
      <br>
           The "hostname" and "ip_address" are valid HOSTNAME and IP_ADDRESS strings i.e. if the line had instead been:          ip_address hostname          it would have been perfectly OK.
      <br>
           The only error in the line is the ordering of the HOSTNAME and the IP_ADDRESS.
      <br>
           Is such an entry understood correctly or is it rejected as invalid ?
      <br>
           There is no way that "hostname" could be interpreted as some kind of IP_ADDRESS and "ip_address" as a HOSTNAME is there ?
      <br>
           So when Solaris tries to understand the line as IP_ADDRESS first and then HOSTNAME it fails and rejects the line ?
      <br>
           Is the rest of /etc/hosts processed i.e. the /etc/hosts entries before and after the invalid line ?
      <br>
           Or is the entire /etc/hosts file rejected if there is only one error which is this reverse ordering error ?
      <br>
           (If it is treated as an error as you could possibly programmatically correctly work out which string was HOSTNAME and which IP_ADDRESS for either ordering.)
      <br>
           In what error logs are errors in the processing of /etc/hosts recorded ?
      <br>
      <b>Q2.</b> is:
      <br>
           More confirmation than question: the HOSTNAME in /etc/hosts is an alias for the IP_ADDRESS of a local or remote network interface so if there is an entry for the IP address (say 123.345.567.10) of a local network interface labelled XXX in /etc/hosts like:
      <br>
                123.345.567.10 alias_for_ip_address_of_network_interface_XXX
      <br>
           then the alias (i.e. alias_for_ip_address_of_network_interface_XXX) can be referenced in the /etc/hostname.XXX interface file used to configure the XXX interface at system startup and the alias reference in the /etc/hostname.XXX interface file provides the IP address of the XXX interface as read from the /etc/hosts file by looking up the alias in the /etc/hosts file:
      <br>
                alias_for_ip_address_of_network_interface_XXX netmask 255.255.255.128 + broadcast 123.345.567.127 up
      <br>
           instead of:
      <br>
                123.345.567.10 netmask 255.255.255.128 + broadcast 123.345.567.127 up
      <br>
      <b>Q3.</b> is:
      <br>
           When the command line utility /etc/hostname of a Host is used on the Host to return the name of the Host and the Host is multi-homed so it has different network interfaces which have different alias and IP addresses defined in /etc/hosts what name of the Host is returned by /etc/hostname and how is that name selected ? Or is there a separate hostname attribute for the Host defined elsewhere ?
      <br>
      <b>Finally Q4.</b> is:
      <br>
           If a Host is multi-homed and has two network interfaces which are connected to the networks with domains:
      <br>
                a.b.c.d
      <br>
           and
      <br>
                e.f.c.d
      <br>
           which have the DNS nameservers:
      <br>
                123.456.789.20  abcdnameserver.a.b.c.d
      <br>
           and:
      <br>
                321.654.987.20  efcdnameserver.e.f.c.d
      <br>
           respectively, is the following form for /etc/resolv.conf on the Host a valid form for /etc/resolv.conf:
      <br>
                domain a.b.c.d
                123.456.789.20
      <br>
                domain e.f.c.d
                321.654.987.20
      <br>
                search a.b.c.d e.f.c.d
      <br>
           In what error logs are errors in the processing of /etc/hosts recorded ?
      <br>
      <br>
      Thanks,
      <br>
      Brett.
      <br>