Configuring resolv.conf with linuxconf

The /etc/resolv.conf file contains the configuration for the DNS client (resolver). It typically looks something like this:

search domain.cxm
nameserver 192.168.211.34
nameserver 192.168.100.1

In the preceding /etc/resolv.conf, typically the first nameserver address is that of the ISP’s DNS server, while the second is that of your local LAN. Sometimes they’re reversed, or sometimes only the local LAN number is used (in which case all DNS resolution is through either the local DNS or local caching DNS). The search line is important in that it’s what enables lookup of a hostname without fully qualifying the domain. For instance, execute the following command:

   $ nslookup mydesk
Server:  mainserv.domain.cxm
Address:  192.168.100.1

Name:    mydesk.domain.cxm
Address:  192.168.100.2

$

You can experiment by commenting out the search line in /etc/resolv.conf, after which the exact same command fails:

   $ nslookup mydesk
Server:  mainserv.domain.cxm
Address:  192.168.100.1

***mainserv.domain.cxm can't find mydesk: No response from server
$

Even after commenting out the search line, you can still look up the fully qualified domain name (FQDN), as shown by the following command:

   $ nslookup mydesk.domain.cxm
Server:  mainserv.domain.cxm
Address:  192.168.100.1

Name:    mydesk.domain.cxm
Address:  192.168.100.2

$

Many administrators prefer to directly edit /etc/resolv.conf. However, the linuxconf utility provides a convenient edit method. Inlinuxconf, choose Networking, Name Server Specification (DNS) to access the Resolver configuration screen. Be sure to check the DNS Is Required for Normal Operation check box. Place your list of DNS servers, in the order you want them tried, in the text boxes titled IP of Name Server 1 through IP of Name Server 3. Note that the second and third name servers are optional.

The Resolver configuration screen, accessible from Linuxconf, is shown in Figure 14.1.

Note that this figure is for the sylvia computer rather than mainserv, revealing the fact that both are set up the same way. Both are resolved from 192.168.100.1 (mainserv) and search domain domain.cxm. The Search Domain 1 through Search Domain 4 fields are optional, and if you enter info in them, they are written to /etc/resolv.conf as search lines. As previously discussed, search lines enable searching by a hostname without a domain name. Multiple search lines are sometimes handy to search for a host in multiple domains. For instance, if domain.cxm has a subdomain called subdomain.domain.cxm, and if hostnames are unique on both, it might be handy to include both in search lines. However, if there’s a chance that the same hostname exists on both domains, it’s better to have only one search line.

14fig01.jpgFigure 14.1 The Resolver configuration screen.

The one other field on this form is the Default Domain field. If entered, it specifies a string to append to all hostnames. As such it’s very similar to the search lines. Note that the default domain can be defined outside /etc/resolv.conf. For instance, if a fully qualified domain name is given as an argument to the hostname command, everything to the right of the first dot is considered the default domain. It can also be defined in the .rhosts file. In practice on Red Hat machines, the default domain is rendered unnecessary by using a search line instead.

source: http://www.informit.com/library/content.aspx?b=red_hat_linux7&seqNum=127