XpressLearn Home

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Create an IOS based DNS server

The Cisco router can provide many services other than what is considered traditional for this type of device. This article will focus on the (limited featured) dns server implementation in the Cisco IOS. In this example, we will configure a router on the network as the primary dns server for the expresslearn.com domain. We will then configure the other routers in the network to use this primary dns server for name resolution. This will allow all the network devices to know each other by name - without having to involve those server admins!

<!–adsense#inlinepostad–>

There are three routers in the network, with one being the primary dns server. The other two routers are configured to use the primary for name resolution:

hostname LanRouter
!
ip host lanrouter.expresslearn.com 10.0.1.1
ip host wanrouter.expresslearn.com 10.0.1.2
ip host branchrouter.expresslearn.com 10.0.2.1
!
ip dns server
ip dns primary expresslearn.com soa lanrouter.expresslearn.com (continued...)
admin@expresslearn.com 21600 900 7776000 86400


hostname WanRouter
!
ip domain name expresslearn.com
ip name-server 10.0.1.1


hostname BranchRouter
!
ip domain name expresslearn.com
ip name-server 10.0.1.1


BranchRouter#ping lanrouter.expresslearn.com
Translating "lanrouter.expresslearn.com"...domain server (10.0.1.1) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 144/144/148 ms

BranchRouter#ping wanrouter
Translating "wanrouter"...domain server (10.0.1.1) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/76/120 ms
BranchRouter#

As you can see, the BranchRouter can now refer to the other two routers by name. You may have noticed the omission of the domain name when pinging the wanrouter. This works because the BranchRouter automatically appended it’s configured domain name to the supplied hostname.

If you would like the IOS DNS server to forward resolution requests containing other domain names, add the additional configuration statement on the router configured as the dns server.

LanRouter(config)#ip name-server <valid dns server ip address>

Without the above statement, resolution requests for other domains will be dropped on the server and the query will timeout on the client:

BranchRouter#ping www.google.com
Translating "www.google.com"...domain server (10.0.1.1)
% Unrecognized host or address, or protocol not running.

Author Info:

 
Scott is the Founder, Administrator, Architect, Chief Editor and Shameless Hack who wrote and runs Xpresslearn.
 

Scott has been working in the networking field for 13 years and has experience in all the areas: Lan, Wan, Security, Optimization, High Availability, Wireless, and others.

When he is not working on further development of Xpresslearn, Scott loves spending time with his family and has such hobbies as Camping, Fishing, Cars, and Woodworking.

Related Posts:


One Response to “Create an IOS based DNS server”

  1. Aaron Conaway Says:

    This is pretty cool. I would have never thought to use a router as a DNS server.

    I’ve seen IT shops that don’t put the IPs of their network gear in DNS to hide it from the world, but using a router as a DNS server on network-only management servers (and other network gear) might be a valid solution.

Leave a Reply