Domain name resolution
From from the resolv.conf(5) man page:
- "The resolver is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). The resolver configuration file contains information that is read by the resolver routines the first time they are invoked by a process. The file is designed to be human readable and contains a list of keywords with values that provide various types of resolver information.
- "On a normally configured system this file should not be necessary. The only name server to be queried will be on the local machine; the domain name is determined from the host name and the domain search path is constructed from the domain name."
Preserve DNS settings
Dhcpcd, NetworkManager, and various other processes can overwrite Template:Filename. This is usually desirable behavior, but sometimes DNS settings need to be set manually (e.g. when using a static IP). There are several ways to accomplish this. If you are using NetworkManager, see this thread on how to prevent it from overriding your Template:Filename.
Modify the dhcpcd Config
Alternatively, you can create a file called Template:Filename containing your DNS servers. Dhcpcd will prepend this file to the beginning of Template:Filename. An example Template:Filename for someone using OpenDNS would be:
# OpenDNS servers nameserver 126.96.36.199 nameserver 188.8.131.52
If you are not pleased with the OpenDNS servers you might try Google's nameservers as an alternative.
# google nameservers nameserver 184.108.40.206 nameserver 220.127.116.11
Another way to protect your Template:Filename from being modified by anything is setting the write-protection attribute:
chattr +i /etc/resolv.conf
Use timeout option to reduce hostname lookup time
If you are confronted with a very long hostname lookup (may it be in pacman or while browsing) it often helps to define a small timeout after which an alternative nameserver is used. To do so create a file called Template:Filename and add the following line:
Then restart your network daemon and see if it works better.