How to Configure Cisco router as DNS Server

How to Configure Cisco router as DNS Server

How to Configure Cisco router as DNS Server



Steps below clarify how to configure your cisco router to work as a dns server.

1-Enable DNS Service on the router

R(config)#ip dns server

2-Enable domain-lookup on the router, to be able to resolve name to ip address by lookup the host table that contains list of  ip address and corresponding names.

R(config)#ip domain-lookup

3-Specify the public name servers. 

When the local client request to solve a name that doesn't exist in the local host table of the router, the router will forward the request to the public dns servers. you can specify more than one name server because if one fails, the ther will take over.

R(config)#ip name-server 8.8.8.8
R(config)#ip name-server 1.1.1.1

4-configure the router with hostname of the local clients and their corresponding ip addresses.

R(config)#ip host john 192.168.1.5
R(config)#ip host john 192.168.1.6

5-Enjoy resolving . 

If you ping Sara, the router will resolve the name Sara to the ip 192.1681.6 and sara pc will reply.

following example will make the things more clear, more deeply and exactly follow this steps one by one.

Configuring a Cisco router as a DNS (Domain Name System) server allows it to perform DNS resolution for the devices on your network. This can be beneficial in small networks or lab environments where you don't have a dedicated DNS server but still want to resolve domain names to IP addresses. To set up your Cisco router as a DNS server, follow these steps:

Step 1: Access Privileged EXEC Mode

First, access the privileged EXEC mode on your Cisco router. You can do this by entering the enable command and providing the router's enable password.


Copy code
Router> enable
Router# configure terminal

Step 2: Configure DNS Zones

Next, you'll create DNS zones on your router. A DNS zone contains information about a specific domain. In this example, we'll configure a DNS zone for the domain "itexamtools.com".





Router(config)# ip dns server
Router(config)# ip domain-lookup
Router(config)# ip domain-name itexamtools.com

Step 3: Map DNS Records

Now, you can map DNS records to IP addresses within the DNS zone you created. For instance, if you want to map the hostname "www" to the IP address "192.168.1.100", use the following command:



Router(config)# ip host www 192.168.1.100

You can add more host records for other devices or services as needed.

Step 4: Optional - Enable Caching

To enable DNS caching on the router (so it can store recently resolved domain names and their corresponding IP addresses for faster future lookups), use the following command:

scss 
Router(config)# ip dns view default
Router(config-dns-view)# caching

Step 5: Save Configuration and Verify

Finally, save the configuration and verify that the DNS settings have been applied correctly:



Router(config-dns-view)# end
Router# write memory
Router# show running-config | include dns

This will show you the DNS-related configuration details. You should see your DNS zones and any host records you created.

That's it! 

Your Cisco router is now configured as a DNS server for the domain "itexamtools.com" and will be able to resolve hostnames to IP addresses for devices on your network. 

Keep in mind that this setup is suitable for small-scale environments, but for larger networks, you may want to consider using dedicated DNS servers for better management and scalability.
--------------------------------------------------------------------------------
Learn more..





Keywords:
how to configure cisco router dhcp
how to configure cisco router dns
how to configure cisco router telnet
how to configure cisco router http
how to configure cisco router ssh

---------------------------------------------------------------------------------------------------------------------------
FutureLearn US





































































































































































































Comments