Книга: Fedora™ Unleashed, 2008 edition
Resolver Configuration
Resolver Configuration
The last step before running BIND is to set up the local resolver software. This involves configuring the /etc/hosts
, /etc/resolv.conf
, and /etc/nsswitch.conf
files.
To avoid gratuitous network traffic, most UNIX resolvers still use a hosts
-like text file named /etc/hosts
to store the names and addresses of commonly used hosts. Each line in this file contains an IP address and a list of names for the host. Add entries to this file for any hosts you want to be able to resolve independently from DNS. If the entry is found in /etc/hosts
, the resolver does not have to contact a DNS server to resolve the name, which reduces network traffic.
/etc/resolv.conf
specifies the addresses of preferred nameservers and a list of domains relative to which unqualified names are resolved. You specify a nameserver with a line of the form nameserver 1.2.3.4
(where 1.2.3.4
is the address of the nameserver). You can use multiple nameserver
lines (usually up to three). You can use a search line to specify a list of domains to search for unqualified names.
A search line such as search example.com example.net
causes the resolver to attempt to resolve the unqualified name xyz
, first as xyz.example.com
, and then, if that fails, as xyz.example.net
. Do not use too many domains in the search list because it slows down resolution.
A hosts: files dns
line in /etc/nsswitch.conf
causes the resolver to consult /etc/hosts
before using the DNS during the course of a name lookup. This allows you to override the DNS by making temporary changes to /etc/hosts
, which is especially useful during network testing. (Older resolvers might require an order hosts, bind
line in the /etc/host.conf
file instead.)
- Using Network Configuration Tools
- Chapter 6. Name Service and Resolver Configuration
- The Resolver Library
- Resolver Robustness
- Configuration options
- Network Configuration
- Firstboot Configuration
- GUI-Based Printer Configuration Quick Start
- Using Graphical Configuration Tools
- Command-Line Network Interface Configuration
- Network Configuration Files
- Dynamic Host Configuration Protocol