Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 2.38 KB

dns.md

File metadata and controls

31 lines (19 loc) · 2.38 KB

+

  • Deleting DNS servers clears cached resolutions for those servers.
  • nslookup does not add entries to the cache.
  • Entries added by ping are not used by anything else???
  • Verify with:
    ipconfig /displaydns
    

https://superuser.com/questions/262799/how-to-launch-a-command-on-network-connection-disconnection


https://serverfault.com/questions/84291/how-does-windows-decides-which-dns-server-to-use-when-resolving-names/84293


First, you should determine why the primary DNS server is having problems responding (or why the client is having trouble receiving responses from the primary DNS server). Barring that, the only option is to follow the steps below to force Windows to always try your primary DNS server first (which will slow things down if that primary DNS server does fail).

Here's the relevant part from the MS KB article linked above:

Modify the following key in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters

Create a new DWORD value with a name of ServerPriorityTimeLimit and set the value to 0 (that's a zero).

When you set ServerPriorityTimeLimit to 0, the server priorities are reset before the DNS Client service decides which DNS server to use. You must restart Windows for these changes to take affect. Any other value used in this field will cause the default behavior. Only values of 0 change the default behavior. All other values cause the default behavior.

FYI, to troubleshoot the Windows DNS Client, a.k.a. DNS Cache Service (dnscache), the best thing to do is enable logging, although be sure to disable it when done so the log doesn't suck up space. In Event Viewer, navigate to: Applications and Services Logs -> Microsoft -> Windows -> DNS Client Events -> Operational The log is Disabled by default, so don't forget to Enable it.

To put things in context, I had this issue with a dual-NIC system. One was directly connected to the Internet and the other connected to a VPN. The trick is to setup the VPN-accessible DNS servers on the VPN-connected NIC only, give the VPN-connected NIC a lower Metric (under IPv4 settings) than the Internet-connected NIC, but ensure that the Internet-connected default gateway has a lower metric than the VPN-connected default gateway, and finally, add static routes for the subnets you actually want to get to via the VPN so that it uses the VPN-connected NIC only for those subnets.