Using DNS names with ping and traceroute: Example:

In the network illustrated in Example: network domain, the switch at is configured to use DNS names for DNS-compatible commands in the domain. The DNS server has been configured to assign the host name docservr to the IP address used by the document server (

Example: network domain

Configuring switch "A" with the domain name and the IP address of a DNS server for the domain enables the switch to use host names assigned to IP addresses in the domain to perform ping and traceroute actions on the devices in the domain. To summarize:



DNS server IP address

Domain name (and domain suffix for hosts in the domain)

Host name assigned to by the DNS server


Fully qualified domain name for the IP address used by the document server (

Switch IP address

Document server IP address

With the above already configured, the following commands enable a DNS-compatible command with the host name docserver to reach the document server at

Configuring switch "A" in Example: network domain to support DNS resolution

switch(config)# ip dns server-address
switch(config)# ip dns domain-name

Ping and traceroute execution for the network in Example: network domain

switch(config)# ping docservr is alive, time = 1 ms

switch# traceroute docservr
traceroute to
              1 hop min, 30 hops max, 5 sec. timeout, 3 probes
 1 1           1 ms       0 ms       0 ms
 2 2         0 ms       0 ms       0 ms
  • 1First-Hop Router (“B”)

  • 2Traceroute Target

As mentioned under the following example, if the DNS entry configured in the switch does not include the domain suffix for the desired target, you must use the target host's fully qualified domain name with DNS-compatible commands. For example, using the document server in Example: network domain as a target:

Example: of ping and traceroute execution when only the DNS server IP address is configured