Question Locked

Windows DNS weirdness: nslookup finds, ping doesn't

0 helpful
22 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

The fact that this is possible boggles me:

-----
C:\>ping myhost
Ping request could not find host myhost. Please check the name and try again.

C:\>nslookup myhost
Server: dns.mydomain.loc
Address: 192.168.1.2

Name: myhost.mydomain.loc
Address: 192.168.1.4

C:\>ping myhost
Ping request could not find host myhost. Please check the name and try again.

C:\>ping myhost.mydomain.loc
Ping request could not find host myhost.mydomain.loc. Please check the name and try again.
-----

What??

Despite multiple cache clearings, browsers can't find it either (it's an internal website). I am suspecting this is why. I am not sure how, after several /flushdns and /registerdns, if nslookup finds it right off, why can't anything else..?

22 replies

by larryd4

Ping will directly query the DNS server defined in ipconfig

nslookup will quiery the DNS server, on the AD domain controller your security was authenticated on.

Ping simply asks DNS give me the ip so I can ping it.

Their is no record in DNS for a myhost PC. But the code within the AD DNS schema has a refernce for a nslookup so you are returned the address of your authentication server..

If you invoke nslookup and put a x in front of it, you will get a > prompt. Type in a question mark at the prompt and you can see the switches to get the info you need with nslookup.

nslookup x

by munsch

if you look at what i posted, nslookup of course prints what server it is asking: but then it prints, on the next two lines, the answer. And the answer is correct: myhost in this case is indeed 192.168.1.4.

So the AD DNS server knows this (as reported via nslookup), but the workstations do not (as reported by ping)? How is this possible? Bad AD DNS server config?

The primary DNS server for all workstations is - you guessed it! - the AD DNS server.

So i still don't see how this is possible, or how to fix something that seems to be set up correctly.

by ---tk---

so when you ping server.com, it cant find it. Can you ping the IP address? If you can ping by IP I would lean towards a netbios-WINS setting issue....

by larryd4

Nslookup does not ask the same question as ping.

Ping is generic app that needs to ask the basic question that applies to all DNS servers, linux, Unix, MAC Servers, etc...
Which is, do you have a record for "myhost" and when the AD DNS server checks for a "A Record" it does not have an entry, so you don't get a ping response.

But nslookup asks the AD DNS Schema or
"AD for DNS" service, what server did I authenticate with using the keyword "myhost".

If you go look at your DNS records you will not see a record for "myhost".

The "myhost" keyword is built in to the "AD DNS" code. But will not respond to a normal DNS lookup which is what ping does.

It happens the same way on my network as well.

by munsch

I didn't set this box up - looking at the DNS settings, i see it's set for round robin. Great. We only have the one server... is the silly thing handing off internal-domain requests to external servers, maybe..?

by netman1958

configured on the workstations? To clarify, on your workstations, do you have the primary DNS server as the ADC and a secondary DNS server ip that points to a non-Active Directory DNS server?

On Windows 2000 and later, if a request to your primary DNS server times out, it switches to the secondary DNS server and stays with it for a period of time. However, nslookup always connects to the primary.

Take a look at this article:
http://support.microsoft.com/kb/318803
Be sure to read the part about caching negative responses.

by munsch

Good info, thanks. We have no secondary internal DNS, and had round-robin set on the DNS server: i already turned that off. We are serving 2nd/tertiary DNS servers via DHCP to client workstations. I've turned off neg caching for all stations, serving a .reg via GPO. So far, on my own machine, i have seen no issues. Since this has been sporadic, it'll likely be a few days before i know it's gone for good.

I'm hoping this will also clear up the weird sudden-loss-of-shares and exchange issues, but i'm not holding my breath on that one.

by ---tk---

I reread that question. and forgot that you said ping did not work... I would look into how WINS is set up...

by munsch

Something i haven't looked at, at all. So good hint, thanks. Just happened again: was on an internal website, left it alone for about half an hour, went to follow a link on the page and got bupkis. As every time before, ipconfig /flushdns and /registerdns instantly fixes it: can immediately browse to the internal server again.

by munsch

yeah, i don't think it's WINS. The machine in question is a linux box, and its name isn't remotely similar to any of the windows machines. Or do i need to add a manual entry to WINS? Why isn't DNS good enough..?

by ---tk---

Is on the DNS server, it handles NetBIOS name translation.... http://technet.microsoft.com/en-us/library/cc784180.aspx

I think I need to take a step back... you added another twist... lol... So the DNS server is an NT box? correct? and your are accessing the network from a linux box? correct? what distro are you using? If so are you authenticating to the domain with kerbrose? and is this box the onlyone that is having issues?

by munsch

ok, i glossed over the "intro to ping" and didn't see what you were getting at before, sorry.

In this case, however, myhost has an entry on the AD DNS server. That DNS server is handed out to all clients as primary DNS via DHCP. It's an internal Linux box running (among other things) an intranet site. It will work for a while: then suddenly my client seems to forget where myhost is, and i have to ipconfig /registerdns again. Doing so *instantly* restores access to myhost's intranet site... for a while. Then it forgets again.

Is there something that needs to be done besides the DNS entry on the AD DNS server..? I need users to be able to regularly access this site without having to /registerdns several times a day. Something is clearly misconfigged, but where? The DNS setup seems straightforward.

by larryd4

I am unsure if you would really mess things up if you ad a pointer record to myhost in the AD DNS server.

I would create a pointer record called something line "myhosts" with it referencing the servers ip address. That way your not screwing with the myhost reserved word.

by munsch

the machine is called data.phillycarshare.loc internally. The original post was machine and domain-name sanitized, is all.

The A record is for data., pointing to its internal IP address. There is also a CNAME for other internal website hostnames, pointing to data. Sorry to have muddied that up.

by wizard-09

Maybe you want to write a host file on the local machine to quirey it before it does a dns search on the ip web address?

by munsch

DNS server is Win2k3, and is the DC.
Intranet site is on a linux box running Ubuntu.

DNS has an A record pointing at the linux box. There are also two CNAME records for two other intranet sites hosted on the same box. When it's all working, it works perfectly.

The clients are all WinXP Pro.

Every now and then, the intranet names stop resolving from the clients and are not browseable in IE or Firefox. If i do a "ipconfig /registerdns" on the affected client, they resolve again and are browseable in IE and Firefox. (We use firefox, but i tried IE as well just to see).

I am seeing people logging in (successfully) - therefore authenticating to the DC - but not connecting their network shares consistently. Usually yes, sometimes just no, for no reason. Again, /registerdns instantly fixes that.

Outlook, for some people, will also occasionally forget where the exchange server is - and again, /registerdns fixes it.

I am assuming all this points to Stupid Crap on our DNS server, but i'm open to suggestions.

by ---tk---

Have you set up kerberos? If Kerberos isn't authenticating to the DNS correctly it can cause this issue, because once the DNS send the Linux box a request to check out who they are, the Linux box then has incorrect stuff and the DNS says... ok, you are not communicating correctly, Im dropping you... see ya...

by munsch

It happened again this AM. There is a machine, data.mydomain.loc, which is a linux box. I have a vhost web site on it, rt.mydomain.loc. Our Win2k3 DNS server has an A record for the 'real' machine name, data., and i made a CNAME for rt pointing to data for the internal web site.

This morning, browsing to rt failed. Before doing anything to try and fix it, I got this result:

-----
C:\>ping rt
Ping request could not find host rt. Please check the name and try again.

C:\>ping data

Pinging data [192.168.1.4] with 32 bytes of data:

Reply from 192.168.1.4: bytes=32 time<1ms TTL=64
[succeeds]

C:\>ping rt

Pinging data.phillycarshare.loc [192.168.1.4] with 32 bytes of data:

Reply from 192.168.1.4: bytes=32 time<1ms TTL=64
[NOW it succeeds]

So: it is NOT resolving the CNAME correctly, but when asked about the machine itself, data, it resolves to the correct IP, and then the CNAME resolves "thru" the machine name to the target IP.

I incremented the serial the last time i made DNS changes. I made the above-suggested zero-neg-cache registry change. I have rebooted the machine and ensured all settings are current and policies are being applied.

Anyone else ever run into this?

by netman1958

I had a similar issue several years ago after upgrading several workstations to W2k. I solved it by completely removing the secondary DNS server form the network config on the W2k workstations. I only used the primary and it was our Active Directory DNS.

Give that a try on one of your workstations and let us know if it helps.

by munsch

I saw that the server had been configged to hand out sec/tert DNS servers which were external. New DHCP settings now only give out the DC as the only DNS server; DNS server on the DC is configged to forward lookups to our ISP's DNS if/when it can't find something.

So far this seems to be working.

Thanks all. What a PITA. It doesn't help that this network was already set up when i got here, and i'm fixing things as i find them. This being a 24/7 op there's no way to take it all down and build it up right.

by parissa_bakhshi

Hello,
I faced same problem in the network,

when you use this command:
> ping myhost

It uses WINS server. because you have use "myhost" not myhost.domain_name.
When looking for scuh words, windows look for them in WINS, but when you look for complete domain records, then it looks in DNS server. Nslookup, do so. It looks for records in DNS server.So it can give you the correct answer.You can do one of the solutions below:
1- Make sure you have correct records for that station in your WINS server.
2- Use complete domain name instead of using host file. eg. use "myhost.abc.locall"

Hope this helps

Have fun,
Parissa

This discussion is closed to new replies.