Configuring a Cisco IOS Router to act as a DNS Server

Have you ever had the need to have a quick DNS server at hand? – This is very useful when configuring UCCX 9.x and above in a lab environment with no DNS Server.

At this point I’m not really sure if this DNS configuration will support more advanced configurations, like SRV records or anything of that nature, but I guess is a good start to begin testing it and see if there is more to it.

This post is an excerpt from a Cisco Document that can be found Here

Configuring the Router as a DNS Server

Perform this task to configure the router as a DNS server.

A Cisco IOS router can provide service to DNS clients, acting as both a caching name server and as an authoritative name server for its own local host table.

When configured as a caching name server, the router relays DNS requests to other name servers that resolve network names into network addresses. The caching name server caches information learned from other name servers so that it can answer requests quickly, without having to query other servers for each transaction.

When configured as an authoritative name server for its own local host table, the router listens on port 53 for DNS queries and then answers DNS queries using the permanent and cached entries in its own host table.

An authoritative name server usually issues zone transfers or responds to zone transfer requests from other authoritative name servers for the same zone. However, the Cisco IOS DNS server does not perform zone transfers.

When it receives a DNS query, an authoritative name server handles the query as follows:

– If the query is for a domain name that is not under its zone of authority, the authoritative name server determines whether to forward the query to specific back-end name servers based on whether IP DNS-based hostname-to-address translation has been enabled via the ip domain lookup command.

– If the query is for a domain name that is under its zone of authority and for which it has configuration information, the authoritative name server answers the query using the permanent and cached entries in its own host table.

– If the query is for a domain name that is under its zone of authority but for which it does not have any configuration information, the authoritative name server does not forward the query elsewhere for a response; instead the authoritative name server simply replies that no such information exists.

Summary Steps

enable
configure terminal
ip dns server
ip name-server server-address1 [server-address2… server-address6]
ip dns server queue limit {forwarder queue-size-limit | director queue-size-limit}
ip host [vrf vrf-name] [view view-name] hostname {address1 [address2 … address8] | additional address9 [address10 … address]}
ip dns primary domain-name soa primary-server-name mailbox-name [refresh-interval [retry-interval [expire-ttl [minimum-ttl]]]]
ip host domain-name ns server-name

Mapping Hostnames to IP Addresses Example

The following example configures the hostname-to-address mapping process. IP DNS-based translation is specified, the addresses of the name servers are specified, and the default domain name is given.

! IP DNS-based hostname-to-address translation is enabled
ip domain lookup
! Specifies hosts 192.168.1.111 and 192.168.1.2 as name servers
ip name-server 192.168.1.111 192.168.1.2
! Defines cisco.com as the default domain name the router uses to complete
! Set the name for unqualified hostnames
ip domain name cisco.com

Last Words

To continue the testing and playing, make sure you take a look at the Document in Cisco’s Website

About the Author:

Andres Sarmiento, CCIE # 53520 (Collaboration)
With more than 13 years of experience, Andres is specialized in the Unified Communications and Collaboration technologies. Consulted for several companies in South Florida, also Financial Institutions on behalf of Cisco Systems. Andres has been involved in high-profile implementations including Cisco technologies; such as Data Center, UC & Collaboration, Contact Center Express, Routing & Switching, Security and Hosted IPT Service provider infrastructures.

You can follow Andres using Twitter, LinkedIn or Facebook

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top