Hostname Resolution

or

Converting hostnames to IP addresses

Introduction

All hosts on an IP internet have an address, a unique number by which they are knowm. This is the IP address, and is usually presented in dotted quad form. For example: 192.82.208.1 (all four sections are between 0 (zero) and 255). Routing uses IP addresses. It is difficult to remember arbitrary strings of numbers, and the IP address frequently changes when the machine moves. hostnames are designed to be (usually) easier to remember, and they will (usually) remain the same even when the IP address changes. The problem is mapping the hostname into an IP address. That procedure is called hostname resolution.

There are three major ways to perform hostname resolution:

This is the order that Irix name resolution defaults to (if NIS is turned on). Only two of these are usually useful on a SLIP, PPP or ISDN connected host.

local: /etc/hosts

Every host must have a minimal amount of info in /etc/hosts, because it cannot start networking without it -- it needs a minimal number of hostname/IP address mappings to get started. Many sites will do all hostname resolution using /etc/hosts, but there is some institutionalized mechanism to keep it reasonably current. In an environment where the networks are in constant flux, keeping /etc/hosts up-to-date is a daunting problem. It is eased because famous hosts (like servers, etc) tend to move less often than smaller machines. For many sites, this is a valid (indeed the only) hostname resolution mechanism.

A minimum /etc/hosts file, just enough to start networking and connect to a remote server would look something like this (all IP addresses and hostnames changed to protect the Internet):

#
# local host is needed for the system to function
127.0.0.1       localhost loghost
#
# the hostname for this machine.  IRIS is the default as shipped
192.0.2.1       IRIS
#
# the name and IP address of the local end of the SLIP or PPP link,
#  if different from the hostname
123.456.78.90   client.sub.domain client
#
# the name and IP address of the server,
#  at the remote end of the SLIP or PPP link
123.456.79.80   server.sub.domain server
#
# you need to be able to resolve at least the multicast net name:
224.0.0.0       multicast.net

However, on a dialup host, if the network connection (SLIP or PPP connection) isn't up, it doesn't matter if you can't resolve a hostname, because you can't get there anyway. A method of using a remote (and more importantly, official) host's /etc/hosts file is the preferred mechanism (even for normal, permanently connected hosts).

DNS: Domain Name Service

DNS is the method whereby different domains of authority exchange name resolution data. It is also perfectly usable for name resolution within a domain. However, it does require some configuration. Irix has some extensions to the standard DNS configuration that make it more useful, especially for dialup hosts. See `man resolver` for more detail.

The basic configuration file for name service clients is resolv.conf. It lives in /etc/resolv.conf in Irix 5.0 and later, and in /usr/etc/resolv.conf in previous releases. Here is a generic resolv.conf, although you do have to fill in the IP address of your domain's nameservers:

domain sub.domain
nameserver 123.456.79.3
nameserver 123.456.70.2
hostresorder local bind

NIS: Network Information Service

NIS is very useful to provide name service (hostname resolution) and other information between machines on the same network segment. NIS is less useful on a dialup host, because it cannot automatically locate a server, you must manually run `ypbind ypservername` each time the link comes up. This makes it much less useful than DNS for dialup hosts, and is not recommended.


Scott Henry <scotth@sgi.com>
Last modified: Sun Feb 1 14:38:10 1998