System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)

Domain Names

A domain name is the name that is assigned to a group of systems on a local network that share DNS administrative files. A domain name is required for the network information service database to work properly.

Default Domain Name

DNS obtains your default domain name from your resolv.conf file.

Trailing Dots in Domain Names

When working with DNS-related files, follow these rules that pertain to the trailing dot in domain names:

DNS Clients and the Resolver

To be a DNS client, a machine must run the resolver. The resolver is neither a daemon nor a single program. The resolver is a set of dynamic library routines used by applications that need to know machine names. The resolver's function is to resolve users' queries. The resolver queries a name server, which then returns either the requested information or a referral to another server. Once the resolver is configured, a machine can request DNS service from a name server.

The DNS name server uses several files to load its database. At the resolver level, the server needs the file /etc/resolv.conf listing the addresses of the servers that store the requested information. The resolver reads this resolv.conf file to find the name of the local domain and the location of name servers. This resolv.conf file sets the local domain name. The file also instructs the resolver routines to query the listed name servers for information. Normally, each DNS client system on your network has a resolv.conf file in its /etc directory. If a client does not have a resolv.conf file, the client uses a default server at IP address 127.0.0.1.

Whenever the resolver has to find the IP address of a host, or the host name corresponding to an address, the resolver builds a query package and sends it to the name servers listed in /etc/resolv.conf. The servers either answer the query locally or contact other known servers, ultimately returning the answer to the resolver.

When a machine's /etc/nsswitch.conf file specifies hosts: dns or any other variant that includes dns in the hosts line, the resolver libraries are automatically used. If the nsswitch.conf file specifies another naming service before dns, that naming service is consulted first. If that naming service does not find the host in question, the resolver libraries are then used.

For example, if the hosts line in the nsswitch.conf file specifies hosts: nisplus dns, the NIS+ naming service will first be searched for host information. If the information is not found in NIS+, then the DNS resolver is used. A hosts:nisplus dns line in a switch file indicates the use of NIS+ for local host information and DNS for remote information.

There are two kinds of DNS clients.