Thursday, January 24, 2008

Setup DNS server in your lab

 

If you do a lot of telnetting in your lab, you could set up an internal DNS server to be able to use router names instead of IP addresses.

Select a router that will act as the DNS server and configure it on all other routers in your lab. For example, if your DNS server has IP address 10.0.0.1, use the following configuration commands:

ip domain-lookup
ip name-server
10.0.0.1

On the DNS server, disable DNS lookup and DNS forwarding (it has nowhere else to go) and define all the routers as IP host names:

no ip domain lookup
!
ip dns view
default
no dns forwarding
!
ip dns server
!
ip host Core-1
10.0.0.1
ip host Core-2 10.0.0.2
ip host POP 192.168.2.1
ip host
Ext 192.168.1.5
ip name-server 10.0.0.1

If you also define IP addresses for the WAN links, for example:

ip host 
serial-1-0.X1 10.0.1.6
ip host serial-1-0.Core-1 10.0.1.1
… you'll get correct hop-by-hop information from the traceroute command:
POP#trace Ext
Translating
"Ext"...domain server (10.0.0.1) [OK]
Type escape sequence to
abort.
Tracing the route to Ext (192.168.1.5)
1 serial-1-0.Core-1
(10.0.1.1) 36 msec 24 msec 16 msec
2 serial-1-0.X1 (10.0.1.6) 24 msec
28 msec 4 msec
3 Ext (192.168.1.5) 20 msec * 24 msec

Posted to Cisco IOS Hints and Tricks by IvanPepelnjak
©Copyright Ivan Pepelnjak