/etc/resolv.conf. This means that any changes made here manually
are eventually overwritten and lost.
If you have a static IP configuration, you should now list each of your static
IP interfaces as dns-nameservers, dns-search, and dns-domain
entries in /etc/network/interfaces.
You can override the configuration for resolvconf or add entries to it in
the following files in the /etc/resolvconf/resolv.conf.d/
directory:
base—This file is used when no other data can be found.
head—This file is used as the header for resolv.conf, and you can
use it to ensure that a specific DNS server is always the first one on the
list used.
original—This file is a backup copy of your original resolv.conf
file from the time when the resolvconf program was installed.
tail—This file is used as a tail, appended to the end of the auto-
generated resolv.conf file.
The format in these files is the same as the traditional format for
/etc/resolv.conf. Splitting things this way allows for more granular
control while also allowing for DHCP auto-configuration.
Setting DNS Search Order with /etc/host.conf
The /etc/host.conf file lists the order in which your machine searches
for hostname resolution. The following is the default /etc/host.conf
file:
Click here to view code image
order hosts, bind
In this example, the host checks the /etc/hosts file first and then
performs a DNS lookup. A couple more options control how the name service
is used. The only reason to modify this file is if you use NIS for your name
service or you want one of the optional services. The nospoof option can be
a good option for system security. It compares a standard DNS lookup to a
reverse lookup (host-to-IP and then IP-to-host) and fails if the two don’t
match. The drawback is that often when proxy services are used, the lookup
fails, so you should use this with caution.