Книга: Linux Network Administrator Guide, Second Edition
Resolver Robustness
Resolver Robustness
When running a LAN inside a larger network, you definitely should use central name servers if they are available. The name servers develop rich caches that speed up repeat queries, since all queries are forwarded to them. However, this scheme has a drawback: when a fire destroyed the backbone cable at Olaf's university, no more work was possible on his department's LAN because the resolver could no longer reach any of the name servers. This situation caused difficulties with most network services, such as X terminal logins and printing.
Although it is not very common for campus backbones to go down in flames, one might want to take precautions against cases like this.
One option is to set up a local name server that resolves hostnames from your local domain and forwards all queries for other hostnames to the main servers. Of course, this is applicable only if you are running your own domain.
Alternatively, you can maintain a backup host table for your domain or LAN in /etc/hosts. This is very simple to do. You simply ensure that the resolver library queries DNS first, and the hosts file next. In an /etc/host.conf file you'd use "order bind,hosts", and in an /etc/nsswitch.conf file you'd use "hosts: dns files", to make the resolver fall back to the hosts file if the central name server is unreachable.