[Next] [Previous] [Up] [Top] [Contents]

19.2 Host Names and addresses

19.2.2 Dynamic name resolution

Network names and addresses change and new hosts are constantly being added to the network, so it's impossible to keep the static host table up-to-date. To serve this need we have Domain Name Servers (DNS) on the network. These are authoritative, or query the authoritative servers to determine IP address, when given host names. The DNS server will be running named, the Internet domain name server daemon (/usr/[etc,sbin]/in.named).

For SunOS 4.1.X you can get this automatically through the Network Information Services (NIS) when you set the option "B=-b" in /var/yp/Makefile and re-initialize the NIS maps. Then NIS will automatically query the name server specified in /etc/resolv.conf for hosts not found in the NIS maps.

For SunOS 5.X you turn on this service by specifying "dns" for the host entry in the network switch configuration file, /etc/nsswitch.conf. You can also have the system query NIS and or the local /etc/hosts file by specifying those, in the desired order, on this entry, e.g.:

hosts: dns nis files

Queries to DNS will then be resolved using the information supplied in /etc/resolv.conf.

The /etc/resolv.conf file contains the IP domain name of the system and a list of name servers to use. For SunOS 5.X you can also specify a search path to use, e.g.:

domain acs.ohio-state.edu.

nameserver 128.146.1.7 <---- ns1.net.ohio-state.edu (nisca.acs), authoritative for OSU

nameserver 128.146.48.7 <---- ns2.net.ohio-state.edu

search acs.ohio-state.edu magnus.acs.ohio-state.edu eng.ohio-state.edu ohio-state.edu

The domain will automatically be appended to any host name not having a dot (.) in the name. The first nameserver listed will be considered primary and queried first. Additional ones will be queried, in order (up to a maximum of 3), if the primary one does not respond to the request.

Many resolvers will accept the search field, whereby names to be resolved have these strings appended and then checked for resolution, in the order specified, until one is resolved.


Unix System Administration - 8 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]