Archive:Docs/Drafts/AdministrationGuide/Servers/DNSBIND/ClientConfiguration

= DNS and BIND =

Client Configuration
For client configuration there are four important files:,  ,  , and .

/etc/hosts
The following is an example  file:

127.0.0.1      localhost.localdomain localhost testmachine
 * 1            localhost6.localdomain6 localhost6

The syntax is as follows: IP address, Fully Qualified Domain Name (FQDN), aliases or hostnames.A localhost entry is required otherwise applications will break. The second line is for IPv6, which will not be covered in this guide. Using this example, the  and   commands will be the same as using the   command.

/etc/host.conf
The following is an example  file:

order hosts,bind multi on nospoof on

The  section defines the order the resolver library will use. In this case the resolver will first query the local hosts file,, and then a DNS server. The  option allows a machine in   to have multiple IP addresses, which is useful for systems with more than one network interface. Use the  option to help prevent IP spoofing.

/etc/nsswitch.conf
On systems running the GNU version 2 of the standard library, glibc, the  file takes precedence over. If you are running glibc ignore the  file. For DNS configuration the most important entry in  is the hosts entry:

hosts:	files dns

This defines the order the resolver will use. Using this example, the resolver will first query the local hosts file. If the query can not be resolved using the information in, a DNS server is queried. If the  file only contained an entry for localhost, a DNS server would be used for all queries other than those for localhost.

/etc/resolv.conf
The  file is used to list the IP addresses of nameservers to use for DNS queries. This nameservers listed will be used to resolve all queries that can not be resolved using the  file. The following is an example  file:

domain testdomain.com nameserver 192.168.0.1 nameserver 192.168.0.2

Currently you are allowed to have 3  directives. List these in order of preference. If queries timeout using the first nameserver, the query is attempted again using the second nameserver, and so on.

The  directive is used to specify a default domain name to append to queries. If DNS fails to lookup a name, the default domain is appended. For example, if a query for testhost fails, the  entry will be appended, in this example resulting in a query for testhost.testdomain.com. The  directive is similar to the   directive. The  directive specifies one default domain, whereas   allows you to specify many. The following is an example of the  directive:

search testdomain1.com search testdomain2.com search testdomain3.com

If a query for testhost.testdomain1.com timed out, a query for testhost.testdomain2.com would be attempted. If this timed out, a query for testhost.testdomain3.com would be attempted.

{| border="1"
 * Administration Guide - TOC || Previous Page - Introduction || Next Page - Installing BIND
 * Administration Guide - TOC || Previous Page - Introduction || Next Page - Installing BIND