The /etc/resolv.conf File





The /etc/resolv.conf File

DNS clients (servers not running BIND) use the /etc/resolv.conf file to determine both the location of their DNS server and the domains to which they belong. The file generally has two columns; the first contains a keyword, and the second contains the desired values separated by commas. See Figure for a list of keywords.

Figure Keywords in /etc/resolv.conf

Keyword

Value

nameserver

IP address of your DNS name server. There should be only one entry per nameserver keyword. If there is more than one name server, use multiple nameserver lines.

domain

The local domain name to be used by default. If the server is bigboy.my-web-site.org, then the entry would just be my-web-site.org.

search

If you refer to another server just by its name without the domain added on, DNS on your client appends the server name to each domain in this list and does a DNS lookup on each to get the remote servers' IP addresses. This is a handy time-saving feature, enabling you to refer to servers in the same domain by only their server name without having to specify the domain. The domains in this list must be separated by spaces.


Take a look at a sample configuration in which the client server's main domain is my-web-site.org, but it also is a member of domains another-web-site.org and my-web-business.org, which should be searched for shorthand references to other servers. Two name servers, 192.168.1.100 and 192.168.1.102, provide DNS name resolution:

     search my-web-site.org another-web-site.org my-web-business.org
     nameserver 192.168.1.100
     nameserver 192.168.1.102

The first domain listed after the search directive must be the home domain of your network, in this case my-web-site.org. Placing a domain and search entry in the /etc/resolv.conf is redundant, therefore.


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows