Normally, when we working on Cisco Routers & Switches either on Cisco Packet Tracer & GNS3 or in a real environment automatic DNS lookup creates a problem. Whenever we accidentally execute a wrong command on the console of the router or switch then we have to wait for some time to get it working again. This is because of DNS lookup. Cisco devices are preconfigured with an automatic DNS lookup. In this article, we will discuss how we can disable this automatic DNS lookup.
What is the automatic DNS Lookup?
DNS (Domain Name System), is a system that is used to translate a domain name to an IP address. In Cisco devices, this lookup feature is by default enabled. So, whenever someone executes a wrong command in the Cisco devices console, then the Router or Switch by default starting looking for an IP address of that name. However, no such domain name present in the global DNS server. That’s why it takes some time to resolve the unknown DNS query. This DNS lookup process looks like the below image.
How to disable DNS lookup?
Now, we will discuss how we can stop unnecessary domain lookup. In order to disable DNS lookup, you have to type the below command in the global configuration of the Cisco device.
[terminal]no ip domain-lookup[/terminal]This command helps you to prevent automatic DNS lookup in Cisco devices.
Other DNS related useful command for Cisco IOS
Cisco provides you a facility to store small numbers of DNS queries in the device storage itself. It helps administrators to execute ping or traceroute-related queries just using a domain name, which is easy to remember. Below, the global configuration mode command can be used to make a DNS entry in the Cisco router for a particular host.[terminal]ip host [host-name] [ip_address] [/terminal] where host-name is the domain name of the host and ip_address is the address of the machine. For example, this command looks like : [terminal]ip host gns3network.com 192.168.1.1[/terminal]
Now, if you want to ping 192.168.1.1 address, you just have to type ping gns3network.com, and your router itself converts this domain name into IP address as per stored into DNS record.
Summary
In this article, we discussed DNS lookup. We also discussed some methods that can be used to disable DNS lookup in Cisco devices. However, whenever there is a need to enable DNS lookup for a particular host, we can!
Did you find this article helpful! Please leave a comment in comment box.