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 terminalEnter configuration commands, one per line. End with CNTL/Z. Router1(config)#no ip domain-lookupRouter1(config)#endRouter1#
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 terminalEnter configuration commands, one per line. End with CNTL/Z. Router1(config)#line vtyRouter1(config-line)#0 4transport preferred noneRouter1(config-line)#endRouter1#
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 ...