liveBook · Manning

Ip name-server

As explained in Acing the CCNA Exam: Volume 2 Advanced Networking and Security

ip name-server is a Cisco IOS configuration command that specifies DNS servers a router can query for name resolution.

ip name-server configures the DNS server or servers that a Cisco IOS device queries to resolve domain names. The router must also have DNS lookup enabled, which is the default. section 3.2.1

Key configuration facts:

  • Specify up to six DNS servers, either in one command or through separate commands. section 3.2.1
  • If the first server fails to resolve a name, IOS queries the other configured servers. section 3.2.1
  • Use ip dns server separately when the router must answer DNS queries from client devices; ip name-server supplies its upstream resolvers. section 3.2.2

Configure and verify resolution

R1(config)# ip name-server 8.8.8.8 R1(config)# do ping google.com Translating "google.com"... domain server (8.8.8.8) [OK] !!!!! The command identifies 8.8.8.8 as R1’s DNS server, allowing the hostname to resolve before the ICMP test runs. section 3.2.1

R1# ping google.com
Translating "google.com"...domain server (255.255.255.255)
% Unrecognized host or address, or protocol not running.                 #1
R1# configure terminal
R1(config)# ip name-server 8.8.8.8                                       #2
R1(config)# do ping google.com
Translating "google.com"...domain server (8.8.8.8) [OK]                  #3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.217.161.46, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/8/9 ms     #4
#1 R1 fails to resolve google.com.
#2 Configures 8.8.8.8 as R1’s DNS server
#3 The domain name is successfully resolved.
#4 The ping works.

Compare failed hostname resolution before configuration with successful resolution and ping afterward. section 3.2.1

How Acing the CCNA Exam: Volume 2 Advanced Networking and Security covers it

How deep it goes
Explains configuration, six-server capacity, fallback behavior, defaults, and verification, but not DNS protocol internals.
Examples
Uses 8.8.8.8 to resolve google.com and resolve time1.google.com for NTP configuration.
What it assumes
Assumes basic Cisco IOS configuration and DNS terminology while teaching lookup enablement and resolver selection.
What you can do after
Operate/configure it on Cisco IOS and verify hostname resolution with ping or show hosts.
How it connects
Connects DNS client operation with ip domain lookup, ip dns server, default domain names, and host mappings.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 2 Advanced Networking and Security. The section links point to the parts of the book it draws on.