How Computer resolves hostname

Basically there are 2 ways in resolving hostname to IP address:

1. DNS
2. Host file

The easiest way is to register a hostname in a DNS server. All computers in the network point the DNS server setting to this DNS server.

In this case, you only need to modify this information in the DNS server and the information will be updated to all PCs which pointing to it. This information is not replicated to all computers immediately. It take some times – however, if you need to have all computer having the latest update immediately, you may need to reboot your client PC.

The other way is to configure the hostname & IP address information in the local hosts file. The hosts file is a text file used to store information on where to find a node on a computer network.
It contains IP addresses separated by at least once space and then a domain name, with each entry on its own line. This will map hostnames to IP addresses. This file is located in C:\Windows\System32\drivers\etc in Windows environment. It is located in /etc/hosts if it is a Unix system – like Linux. As this is a local hosts file, other computer will not be able to use this information. If your hostname change, you may need to modify the host file in all computers.

The hosts file is under the control of the local computer’s administrator. I always modify information in this file so that I can easily assign hostname to some of the computers which does not have a user friendly name. I will not be able to do this in DNS if I do not have the access right to DNS server.

This entry was posted in Networking and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>