Windows 10 Wifi Sets Wrong DNS Server When Connecting to Wifi Networks
This is an older question but I just wanted to add my answer here because this question came up when I was searching for an answer and it pointed me in the right direction.
If your nameservers point to something that you once manually entered in the TCP/IP properties, this setting is cached in the registry under
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces\{*interface-UUID*}\ProfileNameServer
where {*interface-UUID*}
is a unique ID that is assigned to the different interfaces on the local machine. ProfileNameServer
is a REG_SZ string that contains a space-separated list of IP addresses of the nameservers to use. This appears to override the DhcpNameServer string, which is of the same format.
I cleared the ProfileNameServer
string and the interface in question used what was in DhcpNameServer instead, which solved my issue.
Frustrated, I decided to try uninstalling/reinstalling the Wifi driver. Did by:
Pre-downloaded the network driver from the Drivers page of my laptop maker (Lenovo), or having an alternative way to access the Internet such as tethering through my phone, so I could download the driver.
Device Manager, Network Adapters, right-click the wifi device, Uninstall Driver.
Used the downloaded driver from my laptop manufacturer, re-installed, rebooted. Now the Wifi DNS works fine wherever I go.
I tested at 2 wifi locations (coffee shops) so far, works fine now.
Note that some public Wifi networks at coffee shops & libraries have what's called a "Captive Portal" which requires use of the DNS supplied via DHCP. They will not work with a public DNS or fixed DNS locked in to the Wifi interface. At such locations, new devices that join the Wifi network are redirected to a page to accept the Terms & Conditions (or log in) before being granted access to the Internet. This is why my Wifi stopped working at coffee shops, and would not help to use a fixed DNS like 8.8.8.8.