How-to: Avoid DNS lookup when mistyping a command

If domain lookup is enabled (default) the router treats each mistyped command as a hostname and tries to resolve its IP address by querying the DNS server.

This behavior is undesirable in most cases because it wastes network administrators time waiting for routers trying to resolve mistyped commands.

R2#xyz
Translating "xyz"...domain server (255.255.255.255)

Translating "xyz"...domain server (255.255.255.255)
 (255.255.255.255)
Translating "xyz"...domain server (255.255.255.255)
% Unknown command or computer name, or unable to find computer address

This waste of time can be avoided with one of the following solutions:

Solution1:Disabling domain lookup:

This solutions is suitable to LAB environments when your routers do not actually have any name servers configured on them; which means trying the lookup hostnames is totally a waste of time.

R2(config)#no ip domain lookup

Solution2: Allowing name lookup but stopping the router from initiating connection without typing the telnet keyword:

In this case you can still resolve hostnames into IPs while avoiding this default behavior or trying to initiate connections to each typed hostname. This solution is suitable to networks where domain lookup is needed. Assuming you are using the console to access the router:

R2(config)#ip domain lookup
R2(config-line)#line con 0
R2(config-line)#transport preferred none

This is a useful command to configure on your devices, as it  really saves a lot of time specially for those who do a lot of typos :)

Related posts:

  1. Passive-interface command behavior in RIP, EIGRP & OSPF
  2. The ip route-cache command – Bury the hatchet series
  3. How-TO: Configure DHCP on a CISCO router
  4. OSPF RID Story
  5. Static routes and next hops


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

One Response to “How-to: Avoid DNS lookup when mistyping a command”

  1. It was a really nice theme! Just wanna say thank you for the selective information you have fanned. Just continue publishing this kind of post. I will be your patriotic reader. Thanks again.

Leave a Reply