Using DNS to Resolve Names
If you have a lot of devices and don’t want to create a host table in each device, you can use
a DNS server to resolve hostnames.
Anytime a Cisco device receives a command it doesn’t understand, it will try to resolve it
through DNS by default. Watch what happens when I type the special command todd at a
Cisco router prompt:
Corp#todd
Translating "todd"...domain server (255.255.255.255)
Translating "todd"...domain server (255.255.255.255)
Translating "todd"...domain server (255.255.255.255)
% Unknown command or computer name, or unable to find
computer address
Corp#
You can get around this and prevent a time-consuming DNS lookup by using the no ip
domain-lookup command on your router from global configuration mode.
If you have a DNS server on your network, you need to add a few commands to make DNS
name resolution work:
Corp#config t
Corp(config)#ip domain-lookup
Corp(config)#ip name-server ?
A.B.C.D Domain server IP address (maximum of 6)
Corp(config)#ip name-server 192.168.0.70
Corp(config)#ip domain-name lammle.com
Corp(config)#^Z
Corp#
After the DNS configurations are set, you can test the DNS server by using a hostname to
ping or telnet a device like this:
Corp#ping R1
Translating "R1"...domain server (192.168.0.70) [OK]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is
2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max
= 28/31/32 ms