Cisco Support Community
Community Member

Using DNS servers with switches

Hi All,

I have some of the switches in my company configured for DNS as below:

no ip domain-lookup

ip name-server

ip name-server

My first question is, as domain-lookup has been disabled using "no ip domain-lookup", would the following lines specifying the name-servers have any affect?

As far as I understand, for the switch to be able to use the DNS servers I need to enable "ip domain-lookup", am I correct in thinking that way?

Second question, if I have the config as below:

ip domain-lookup

ip name-server

ip name-server

What happens when for example if I type "ping abc" and if my name-servers are not able to resolve the name or in case the name servers are unreachable, would it behave as if no name servers were configured and try to resolve it by itself and I'd have to wait 1 minute or 2 before I can do anything?

Would anyone be able to clarify this for me?

Many thanks,


Community Member

Re: Using DNS servers with switches

Yes, the 'no ip domain-lookup' will prevent the switches from attempting to resolve. The 'ip name-sever X.X.X.X' do not have any affect because you've told it not to resolve addresses. You need to issue a 'ip domain-lookup' in order to resolve domain names, as you have suggested. If your name servers cannot resolve the address, you will have to wait for the lookup to timeout. I would disable domain-lookup if you aren't using it because any time you mistype something like exif instead of exit, your switch will attempt to resolve that and you'll have to wait for a timeout.

Community Member

Using DNS servers with switches

Thanks very much for the clarification Daniel. Appreciate it.

CreatePlease to create content