Understanding Linux name resolution
In Chapter 7, Managing Your Ubuntu Server Network, we'll have a discussion on setting up a DNS server for local name resolution for your network. But before we get to that, it's also important to understand how Linux resolves names in the first place. Most of you are probably aware of the concept of a Domain-Name Server (DNS), which matches human-understandable domain names to IP addresses. This makes browsing your network (as well as the Internet) much easier. However, DNS isn't always the first thing that your Linux server will use when resolving names.
For more information on the order in which Ubuntu Server checks resources to resolve names, feel free to take a look at the /etc/nsswitch.conf
file. There's a line in this file that begins with the word hosts
. Here is the output of the relevant line from the file on my server:
hosts: files dns
In this case, the server is configured to first check local files, and then DNS if the request isn't found...