Useful Articles


How to configure Router as DNS Server

How to Configure Router as DNS Server

Domain Name System (DNS) is used to resolve website names (or host-names) example into IP addresses This article guides you how to configure a Router as DNS server.

Importance and requirement of DNS

Let's discuss a network issue to understand the importance of DNS. 

You are a Network Engineer in an organization and a customer reports an issue about dis-connectivity to a destination server. To begin troubleshooting, you would ask the customer some initial information helpful to resolve the issue. For example, Source Subnet/IP from which the customer is experiencing the issue. Destination IP of the server which is unreachable.

You would definitely need important info i.e. destination server IP of the server for which issue is reported otherwise you cannot troubleshoot the issue.

Same is the case while you browse a website on the internet.

Each website/server/URL hosted on the internet has a public IP and it is your destination IP which you want to reach.

While you browse a website/mail server on the internet, you don't generally put an IP address in the URL. You only write the URL name for example "". This is because you don't generally remember the IP address for this URL or website.

There are millions of similar URLs/organizations on the internet and you cannot remember IP addresses of all.

DNS is a service that acts as a go-between/middleman that helps to resolve the Hostnames to IP addresses.

In this article we will understand how to configure a Cisco router as a DNS server for lab simulations.

Steps to configure a Cisco Router as a DNS server. 

Using below topology we'll try to simulate the DNS working mechanism.

The aim is to resolve the domain name "" to IP

To have a thorough understanding of DNS, kindly read the article "How DNS Works?"

How to configure a router as DNS Server
  1. User PC  pings "" from user PC. The user PC doesn't have a DNS record entry in its local cache.
  2. User PC generates a "DNS Query" message for Hostname to IP resolution to the DNS server and the DNS server ( responds with the Response Message.
  3.  DNS server sends a "DNS Response" message with IP address details of the domain requested.

Configuration for DNS server (

DNS-Server(config)#ip dns server
DNS-Server(config)#ip host
DNS-Server(config)#ip name-server

Configuration for Router R2.
R2(config)#ip name-server
Now when you ping from the User PC.

Translating ""...domain server ( [OK]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 156/196/236 ms

DNS Query Message:

Configure a Router as DNS Server, DNS Query

DNS Response Message:

Configure a Router as DNS Server, DNS Response


For Further Reading