IP Domain-Lookup
When we type a domain name into a router or switch's CLI, it tries to resolve that name to an IP address so it can initiate the connection. By default, DNS lookup is enabled, so if we type a command that the device doesn't understand, it will attempt to resolve it as a domain name.
This can be annoying when working in the CLI because you have to wait for the DNS lookup to timeout before you get control back. To demonstrate this, let's look at what happens when I type an invalid command:
Router# shw ip route
Translating "shw"...domain server (255.255.255.255)
(255.255.255.255)
% Unknown command or computer name, or unable to find computer addressAs you can see, the router tried to resolve "shw" as a domain name. This causes a delay of several seconds while it waits for the DNS lookup to timeout.
To disable this behavior, we can use the no ip domain-lookup command in global configuration mode:
Router(config)# no ip domain-lookupNow when I type an invalid command, it immediately returns an error without attempting DNS resolution:
Router# shw ip route
% Invalid input detected at '^' marker.The response is immediate, which makes working with the CLI much more efficient.
If you need to re-enable DNS lookup later (for example, if you want to ping domain names from the router), you can use:
Router(config)# ip domain-lookupThis is a simple but very useful configuration change that improves the CLI experience when working with Cisco devices.