CCNA 200-301 Command Reference: ip domain-lookup
The above video is from my CCNA YouTube Channel. Check it out once you’re done with this CCNA Command Reference on the ip domain lookup command.
Whether you use this command with or without the hyphen, the ip domain lookup command performs a simple but important task. When it comes to practice labs or simulators, I’ve been disabling it for years with no ip domain lookup before I even start a lab. It’s one of the four commands I run at the beginning of any lab:
R1(config)#no ip domain-lookup R1(config)# R1(config)#no service timestamps R1(config)# R1(config)#line con 0 R1(config-line)#logging synchronous R1(config-line)# R1(config-line)#exec-timeout 0 0
You don’t have to leave a space between commands. I do that here to make them easier to read. I have a CCNA command reference for each one of those commands here on the site, so when you’re done here, check the other ones out!
CCNA Command: service timestamps
CCNA Command: logging synchronous
CCNA Command: exec-timeout
The ip domain-lookup command is enabled by default, but you will not see it in the startup or running configuration when it’s on. When negated, it will appear near the top of the config. I’ll disable it now and then show you the top of the running config. You can enable or disable this lookup with a hyphen in the command or you can leave the hyphen out.
R1(config)#no ip domain lookup R1#show run Building configuration... Current configuration : 1430 bytes ! ! Last configuration change at 17:34:44 UTC Fri Feb 12 2021 version 15.1 no service timestamps debug uptime no service timestamps log uptime no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker no aaa new-model no network-clock-participate wic 3 no ipv6 cef ip source-route ip cef no ip domain lookup
Now, just what the heck does this command do? If you enter something that isn’t an IOS command — in my case, that’s usually a misspelled IOS command — by default, the Cisco switch or router thinks you want that input sent to a DNS Server so it can be resolved to an IP address. In short, the IOS thinks you’ve entered a remote device’s hostname.
In most lab situations, you won’t have a DNS Server location defined, so the device “helpfully” sends a broadcast to find one. To show you what that looks like, I’ll reenable the lookup and then enter some authentic frontier gibberish at the command line.
R1(config)#ip domain lookup R1#sdfljkdf Translating "sdfljkdf"...domain server (255.255.255.255)
That broadcast can take several minutes to resolve in a larger network. In a lab, it’s likely just a few annoying seconds. But what do humans tend to do when hitting a button once doesn’t give them the result they want? They hit it some more! Here’s what happens when I impatiently tapped ENTER three more times…
Translating "sdfljkdf"...domain server (255.255.255.255) (255.255.255.255) Translating "sdfljkdf"...domain server (255.255.255.255)
…. I sent out three more broadcasts, and now I have to wait for those to timeout before I can enter what I meant to enter in the first place. Finally, I get the result shown here, and I’m plopped back at the prompt.
% Unknown command or computer name, or unable to find computer address
Admittedly, this is more of an annoyance than anything else, but if you’re a bad typist, you might want to disable this feature before you get to work in a lab. After I do so, have a look at what happens when I enter more gibberish:
R1(config)#no ip domain lookup R1#sdfsdf Translating "sdfsdf" % Bad IP address or host name Translating "sdfsdf" % Unknown command or computer name, or unable to find computer address
No broadcast for a DNS Server was performed because we disabled that feature with no ip domain lookup.
Here’s a CCNA Command Reference Video from my CCNA YouTube Channel that’ll show you this feature in action (and inaction). Have a look and then check out the other command reference here on the site. Thanks for reading and watching!
Chris Bryant
CCIE #12933
“The Computer Certification Bulldog”
Follow me on Twitter — @ccie12933. See you there! 🙂