Skip to Content
Cisco IOS Cookbook, 2nd Edition
book

Cisco IOS Cookbook, 2nd Edition

by Kevin Dooley, Ian Brown
December 2006
Intermediate to advanced
1188 pages
72h 8m
English
O'Reilly Media, Inc.
Content preview from Cisco IOS Cookbook, 2nd Edition

Disabling Domain Name Lookups

Problem

You want to prevent your router from trying to connect to your typing errors.

Solution

To prevent the router from attempting to resolve typing errors, use the no ip domain-lookup command:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#no ip domain-lookup 
Router1(config)#end
Router1#

You can also prevent the router from trying to resolve typing errors on routers that use DNS by changing the default EXEC behavior for unknown commands:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#line vty 0 4
Router1(config-line)#transport preferred none
Router1(config-line)#end
Router1#

Discussion

As we mentioned in Recipe 2.11, routers attempts to resolve all hostnames by using DNS by default. Unfortunately, if you don’t configure a valid DNS nameserver, the router sends these queries to the local broadcast IP address, 255.255.255.255. Querying a nonexistent nameserver is not only unproductive, but it can also be quite time consuming if it happens in an interactive session, since the router will not return the EXEC prompt until the query times out. This can be quite frustrating because, by default, the router will interpret any unknown command as a hostname that you want to connect to. So it will attempt to resolve any typing mistakes you enter on the command line:

Router1#pnig Translating "pnig"...domain server (255.255.255.255) Translating "pnig"...domain ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

IP Routing on Cisco IOS, IOS XE, and IOS XR: An Essential Guide to Understanding and Implementing IP Routing Protocols

IP Routing on Cisco IOS, IOS XE, and IOS XR: An Essential Guide to Understanding and Implementing IP Routing Protocols

Brad Edgeworth, Aaron Foss, Ramiro Garza Rios
Cisco Software-Defined Access

Cisco Software-Defined Access

Srilatha Vemula, Jason Gooley, Roddie Hasan

Publisher Resources

ISBN: 0596527225Supplemental ContentErrata Page