IP Naming Commands

When using the IOS CLI, you will want to refer to names instead of IP addresses. Particularly for the trace, ping, and telnet commands, the IP address or host name must be supplied. This section describes the use of host names on an IOS-based device. Along the way, some nuances of the use of Telnet are covered.

IOS can use statically configured names as well as refer to one or more DNSs. Example 13-9 shows some names statically configured, with configuration pointing to two different DNSs.

Example 13-9 IP Naming Configuration and show host Command

hostname Cooperstown !

ip

host Mays 10.1.1.1

ip

host Aaron 10.2.2.2

ip !

host Mantle 10.3.3.3

ip

domain-name gileadfoundation.

■ org

ip

name - server 10.1.1.200 10.2.

.2.200

ip

domain-lookup

Example 13-9 IP Naming Configuration and show host Command (Continued)

Cooperstown#show hosts

Default domain is gileadoundation.org

Name/address lookup uses static mappings

Example 13-9 IP Naming Configuration and show host Command (Continued)

Cooperstown#show hosts

Default domain is gileadoundation.org

Name/address lookup uses static mappings

Host

Flags

Age Type

Address(es

Mays

(perm,

OK)

0 IP

10.1.1.1

Aaron

(perm,

OK)

0 IP

10.2.2.2

Mantle

(perm,

OK)

0 IP

Cooperstown

Router Cooperstown will use any of the three statically configured host name-to-IP address mappings. Three names are configured statically in this case—Mays, Aaron, and Mantle. Any command referring to Mays, Aaron, or Mantle will resolve into the IP addresses shown in the ip host command.

Router Cooperstown also will ask a DNS for name resolution if it does not know the name and IP address already. The DNS configuration is shown toward the end of the configuration. The IP addresses of the name servers are shown in the ip name-server command. Up to six DNSs can be listed; they are searched for each request sequentially, based on the order in the command. Finally, the ip domain-lookup command enables IOS to ask a name server. IP domain lookup is the default; no ip domain-lookup disables the DNS client function. For names that do not include the full domain name, the ip domain-name command defines the domain name that should be assumed by the router.

The show ip host command lists the static entries, in addition to any entries learned from a DNS request. Only the three static entries were in the table, in this case. The term perm in the output implies that the entry is static. Also note that when short names are used—in other words, the name does not include the DNS domain name—the router adds the domain name of gileadfoundation.org, as configured in the ip domain-name gileadfoundation.org command.

Table 13-7 summarizes the key naming commands in IOS. Table 13-7 IP Naming Commands

Function

Command Options

Tell IOS to use a DNS

Configure the ip domain-lookup global configuration command.

Configure IP addresses of name servers

Configure the ip name-server svr1 svr2... global configuration command.

Configure static host names

Use the ip host name address command.

List current host name information

Use the show hosts exec command.

0 0

Post a comment