It is possible to define static mappings of hostnames to addresses on a Cisco name resolution device. This usually happens in environments without a DNS server.
The mappings can be defined using the global configuration command ip host HOSTNAME IP_ADDRESS:
Floor1 (config) #ip host HQ_SERVER 192.168.0.100
In the above, we have defined the IP address 192.168.0.100 for the host name HQ_SERVER. To display hostname to address mappings, the display hosts command is used:
Show Floor1 # hosts
Default domain is not set
The name / address lookup uses the domain service
Codes: UN - unknown, EX - expired, OK - OK, ?? - expand
temporary - temporary, permanent - permanent
NA - Not applicable None - Not defined
Hostport Flags Age Type Address (s)
HQ_SERVER None (perm, OK) 0 IP 192.168.0.100
We can ping the hostname server to see if the hostnames are being resolved:
Floor1 # ping HQ_SERVER
Write the escape sequence to cancel.
Sending 5 100-byte ICMP echoes to 192.168.0.100, timeout 2 seconds:
The success rate is 100 percent (5/5), circulation min / avg / max = 0/0/1 ms
You can see that HQ_SERVER has responded to the ping request, which means the name resolution was successful.