background image
Resolving Hostnames
381
There are two ways to resolve hostnames to IP addresses: building a host
table on each router or building a Domain Name System (DNS) server,
which is like a dynamic host table.
Building a Host Table
A host table provides name resolution only on the router on which it was
built. The command to build a host table on a router is
ip host name tcp_port_number ip_address
The default is TCP port number 23. You can create a session using Telnet
with a different TCP port number, if needed, and you can assign up to eight
IP addresses to a hostname.
Here is an example of configuring a host table with two entries to resolve
the names for the 2501B router and the switch:
Todd2509#config t
Enter configuration commands, one per line. End with
CNTL/Z.
Todd2509(config)#ip host ?
WORD Name of host
Todd2509(config)#ip host 2501B ?
<0-65535> Default telnet port number
A.B.C.D Host IP address (maximum of 8)
Todd2509(config)#ip host 2501B 172.16.10.2 ?
A.B.C.D Host IP address (maximum of 8)
<cr>
Todd2509(config)#ip host 2501B 172.16.10.2
Todd2509(config)#ip host 1900Switch 192.168.0.148
Todd2509(config)#^Z
To see the host table, use the show hosts command.
Todd2509#sh hosts
Default domain is not set
Name/address lookup uses domain service
Name servers are 255.255.255.255
Copyright ©2002 SYBEX, Inc., Alameda, CA
www.sybex.com