Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my Windows XP workstation, I can find the machine I want to connect to in DNS with nslookup:

nslookup wolfman


But, when I try to connect to that machine, I get an error telling me that the machine can't be found (i.e., can't be looked up in DNS):

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

I am able to connect if I use the IP address directly:

C:\> ping

Pinging with 32 bytes of data:

Reply from bytes=32 time=41ms TTL=126
Reply from bytes=32 time=41ms TTL=126
Reply from bytes=32 time=44ms TTL=126
Reply from bytes=32 time=38ms TTL=126

I could work around this by adding an entry to my hosts file, but I would rather find out why this is happening. The problem is transient, most of the day I can connect to the machine just fine.

How is this possible?

ETA: I left this out for brevity, but it was asked for:

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

ETA: Other applications get the same results. I only tried ping to simplify. telnet can't connect, Cygwin apps print a "unknown host wolfman" message.

Update: Using wireshark, I found that my workstation is not attempting a DNS lookup. It's just reporting the "could not find host" error message.

share|improve this question
What happens if you ping – SLaks Oct 29 '12 at 19:14
Do you have wireshark installed? You could see if ping uses something else when trying to resolve the host. Have you tried telnet and ftp too? – ott-- Oct 29 '12 at 19:51
You could add a default DNS suffix for – Oct 29 '12 at 20:25 I already have that DNS suffix. – skiphoppy Oct 30 '12 at 16:35
Possible duplicate of:… – Oliver Salzburg Nov 19 '12 at 17:57

16 Answers 16

up vote 51 down vote

I believe that nslookup opens a winsock connection on the DNS port and issues a query, whereas ping uses the DNS Client service. You could try and stop this service and see whether this makes a difference.

Some commands that will reinitialize various network states :

Reset WINSOCK entries to installation defaults : netsh winsock reset catalog
Reset TCP/IP stack to installation defaults : netsh int ip reset reset.log
Flush DNS resolver cache : ipconfig /flushdns
Renew DNS client registration and refresh DHCP leases : ipconfig /registerdns
Flush routing table : route /f (reboot required)

share|improve this answer
I would bet Active Directory is probably active, but I do not know how to test. – skiphoppy Nov 20 '12 at 14:51
I disabled the DNS Client service, and the problem appeared to go away! Not sure yet if it was a fluke. The problem didn't come back when I restarted the service. – skiphoppy Nov 20 '12 at 14:55
Sometimes just stopping and restarting the service fixes DNS problems (don't ask me why). The question is how long this will last. Some unlucky people need to repeat it again and again. – harrymc Nov 20 '12 at 16:06
Yes, if that's the case, I want to know why! I am going to try this the next time the problem occurs. If it appears to fix it then, I'm going to drag in IT admins from the main corporate office and get them to tell me why. :) And you'll get the bounty if that appears to be the fix. – skiphoppy Nov 20 '12 at 16:36
sfc /scannow in case the dns client service system files are corrupt subtly? I've also seen some people with similar problems caused by a virus. – Jon Kloske Nov 26 '12 at 5:27

Try ipconfig /displaydns and look for wolfman. If it's cached as "name does not exist" (possibly because of a previous intermittent failed lookup), you can flush the cache with ipconfig /flushdns.

nslookup doesn't use the cache, but rather queries the DNS server directly.

share|improve this answer
I tried: it's not cached. And clearing the cache doesn't fix the issue, either. – skiphoppy Nov 20 '12 at 14:46
Can you post the output of nslookup -all? Is novc listed? – craig65535 Nov 20 '12 at 18:22

nslookup works different to other commands when resolving names/ip addresses on Windows.

The normal resolution method on Windows is as follows:

  1. The client checks to see if the name queried is its own.
  2. The client then searches a local Hosts file, a list of IP address and names stored on the local computer.
  3. Domain Name System (DNS) servers are queried.
  4. If the name is still not resolved, NetBIOS name resolution sequence is used as a backup. This order can be changed by configuring the NetBIOS node type of the client.

nslookup on the other hand is used for testing Domain Name Servers.

share|improve this answer
Are there any settings that can move the NetBIOS query higher up in that list? I have the gut feeling that the NetBIOS lookup is involved somehow, but since the DNS query is definitely working I can't see how it would ever get to that step, if the sequence above is immutable. – skiphoppy Nov 20 '12 at 14:49

Maybe is listed in C:\Windows\system32\drivers\etc\hosts ?

nslookup bypasses that file and always asks DNS, while ping and other tools first of all look up in "hosts" file, then in DNS.

share|improve this answer
Good thought! But I checked, and neither of the machines I've seen this issue with are listed in hosts. – skiphoppy Nov 20 '12 at 14:47

Try ping with hostname followed by a dot. So instead of ping wolfman use ping wolfman.

That should get you resolving without having to do workarounds with hosts file, etc.

share|improve this answer
This was the solution for me. – IAmTheSquidward Aug 12 '15 at 2:27

I've struggled with a similar issue and have tried the solution suggested by @harrymc. I found what eventually seems to (at least somewhat) work at the microsoft technet forum (nslookup works but nothing else has DNS on standalone Win7 PC)

Here's the quote:

... try to use the command below to flush and reset a client resolver cache for test.

ipconfig /flushdns

ipconfig /registerdns

Please refer to the link below for more details.

So basically what was missing for me was ipconfig /registerdns

share|improve this answer
original answer by @harrymc now reflects the missing /registerdns command – Mick Halsband Jun 29 '15 at 10:35

I had the same problem on a Windows 2012R2 (=8.1) system, and tried all the above suggestions, but none of them would fix it:
- Pinging the fully qualified name worked.
- Pinging the unqualified name did not.
- Both worked on several other systems, that had the same OS and apparently the same configuration.
- All the necessary suffix search strings were there.
(Note that some of the proposed fixes, like the workaround for the multi-label queries, are obviously irrelevant, as the unqualified name has only one part.)

Then I noticed that the target system I was trying to ping did NOT have an IPv6 address. So I tried "ping -4 unqualified_name", and bingo! this worked.
So for some reason, on this system only, ping only tried to resolve unqualified name->IPv6 address, and not unqualified name->IPv4.
For me the fix was to disable IPv6 completely as I don't need it at all. But I'd be really interested to find a more gentle way to tell ping (or presumably the DNS client service) to try resolving both IPv4 and IPv6 addresses.

share|improve this answer

Just today we had the same issue, but the solution was different. So I thought, I'd add it for reference as this was the top most search result.

  • Problem: ping will not resolve a host name, but nslookup can. (Observed on 2 different Windows Server 2012 R2 hosts.)
  • Cause: (For each host) The host has more than one NIC connected and there are multiple default gateways configured.
  • Solution: (For each host) Remove default gateway from configuration of all NICs but one, so there reamains only one default gateway.
share|improve this answer
ah this did it for me. Perfect. – IAmTheSquidward Jan 26 at 0:39

Adding an entry in the file c:/windows/system32/drivers/etc/hosts might fix it.

share|improve this answer
That will fix it, but it will not resolve his issue on that machine, but it will not help him on other machines. Remember Hosts > DNS Resolver > DNS Server > NetBIOS name. – The Dude May 29 '15 at 15:10

I was trying to figure out why on one win 7 computer I can use ping server which works, and the other it can't resolve server. However both could ping server.lan which I didn't quite understand.

Turns out I had messed with some settings (DNS suffixes) to not have to use FQDNs while using the work VPN. I had to go add my local .lan to those suffixes in order to get both computers acting the same.

Go to Control Panel > Network and Internet > Network Connections and right click on your network connection and hit Properties. Click Internet Protocol Version 4 and hit the Properties button. Then the Advanced... button in this new window. Go to the DNS tab, this is where I had added a DNS suffix for my work but also needed one for my normal home connections.

Advanced TCP/IP Settings

share|improve this answer
I ran into a similar situation on a server with a static IP address. The first entry in the "Append these DNS suffixes" was blank AND the "DNS suffix for this connection" was blank. Other servers where it worked had the same blank "Append these DNS suffixes" BUT the "DNS suffix for this connection" populated. – Tim Lewis Apr 7 at 17:29

i have encountered this when we migrated to windows 7 from windows XP, the issue was related to a Windows 7 Multi Label DNS Query issue.

Allow DNS Suffix Appending to Unqualified Multi-Label Name Queries - see:

Hope this helps

share|improve this answer
Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Canadian Luke Mar 21 '14 at 17:40

If on mac os x it might be an DNS Cache problem:

Dump the cache

sudo killall -HUP mDNSResponder
sudo dscacheutil -flushcache
share|improve this answer

I'm picking this up because it bothered me the last year and maybe I found a workaround.

For me it seemed some dns-caching-system within the windows client is faulty. Windows 7 and 8.1 are affected by this... cannot say much about Windows XP anymore. ping doesn't resolve the name. it's not the icmp-part which is important but the name resolving part). nslookup is designed to query the nameserver and does exactly that and no windows name-hierarchy-resolving.

Restarting the dnscache service helped everytime. But since I disabled IPv6 on all client-interfaces the problem didn't occured anymore.


share|improve this answer
Disabling IPv6 may not be a viable solution for everybody (and it sounds anecdotal at best, anyway). Everything else you say seems to have been said already in this thread (e.g., harrymc’s comment “Sometimes just stopping and restarting the service fixes DNS problems”, two years ago). – G-Man Nov 3 '14 at 15:31

I have just had this problem, and found something quite peculiar, and managed to fix it Lol

Basically, if you have any entries in your hosts file, that are the same as the IP your ping is trying to resolve to, it will fail.

For example, if in your DNS, you have a record for -, but then you have an entry in your client's hosts file,, you will not be able to ping

Strange huh

share|improve this answer

had the same problem.

turns out another machine hat the same ip address on the network, and that was causing the problem.

changed ip back to dhcp and everything was working fine.

no idea why nslookup worked and ping didn't.

share|improve this answer

ping uses the ICMP protocol, specifically the 'Echo Request' and 'Echo Reply'.

many networks disable ICMP utilities in order to prevent attacks or basic network scanning. I've found many routers you purchase come with a setting to disable ping and like utilities enabled by default.

you can find more about ICMP here:

share|improve this answer
Yes, but before using ICMP, the domain has to be resolved to an IP address as usual. So this is not the issue here. – Michael Nov 23 '12 at 2:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .