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.
![Lab setup for Resolve Device IP Address into Host Name Cisco Router Lab setup for Resolve Device IP Address into Host Name Cisco Router](https://ccnapracticallabs.com/wp-content/uploads/2023/10/1-topology-of-resolving-hostname.jpg)
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.
![ping R2 Lab setup for Resolve Device IP Address into Host Name Cisco Router](https://ccnapracticallabs.com/wp-content/uploads/2023/10/3-ping-each-router-from-R1.jpg)
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.
![Lab setup for Resolve Device IP Address into Host Name Cisco Router Ping R2 hostname](https://ccnapracticallabs.com/wp-content/uploads/2023/10/4-ping-R2-by-its-name-from-R1.jpg)
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.
![show hosts at R1 show hosts at R1](https://ccnapracticallabs.com/wp-content/uploads/2023/10/5-show-hosts-at-R1.jpg)
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.
![configure hostname of R1 at R2 configure hostname of R1 at R2](https://ccnapracticallabs.com/wp-content/uploads/2023/10/6-show-host-and-configure-host-at-R2.jpg)
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 hostname of R1 at R3 configure hostname of R1 at R3](https://ccnapracticallabs.com/wp-content/uploads/2023/10/7-show-host-and-configure-host-at-R3.jpg)
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.
![configure hostname of R2 and R3 at R1 configure hostname of R2 and R3 at R1](https://ccnapracticallabs.com/wp-content/uploads/2023/10/resolving-from-R1.jpg)
Ping R2 and R3 from R1 through its host name.
![Ping R2 hostname Ping R2 hostname](https://ccnapracticallabs.com/wp-content/uploads/2023/10/8-ping-R2-and-R3-from-R1-by-its-name.jpg)
Ping router R1 from Router R3 by its name.
![ping R1 hostname From R3 ping R1 hostname From R3](https://ccnapracticallabs.com/wp-content/uploads/2023/10/9-ping-R1-from-R3-by-its-name.jpg)
Similarly, Ping R1 from R2 through its name.
![ping R1 from R2 ping R1 from R2](https://ccnapracticallabs.com/wp-content/uploads/2023/10/10-ping-R1-from-R3-by-its-name.jpg)