DNS Redirection

From Baranoski.ca
Revision as of 14:48, 20 June 2013 by Casey (talk | contribs) (Created page with "Suppose you are using your Cisco router as a DNS server, and you would like to have certain domains redirected to specific servers for their lookups. This would be useful for...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Suppose you are using your Cisco router as a DNS server, and you would like to have certain domains redirected to specific servers for their lookups. This would be useful for a remote VPN site that needs to look up internal hostnames from other sites, but doesn't want to use the other site's DNS server for internet lookups.

This example works for any hosts in the ".local" domain (ie: myhost.local) and any PTR lookups for 192.168.x.x IPs. Note with this setup, you do not use the ip name-server x.x.x.x global command.

ip dns name-list 100 permit .*.local
ip dns name-list 100 permit .*.168.192.IN-ADDR.ARPA

ip dns view INTERNET
 domain name-server  8.8.8.8
 domain name-server  8.8.8.4

ip dns view INTERNAL
 domain name-server  10.10.10.5

ip dns view-list DNS-SERVERS
 view INTERNAL 10
  restrict name-group 100
 view INTERNET 100

When a host queries the DNS server, it checks to see if the query matches name-list 100. If it matches, it queries the INTERNAL group of servers. Otherwise, it queries the INTERNET group.