Windows server ignoring DNS resolution on private interface

domain-name-systemnetworkingwindows-server-2012

I have a Windows 2012 server with two interfaces – public internet facing, and private.

The private interface uses our internal DNS servers. This interface has no gateway. Static IP – not DHCP.

I want to disable the public interface, as we use a proxy for outgoing traffic.

Having disabled it, I'm finding DNS resolution failing:

  • I cannot ping foo.external.com – host cannot be found

  • However, I can nslookup, notice that it connects to our internal DNS, and successfully resolve foo.external.com

  • ipconfig /displaydns DOES show the correct entry. I'm utterly confused why ping does not simply use this entry.

  • If I manually add an entry to local hosts file, for "1.1.1.1 foo", as an experiment, and try ping foo, it fails – cannot resolve host. Same for foo.external.com, and "foo.external.com.". Pinging "foo.external.com", or "foo.external.com." also fails.

  • If, however, I then re-enable the public interface, it all works. Including the hosts file. I can ping "foo" (the resolution aspect). Disable it, and it stops working again.

I've tried all the reboots, ipconfig /flushdns, nbtstat -R stuff.

a) Why is ping (and our application) not able to properly resolve things when the public interface is disabled, despite Windows being able to speak to its DNS server, and cache the result (as shown in ipconfig /displaydns).

b) Why is the hosts file being ignored for the private interface?

Many thanks.

Best Answer

A quick Google search returned this user with the same question:

The user took a Wireshark capture and found that when when trying to ping the host, no DNS query was being performed.

The explanation for this behaviour was:

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)