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#

Comments:
From Cisco Cookbook - Oreilly

Router(config)#line vty 0 4
Router(config-line)#transport preferred none


By default every vty line has preferred transport method of Telnet. This means you can initiate a telnet session by typing a hostname at the prompt - you don't need to explicitly issue the telnet command. By setting the preferred transport method to "none" the router will not try to connect to a remote host unless the telnet command is explicitly issued.
 
this is really annoying default behavior, here is a post discussing the same issue

http://networkers-online.com/blog/?p=40
 
Post a Comment

Links to this post:

Create a Link



<< Home

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