cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
299
Views
0
Helpful
7
Replies
Beginner

Cisco IOS DNS Lookup order

I am trying to understand the DNS lookup order on the router. 

Let's say I have the following config:

ip host aaa.com 1.1.1.1

ip name-server 8.8.8.8

when I try to ping:

#ping aaa.com
Translating "aaa.com"...domain server (8.8.8.8)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!

Clearly, aaa.com is not 1.1.1.1. I see my config overrides Google's 8.8.8.8. This makes sense. But what bothers me is that it still tries to resolve through 8.8.8.8. If I put in a non-existing DNS server:

no ip name-server 8.8.8.8
ip name-server 25.25.25.25

It clearly still try to resolve

#ping aaa.com
Translating "aaa.com"...domain server (25.25.25.25) <<---- long wait here
Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/29/36 ms

What can I do to prevent that DNS lookup from happening and slowing down my local DNS resolution?

 

 

Everyone's tags (1)
7 REPLIES 7
VIP Advisor

Re: Cisco IOS DNS Lookup order

Cisco Router can Act as DNS Server for your Client. But most of FQDN it uses DNS resolution.

 

my view from FQDN lookup always uses the name server. but i belive local user want to access local server.

they should be like example : 

 

ip host aaa.local 1.1.1.1

 

if you want to IOS Device act as DNS Server follow below document :

 

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr_dns/configuration/15-sy/dns-15-sy-book/Configuring-DNS.pdf

 

BB
*** Rate All Helpful Responses ***
Beginner

Re: Cisco IOS DNS Lookup order

What I want to do is use external server for DNS lookup. The IOS router also acts as a DNS server and I want it to resolve some local DNS names. The aaa.com config is just an example to illustrate the problem. I want the IOS DNS server to simply return the static IP without performing another DNS query because it takes time especially when DNS serve is not reachable.

VIP Advisor

Re: Cisco IOS DNS Lookup order

Hello


@pingduck wrote:

. I want the IOS DNS server to simply return the static IP without performing another DNS query because it takes time especially when DNS serve is not reachable.


no ip domain-lookup



kind regards
Paul

Please rate and mark posts accordingly if you have found any of the information provided useful.
It will hopefully assist others with similar issues in the future
Beginner

Re: Cisco IOS DNS Lookup order

(removed due to duplicate)

Beginner

Re: Cisco IOS DNS Lookup order

What device and software version are you trying this on? It may depend on platform/software. Trying it on a CSR1000v 3.13.5 I get a different result than you are getting.

 

ip host aaa.com 1.1.1.1

ip name-server 8.8.8.8

 

R25#ping aaa.com

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:

 

If i remove "ip host aaa.com 1.1.1.1"....

 

R25#ping aaa.com

Translating "aaa.com"...domain server (8.8.8.8)

Highlighted
Beginner

Re: Cisco IOS DNS Lookup order

Thanks. Looks like it maybe OS specific. I'm running 15.8(3)M0a (Classic IOS, not IOS-XE). Bummer!

 
 
 
VIP Advisor

Re: Cisco IOS DNS Lookup order

i was thought the same due to old IOS.

BB
*** Rate All Helpful Responses ***
CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards