Live in a world of your own, but always welcome visitors.

View on GitHub
28 December 2015

Config example of a Cisco router as a DNS server/forwarder.

by deaves

For a quick and dirty DNS server you can configure a Cisco router. In the following config snippet I have configured a router as a DNS forwarder. Any ip host statements entered in the router will be resolvable by the clients.

!!! Host statements will be resolvable by clients !!!
ip host rtr.SITE.LAN
ip host gi0-0-0.SITE.WAN
ip host gi0-0-1.SITE.LAN
ip host servera.SITE.LAN
ip host serverb.SITE.LAN
ip host serverc.SITE.LAN
ip host serverd.SITE.LAN
ip host servere.SITE.LAN

!!! ACL to limit who can query the DNS server service !!!
ip access-list standard RFC1918-dns

!!! DNS name-list is used to control what zones/hosts can be queried !!!
ip dns name-list 1 permit .*

!!! Create a DNS view !!!
ip dns view default
 domain name-server
 domain name-server
 domain name SITE.LAN
 dns forwarding source-interface GigabitEthernet0/0/0

!!! Create a DNS view-list !!!
ip dns view-list LAN
 view default 1
  restrict source access-group RFC1918-dns
  restrict name-group 1

!!! Enable DNS server service and use the view-group !!!
ip dns server view-group LAN
ip dns server

If running an ISR g3 I recommend upgrading to at least 15.5(3)S1a.

tags: cisco - config example - dns server - ip dns server