
Skip to: site menu |main content
Welcome to my personal site. If You have any question or suggestion please feel free to contact me from contact page.
When configuring the resolver library to use the BIND name service for host lookups, you also have to tell it which name servers to use. There is a separate file for this, called resolv.conf. If this file does not exist or is empty, the resolver assumes the name server is on your local host.
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 domain.com
#
# We use vlager as central nameserver:
nameserver 191.72.1.1
InderSingh.com v1.2
(May 18, 2012)
Recent comments
16 weeks 4 days ago
16 weeks 4 days ago
16 weeks 4 days ago
1 year 16 weeks ago
1 year 16 weeks ago
1 year 16 weeks ago
1 year 31 weeks ago
1 year 33 weeks ago
1 year 34 weeks ago
1 year 39 weeks ago