Tuesday, September 21, 2010

Mapping Hostnames to IP Addresses

 IP Host Tables

The ip host command builds and maintains the router's host table. This command takes a hostname followed by one or more IP addresses. You can have up to eight IP addresses per hostname.
ip host pyramid 10.10.1.3

ip host sphinx 10.10.1.2 10.10.1.4 10.10.1.5
Deleting a host requires you to type the entire hostname and IP address over again!
no ip host pyramid 10.10.1.3

no ip host sphinx 10.10.1.2 10.10.14 10.10.1.5

 Enabling DNS

The Domain Name System (DNS) reduces the need for host entries—although, as I said before, you should have explicit host entries for any IP addresses that appear in your configuration. DNS is enabled by default; to enable it explicitly, use the command ip domain-lookup. To configure DNS, you must specify one or more name servers and the domain name to be used to complete unqualified names (typically, your own domain name). A typical configuration looks like this:
! Specify the DNS servers

ip name-server 10.10.9.1

ip name-server 10.10.9.2

!

! Set the name for unqualified hostnames

ip domain-name your-domain.com
To disable DNS lookups, use the no form of the command:
no ip domain-lookup
To re-enable DNS lookups, leave off the no keyword:
! Enable DNS lookups

ip domain-lookup
Use the show hosts command to view the cached hostnames and the DNS configuration:
Router>show hosts

Default domain is your-domain.com

Name/address lookup uses domain service

Name servers are 10.10.9.1 10.10.9.1



Host                     Flags      Age Type   Address(es)

Foxtrot                  (temp, OK)  18   IP    10.10.1.3

sphinx                   (temp, OK)  18   IP    10.10.1.2

No comments:

Post a Comment