When we browse any website we use the hostname or domain name to access that website. Have you ever wonder how that hostname is getting mapped in the server and point to right application server to deliver the content to your browser? In this article we will study and understand how the hostname getting resolved on the server.
An application that is installed in our server can be accessed via browser, using IP address and port number or hostname. When you installed at that there is no hostname, you have only IP address to access, just for example in our local machine we use 127.0.0.0
Resolving Hostname
If we want to use a hostname instead of an IP address to connect to a remote device, the device that we are using to make the connection should be able to translate the hostname to an IP address. There are two ways to resolving a hostname to IP address. The first is creating host table on each router, and second is to build a Domain Name System(DNS) server.
1. Using Host Table
A host table provides name resolution, it does that only on the specific router that it was built upon. We use below command to build a host table on a router.
ip host <host_name> <port_number> <ip_address>
Note: default port number is 23.
2. Using Domain Name System(DNS)
If we are working with multiple devices, then we need not to create host table in each devices, instead of that we use DNS server to resolve the hostname.
Hence, DNS server makes the things easy and easy to maintain the entries in compare to host table.
No comments:
Post a Comment