Resolve Device IP into Hostname in a Cisco Router
Memorizing the IP address of a few devices is easy, but it is very hard to remember every device’s IP address on the computer network. Sometimes, we forget the IP address of the device and then check the routing table or any other table on the computer. As we can’t remember every website IP address on the internet, So DNS works for us. We simply put its name in Google, and then Google’s DNS searches it for us. So it will be helpful for us if we memorize the device name, which we will Ping it through its name instead of the IP address. In this lab, we will perform “how to resolve device IP into hostname. So we will Ping by its name instead of the IP address.
Lab Topology
Configure the IP address on each router R1, R2, and R3 as shown in the below Lab.
Configuring IP and Ping routers.
Complete an IP configuration on all routers R1, R2, and R3 as shown below Lab, and then ping each router as shown below.
Ping R2 and R3 from R1.
What will happen if we Ping R2 through its name “R2”, then the router will try to resolve its host name into an IP address if we configure it.
As a router didn’t resolve its host name into the IP address. So, we are going to check the router hostname through the show hosts command.
Configuring IP host R1 at R2 and R3
We didn’t set the hostname on R1. We will resolve the hostname of R1 by host R2. So, set the hostname of R1 on R2. IP host command, followed by the router name and its IP address is used for it.
Similarly, configure the hostname of R1 at R3. So R3 will ping R1 through its name R1 instead of its IP address. In this way, it will resolve the device IP into the hostname.
Configure Host name of R2 and R3 at R1
We configured the hostname of R1 at R2 and R3. Similarly, configure the hostname of R2 and R3 at R1.
Ping R2 and R3 from R1 through its host name.
Ping router R1 from Router R3 by its name.
Similarly, Ping R1 from R2 through its name.