Книга: Fedora™ Unleashed, 2008 edition
The /etc/nsswitch.conf File
The /etc/nsswitch.conf
File
The file /etc/nsswitch.conf
is the system databases and name service switch configuration file. It contains methods for many types of lookups, but here we are concerned with DNS resolution, so the line we are interested in is the hosts
line. This line defines the methods to be used for resolving hostnames and the order in which to apply them. The methods used are the following:
? db
— Local database files (*.db
)
? files
— Use the local file /etc/hosts
? dns
— Use BIND
? nis
— Use Sun's NIS
? nisplus
— Use Sun's NIS+
The default line with Fedora is this:
hosts: files dns
With this default, the same methods and order are specified as in the default /etc/host.conf
. First /etc/hosts
is searched, and then DNS is used.
Another example is as follows:
hosts: files dns nisplus nis
In this example, name searches that fail in /etc/hosts
and with DNS continue to the NIS services (nisplus
and nis
). NIS included with Fedora is the ypserv
daemon.
When you are testing your configuration, you might want to halt name searching at a specific point. You can use the entry [NOTFOUND=return]
. For example, to stop searching after looking in /etc/hosts
, you would use the following line:
hosts: files [NOTFOUND=return] dns nisplus nis
- 4.4.4 The Dispatcher
- About the author
- Chapter 7. The state machine
- Appendix E. Other resources and links
- Example NAT machine in theory
- The final stage of our NAT machine
- Compiling the user-land applications
- The conntrack entries
- Untracked connections and the raw table
- Basics of the iptables command
- Other debugging tools
- Setting up user specified chains in the filter table