background image
Resolving Hostnames
385
Success rate is 100 percent (5/5), round-trip min/avg/max
= 28/31/32 ms
Notice that the DNS server is used by the router 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, as shown
below.
Todd2509#sh hosts
Default domain is lammle.com
Name/address lookup uses domain service
Name servers are 192.168.0.70
Host Flags Age Type Address(es)
2501b.lammle.com (temp, OK) 0 IP 172.16.10.2
1900switch (perm, OK) 0 IP 192.168.0.148
Todd2509#
The entry that was resolved is shown as temp, but the 1900 switch device
is still perm, which means that it is a static entry. Notice that the hostname is
a full domain name. If I hadn't used the ip domain-name lammle.com
command, I would have needed to type in ping 2501b.lammle.com, which
is a pain.
Should you use a host table or DNS server?
Depends. How many routers do you have? If you have dozens of routers,
then you don't want to build a static host table on each router. You can build
one table on a DNS server.
Most networks should have a DNS server now, so adding a dozen or so
hostnames into a DNS server would be pretty easy. Just add the three com-
mands on your router and your resolving names.
Using a DNS sever makes it easy to update one entry as well. If you have
static host tables, then you must go to each router to update the entry if
anything changed.
Copyright ©2002 SYBEX, Inc., Alameda, CA
www.sybex.com