Configure Cisco device as DNS client

DNS is an  application layer protocol used to resolve hostnames to IP addresses. If you have a DNS server on your network, you can configure your Cisco device to use it for name resolution. Here are the steps:

  1. (Optional) If you’ve previously disabled DNS lookups on your device, re-enable it with the ip domain-lookup command.
  2. Specify the IP address of the DNS server using the ip name-server command. It is possible to specify up to six DNS servers.
  3. (Optional) Specify the domain name to append to the hostname you type in by using the ip domain-name command.

 

Here is an example configuration:

Floor1(config)#ip name-server 192.168.0.100

In the output above you can see that I’ve specified the IP address of my DNS server (192.168.0.100). Let’s say that the DNS server contains a record for a server called fileshare. I can try to ping that host using its hostname to verify that the name resolution process is indeed working:

Floor1#ping fileshare
Translating "fileshare"...domain server (192.168.0.100)
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.110, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/1 ms

As you can see from the output above, the hostname fileshare was translated to the IP address of 192.168.0.110.


Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.

We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training: