Link to home
Start Free TrialLog in
Avatar of jskfan
jskfanFlag for Cyprus

asked on

DNS records

We have a printer on the print server with hostname abcd
if I ping the abcd I get the IP 172.16.x.x.
the ping times out

if I ping the 172.16.x.x I get the abcd
the ping times out

Well, if I nslookup the abcd, I get the record 10.20.x.x

So which DNS record is correct ?

I flushed DNS and tried this on 2 different PCs, but still do not know which DNS is correct for the host abcd.

Any idea ?

Thank you
SOLUTION
Avatar of Dr. Klahn
Dr. Klahn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What is your OS?
Avatar of jskfan

ASKER

This is windows 2008 OS
The Printer is inside the LAN.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

If I am not wrong the Ping also uses NSlookup...This is why when I ping abcd I get 172.16.x.x
and when I directly use Nslookup abcd I get 10.20.x.x  if I use Nslookup 10.20.x.x I get abcd

So where is that IP 172.16.x.x coming from ?
I think you should read my comment again.

Ping and nslookup are two different tools.  One doesn't use the other.  Nslookup has its own DNS resolver, while ping uses the DNS resolver of the OS.  The normal OS name resolution process can use your hosts file, DNS, WINS, LMHosts file, and NetBIOS broadcasts to resolve names.
Please see the link below that explains difference of how ping and nslookup work:

https://blogs.msdn.microsoft.com/nitinsingh/2013/06/24/dilemma-of-name-resolution-process-with-ping-vs-nslookup/
Avatar of jskfan

ASKER

I know that they are different...but Ping calls the Nslookup.
For instance if you Ping an IP address 10.20.20.4
you will  get the "Pinging XYZ.domain.com" , how does the Ping knows the hostname ? it gets it from DNS..right?

Pinging XYZ.domain.com [10.20.20.4] with 32 bytes of data:
Reply from 10.20.20.4: bytes=32 time=17ms TTL=57
Reply from 10.20.20.4: bytes=32 time=22ms TTL=57
Reply from 10.20.20.4: bytes=32 time=31ms TTL=57
Reply from 10.20.20.4: bytes=32 time=14ms TTL=57
When I said "Nslookup has its own DNS resolver, while ping uses the DNS resolver of the OS", it would have been more accurate to say:
Nslookup has its own name resolver, while ping uses the name resolver of the OS.  Nslookup only does DNS, while the OS can use any of the methods mentioned (it tries them in order).

I think we've spent enough time covering the differences.

Do you have an entry in your hosts file for abcd?
Avatar of jskfan

ASKER

We do not use Host file..and this has been tried from 2 different PCs.

 
while ping uses the name resolver of the OS
if you are referring to the DNS resolver cache on the client, That one gets flushed once we ran Ipconfig /flushdns, we also rebooted the clients...

Dr Klahn..on his comment above, probably thought the 172.16.x.x gets translated when you ping the hostname.
I am not sure Networking team will make that to the printer...

The only thing I have not checked was the Print server, if it has cached an old IP for the printer hostname..even though it does not make sense...but I have seen situations when you flush the DNS on the print server itself. it resolves many issues.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

Ok...
Let's make it simple.

if from PC1,PC2 (more than one computer)
I ping the abcd I get the IP 172.16.x.x.
and the ping times out
Where could the 172.16.x.x come from?

seeing that if I nslookup the abcd, I get the 10.20.x.x
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

Just a comment to the relation between Ping and NSlookup
Ping always use Nslookup when you ping the Hostname or when you ping IP with -a

ping -a 10.x.x.x
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

That's What I meant....Ping does the Lookup into DNS ...
The order it does it probably , it looks into resolver , then Hostfile, then DNS server
Avatar of jskfan

ASKER

Thank you