- Table of Contents
- Copyright
- About the Lead Authors
- About the Contributing Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- I. Red Hat Linux Installation and User Services
- Chapter 1. Introduction to Red Hat Linux
- Chapter 2. Installation of Your Red Hat System
- Chapter 3. LILO and Other Boot Managers
- Chapter 4. Configuring the X Window System, Version 11
- Chapter 5. Window Managers
- Chapter 6. Connecting to the Internet
- Chapter 7. IRC, ICQ, and Chat Clients
- Chapter 8. Using Multimedia and Graphics Clients
- II. Configuring Services
- Chapter 9. System Startup and Shutdown
- Chapter 10. SMTP and Protocols
- Chapter 11. FTP
- Chapter 12. Apache Server
- Chapter 13. Internet News
- Chapter 14. Domain Name Service and Dynamic Host Configuration Protocol
- A Brief History of the Internet
- A Word About This Chapter's Examples
- Important DNS Facts and Concepts
- DNS Server Configuration Files
- Configuring resolv.conf with linuxconf
- A Trivial Caching DNS
- Configuring DNS Server Master Zones
- Delegating Authority
- Adding a Slave DNS Server
- Troubleshooting DNS
- DNS Resources
- Automatically Configuring Clients with DHCP
- Summary
- Chapter 15. NIS: Network Information Service
- Chapter 16. NFS: Network Filesystem
- Chapter 17. Samba
- III. System Administration and Management
- Chapter 18. Linux Filesystems, Disks, and Other Devices
- Chapter 19. Printing with Linux
- Chapter 20. TCP/IP Network Management
- Chapter 21. Linux System Administration
- Chapter 22. Backup and Restore
- Chapter 23. System Security
- IV. Red Hat Development and Productivity
- Chapter 24. Linux C/C++ Programming Tools
- Chapter 25. Shell Scripting
- Chapter 26. Automating Tasks
- Chapter 27. Configuring and Building Kernels
- Chapter 28. Emulators, Tools, and Window Clients
- V. Appendixes
- A. The Linux Documentation Project
- B. Top Linux Commands and Utilities
- C. The GNU General Public License
- D. Red Hat Linux RPM Package Listings
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. In linuxconf, 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.
Figure 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.
A Trivial Caching DNS | Next Section

Account Sign In
View your cart