[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Files Reference

resolv.conf File Format for TCP/IP

Purpose

Defines Domain Name Protocol (DOMAIN) name-server information for local resolver routines.

Description

If the /etc/resolv.conf file exists, the local resolver routines either use a local name resolution database maintained by a local named daemon (a process) to resolve Internet names and addresses, or they use the DOMAIN protocol to request name resolution services from a remote DOMAIN name server host. If no resolv.conf file exist than the resolver routines continue searching their direct path, which may include searching through /etc/hosts file or the NIS hosts map.

Note
If the resolv.conf file does not exist, the resolver routines attempt name resolution using the default paths, the /etc/netsvc.conf file, or the NSORDER environment variable.

If the host is a name server, the resolv.conf file must exist and contain a nameserver reference to itself as well as a default domain.

The resolv.conf file can contain one domain entry or one search entry, a maximum of three nameserver entries, and any number of options entries.

A domain entry tells the resolver routines which default domain name to append to names that do not end with a . (period). There can be only one domain entry. This entry is of the form:

domain DomainName

The DomainName variable is the name of the local Internet domain. If there is no domain or search entry in the file, the gethostbyname subroutine returns the default domain (that is, everything following the first period). If the host name does not have a domain name included, the root domain is assumed.

A search entry defines the list of domains to search when resolving a name. Only one domain entry or search entry can be used. If the domain entry is used, the default search list is the default domain. A search entry should be used when a search list other than the default is required. The entry is of the form:

search DomainName ...

The search entry can have from one to six DomainName variables. The first DomainName variable is interpreted as the default domain name. The DomainName variable is the name of a domain that should be included in the search list.

Notes:
  1. The domain entry and search entry are mutually exclusive, so if both entries are used, the one that appears last will override the other.
  2. The resolver routines require you to set the default domain. If the default domain is not set in the /etc/resolv.conf file, then you must set it in the hostname on the machine.

A nameserver entry defines the Internet address of a remote DOMAIN name server to the resolver routines on the local domain. This entry is of the form:

nameserver Address

The Address variable is the dotted decimal address of the remote name server. If more than one name server is listed, the resolver routines query each name server (in the order listed) until either the query succeeds or the maximum number of attempts have been made.

The Address variable is the address of the preferred network on which you want the address returned. The Netmask variable is the netmask of the corresponding network address.

The options entry specifies miscellaneous behaviors of the resolver. The entry is of the form:

options OptionName 

The OptionName variable can have one of the following values:

debug Turns on the RES_DEBUG resolver option, which enables resolver debugging.
ndots:n Specifies that for a domain name with n or more periods ( . ) in it, the resolver should try to look up the domain name "as is" before applying the search list.

Entries in this file can be made using the System Management Interface Tool (SMIT), by using the namerslv command, or by creating and editing the file with an editor.

Examples

To define a domain host that is not a name server, enter:

domain abc.aus.century.com
nameserver 192.9.201.1
nameserver 192.9.201.2

The example contains entries in the resolv.conf file for a host that is not a name server.

Files

/usr/lpp/tcpip/samples/resolv.conf Contains the sample resolv.conf file.

Related Information

The namerslv command.

The named daemon.

The /etc/hosts file format.

The gethostbyaddr subroutine, gethostname subroutine.

TCP/IP Name Resolution.

Configuring Name Servers and Naming in AIX 5L Version 5.2 System Management Guide: Communications and Networks.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]