What is Domain Name Resolution?

Most of the time, if you surf on the internet, people connect to websites by connecting to a domain name. In the internet applications, it does not communicate using domain names, but rather IP addresses. With this, a domain name will have to be converted to an IP address first. This is where the domain name resolution enters — the way hostnames are assigned to their IP address. But let’s get into details, shall we?

Domain Name Resolution: How does it really work?

In the general sense, addresses have streets and cities, right? Well, in the world of the internet, we have them as both numbers and symbols. There are two kinds of addresses: IPv4 and IPv6. As an internet user, we don’t have to remember the IPs of every website, we just have to know the domain name. The process of the domain name resolutions starts when the user types the name of the website. From here, the browser will need to get the IP and send the queries to the name servers. This kind of process involves domain name resolvers.

The root server is the first thing that your browser will get from the process. Then it will get the TLD (top-level domain). Those servers with TLD of the website will refer your queries to the next step in searching authoritative servers who have the complete IP. This is what resolves the domain name.

Default Order of the Domain Name Resolution

The process as to how the operating system resolves domain name is actually based on its configuration. For most of the operating systems, the default order of the domain name resolution is as follows:

  1. Hosts File – You can use this file to convert domain names to IP addresses. Hosts file’s entries override any mappings which DNS server resolves..
  2. Domain Name System – It is used for converting domain names to their corresponding IP addresses. The operating system will be connecting the DNS server which is configured on your computer. Then it will have that server return to you the IP address for the domain name you queries it with.
  3. NetBIOS – For Windows machines, this will only be used to map the names to IP addresses if ever all the previous methods failed. It will attempt to map the NetBIOS name you are trying to connect to with an IP address.

Though this particular order can possibly be changed depending on your operating system. Read further below as we tackle these methods for both Windows and Unix/Linux operating systems below.

Domain Name Resolution on Windows

For Windows, the mentioned method above is the order for the domain name resolution. However, it can be altered through some registry keys. These keys are as follows:

  • DnsPriority – corresponds to using the Domain Name System
  • LocalPriority – refers to your computer’s local name
  • HostsPriority – HOSTS file
  • NetbtPriority – using NetBIOS name mapping

Depending on values, you assign priority to these keys, between -32768 and 32767. Remember that assigning a lower number to the entry means higher priority for that particular resolution provider.

Domain Name Resolution on Unix/Linux

The same as Windows, Unix and Linux actually have a similar default domain name resolution. First, the OS will check if its /etc/hosts file and if it does not find an entry for the queried domain, it will then query its configured DNS servers.

You can change the order in which server resolves domain names by editing the file /etc/host.conf. It determines the order with which the OS uses in resolving domain names. In it, the line concerned is the order hosts, bind.

It basically tells OS to first check the HOSTS file. You may also change the order which the OS uses by changing the order line. For instance, if you want it queried DNS first and have the HOSTS file second, then change the line as order bind, hosts.

You may change the values after the order as hosts, bind, or nis. THE NIS stands for the Network Information Service.

See also: Linux vs Windows: Which Web Server?

Final Thoughts

It is best to not remember the same resolution order for every operating system. This is due to it not having a fixed order as it is possible to change. You must remember this especially when you try to debug problems when resolving domain names.

That’s it! Do you find this article helpful? Please do share this with your friends.

You might also be interested:

Comments

comments

Michael McCardel: