cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4207
Views
0
Helpful
7
Replies

Cisco IOS DNS Lookup order

pingduck
Level 1
Level 1

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?

 

 

7 Replies 7

balaji.bandi
Hall of Fame
Hall of Fame

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 *****

How to Ask The Cisco Community for Help

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.

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


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

(removed due to duplicate)

Seth Beauchamp
Level 1
Level 1

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)

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

 
 
 

i was thought the same due to old IOS.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco