Cisco – Ping domain name using sourced interface

ciscodnsicmp

Problem: I want to be able to ping a domain name, sourcing from a particular interface on a Cisco router.

Scenario: I have Router-A, an it has a management address of 1.1.1.1. I can only connect to this router using that address from a certain location, which is how security is set up, and it cannot be changed. I would like to be able to connect to Router-A and then setup DNS with:

ip domain-lookup
ip name-server 44.44.44.44

Then, from the command line, I would want to do something like:

ping www.google.com source interface FastEthernet0

So, why cant i do this? Well, because when you introduce the domain name into the ping statement, you are not giving the option to source it anymore.

So, just use an extended ping? Although it seems like you would have that option, after you enter the domain name in, you don't get the option to source it anymore.

Why are you trying to source it from Fas0? Because that subnet is allowed to query the DNS, no other address on the device is allowed, by the DNS server, to make queries.

So, just send the request from an end device connected to the router? I cant, and this is not answering the problem, it has to be done from the command line on the router.

I had the idea of tclsh with something like:

tclsh
foreach var {
http://www.domainname1.com
http://www.domainname2.com
http://www.domainname3.com
http://www.domainname4.com
http://www.domainname5.com
} {ping $var repeat 5 source Fas0}

But that does not work.

Any ideas would be greatly appreciated.

Best Answer

Basically, you need to check the connectivity between this router and the DNS server through FastEthernet0.

  1. Try to ping it globally with no source interface
  2. Try to ping the DNS server IP address using this source interface or the IP address assigned to it
  3. Try to ping anything local in your domain first (e.g. your PC's fully qualified domain name), then try to ping a global site, since it may be an Internet access problem (1.1.1.1 IP address range)
  4. Try Cisco troubleshooting list, this case its may be of help CISCO DNS TS

NOTE
I just tried the 'ip name-server X.X.X.X' command on my core switch (X.X.X.X is my DNS server IP address) and everything worked perfect internally and externally (I used ping and traceroute to idjsrv.beyti.local) as shown:

enter image description here

(I used ping and traceroute to www.google.com) as shown:

enter image description here

Related Topic