Thursday, March 02, 2006

 

Better handling of typos at IOS prompt. (Question #28)

Have you ever run into the IOS behavior that if you mistype something at the IOS CLI prompt, it tries to do a DNS lookup for the mis-typed word. Something like following

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

It can take a while for the lookup to time out and you have to sit there waiting for it. One way to fix this particular problem is to prevent DNS lookups altogether. That give the following behavior -

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

Translating "TYPO"
% Unknown command or computer name, or unable to find computer address
R1#

This time, the prompt returns pretty much right away.

Now consider the case where you do not want to turn off "ip domain-lookup" but you don't want the behavior where typos at the command line cause you to wait for IOS to time out on DNS lookups for bogus hostnames. How can you get IOS to do that?

Once you have the solution, you would see the following behavior when you mistype something at the prompt -

R1#TYPO
^
% Invalid input detected at '^' marker.

R1#

This page is powered by Blogger. Isn't yours?