How to configure DNS on Cisco router in packet tracer

There are a couple of ways in which we can configure DNS in packet tracer. We will configure DNS on the Cisco router and endpoint server.

DNS means domain name server, DNS contains a database of domain names and IP mapping. DNS servers are very helpful as we don’t have to remember the IP address and we can use the domain name instead. Names are much easier to type and learn so DNS plays an important role in every network.

When we enter google.com in the web browser the DNS server finds out the mapped IP with that domain and the HTTP request is forwarded to that IP address.

Configure DNS on the Cisco router

To configure the Cisco router as DNS, we have to enable the DNS service on the router using the following command.
Router(config)#ip dns server

Now, we have to map the names with the IP address using the following command.

Router(config)#ip host PC1 192.168.1.5
Router(config)#ip host PC2 192.168.1.6

Finally, we need to configure the DNS server IP to the router’s IP in the PC setting.

Now, we can ping one PC from another PC with their names.

Please note that Configuring the Cisco router as a DNS server is not possible in packet tracer as it does not provides this functionality however If you want to try this lab then you can use GNS3 as it has all the commands.

Configuring DNS in Cisco packet tracer with the available server endpoint

To configure the DNS server, we have to enable the DNS service in the server which is disabled by default.

 

Now, we have to add an A record or create a name to IP mapping in the server.

Finally, PCs should be configured with the IP address of the server in the DNS settings.

That is all required to successfully enable the DNS server in packet tracer.

Now, we should be able to ping the PCs with the names.

C:\>ping PC2

Pinging 192.168.1.6 with 32 bytes of data:

Reply from 192.168.1.6: bytes=32 time=35ms TTL=128
Reply from 192.168.1.6: bytes=32 time<1ms TTL=128
Reply from 192.168.1.6: bytes=32 time<1ms TTL=128
Reply from 192.168.1.6: bytes=32 time<1ms TTL=128

As expected, we can ping one PC from another with the names.

Download

Download this lab and ping the PC with names, you will see the successful ping replies.

Activity for you

Create a mapping for the switch in the server so that PC can ping the switch with the name ‘switch’

Leave a Reply