Friday, September 27, 2013

Cisco IOS DNS Views


DNS views are a fairly recent (12.4ish) addition to IOS to provide the capability for some advanced DNS name server functionality. They allow you to utilize the router as a DNS server and segregate DNS names + forwarding. This comes in handy when you want a split DNS environment - i.e., different name spaces and forwarding for different segments of the network. Obviously, you’re not likely to see the enterprise using the router as a DNS server – but it’s quite effective in the small network builder space (home network for instance).

The starting point in this configuration is creation of the view itself.

ip dns view internal
domain name abcxyz.com
domain name-server 8.8.8.8
domain name-server 8.8.4.4

The command above creates the DNS view named "internal", sets the domain name to "abcxyz.com" and sets up DNS forwarding to a pair of Google's DNS servers.

Now, I can create my own DNS namespace within that view.

ip host view internal server1 192.168.1.111
ip host view internal server2 192.168.1.112
ip host view internal server3 192.168.1.112
ip host view internal server4 192.168.1.114
ip host view internal server5 192.168.1.115

Next step is to assign the view to a ‘view list’. A view list is an ordered list of view where you can put additional restrictions. A view list is also what you assign to a network segment (interface). For this exercise, we’re just adding 1 view to a list named ‘internallist’ (note the highly creative naming conventions I’m using).

ip dns view-list internallist
view internal 1

Now, I assign the view list to a subinterface/VLAN.

interface FastEthernet0/1.1
description data vlan
encapsulation dot1Q 1 native
ip address 192.168.1.1 255.255.255.0
ip dns view-group internallist
ip nat inside

Done. Now, this VLAN has visibility to the “internal” DNS namespace above and utilizes DNS forwarding to Google’s DNS servers.

Copyright ©1993-2024 Joey E Whelan, All rights reserved.