|
Resolving Hostnames
To use a hostname rather than an IP address to connect to a remote device, the device that you
are using to make the connection must be able to translate the hostname to an IP address.
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 similar to a dynamic host table.
Building a Host Table
A host table provides name resolution only on the router that it was built upon. The command
to build a host table on a router is as follows:
ip host host_name tcp_port_number ip_address
The default is TCP port number 23, but you can create a session using Telnet with a different
TCP port number if you want. You can also assign up to eight IP addresses to a hostname.
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.
Any time a Cisco device receives a command it doesn’t understand, it will try to resolve it
through DNS by default.
If you have a DNS server on your network, you need to add a few commands to make DNS
name resolution work:
- The first command is ip domain-lookup, which is turned on by default. It needs to be
entered only if you previously turned it off (with the no ip domain-lookup command).
The command can be used without the hyphen as well (ip domain lookup).
- The second command is ip name-server. This sets the IP address of the DNS server. You
can enter the IP addresses of up to six servers.
- The last command is ip domain-name. Although this command is optional, it really
should be set. It appends the domain name to the hostname you type in. Since DNS uses
a fully qualified domain name (FQDN) system, you must have a full DNS name, in the
form domain.com.
|