If you run a name server on your local host, you have to set it up separately, as will be explained in the following section. If your are on a local network and have the opportunity to use an existing nameserver, this should always be preferred.
The most important option in resolv.conf is nameserver, which gives the IP-address of a name server to use. If you specify several name servers by giving the nameserver option several times, they are tried in the order given. You should therefore put the most reliable server first. Currently, up to three name servers are supported.
If no nameserver option is given, the resolver attempts to connect to the name server on the local host.
Two other options, domain and search deal with default domains that are tacked onto a hostname if BIND fails to resolve it with the first query. The search option specifies a list of domain names to be tried. The list items are separated by spaces or tabs.
If no search option is given, a default search list is constructed from the local domain name by using the domain name itself, plus all parent domains up to the root. The local domain name may be given using the domain statement; if none is given, the resolver obtains it through the getdomainname(2) system call.
If this sounds confusing to you, consider this sample resolv.conf file for the Virtual Brewery:
# /etc/resolv.conf # Our domain domain vbrew.com # # We use vlager as central nameserver: nameserver 126.96.36.199When resolving the name vale, the resolver would look up vale, and failing this, vale.vbrew.com, and vale.com.