Sunday, 29 July 2012

Example for DNS

CONFIGURATION :
 
 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 rediff.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

Notice that the router uses the DNS server to resolve the name.

After a name is resolved using DNS, use the show hosts command to see that the device cached this information in the host table:

Corp#sh hosts
Default domain is rediff.com
Name/address lookup uses domain service
Name servers are 192.168.0.70
Host Flags Age Type Address(es)
R1 (temp, OK) 0 IP 10.2.2.2
ap (perm, OK) 0 IP 10.1.1.2
Corp#

The entry that was resolved is shown as temp, but the ap device is still perm, meaning thatit’s a static entry. Notice that the hostname is a full domain name. If I hadn’t used the ip domain-name rediff.com command, I would have needed to type in ping r1.rediff.com, which is a pain.

No comments:

Post a Comment