I’ll leave the debate to others about running services on routers. As usual ymmv and all that, though besides the obvious objections I think it’s quite cool of my little c877 to proxy DNS and serve what it has locally. Imho, my home DNS config is not heavy enough to warrant rigging up DNS on my Samba server.
My first google tonight led me to an article on the excellent ios hints and tricks site (ioshints.info). Though this is for a full public DNS server it was a little overkill for me, please read this article as well if you do plan to go that route.
My goal was to have my DSL router serve local IP’s for a few public and local domain names. For example this allows me to use sip.djerk.nl as my proxy address in my soft-phone both at home and away.
The following code is what I ended up with.
# These hostnames will be served locally
# As such they overrule their public dns
# clients do need to use this router as a dns server
ip host view VoIP sip.djerk.nl 192.168.100.130
ip host sip.djerk.nl 192.168.100.130
ip host c877 192.168.100.1
description *** VoIP LAN ***
ip dns view-group VoIP
# For my Voice vlan
ip dns view VoIP
domain name djerk.nl
# search list for this view
domain list djerk.nl
domain name-server x.x.x.x
domain name-server y.y.y.y
# Default dns handling
ip dns view default
domain name geurtscass.com
domain list geurtscass.com
ip dns view-list VoIP
view VoIP 1
view default 100
# Enable local dns server (proxy dns if no domains are configured here)
# I do not allow inbound dns requests (intf ACL) so no need to worry about abuse
ip dns server
Most interesting is the usage of views and a view-list. According to CCO the view-list is needed to bind a view to an interface, views can’t be assigned directly. Also noteworthy is that I’ve not found a way to reduce the sip.djerk.nl host mapping to a single line, as adding the default view to the VoIP view-list was not enough. Maybe I should add the VoIP view to the default view-list.
Well just tried that and it didn’t work either. Anyone out there who knows how to do the same in IOS but with less lines?