Windows 10 WiFi ignoring DHCP DNS settings

After a long period of home office it seemed that my computer did not want to work well in any other WiFi network any more. It showed “no internet connection” in every other network.

When looking into the connection settings, I saw that it was still showing my home DNS server in the settings. No matter what network I was connecting to, be it my phones hot spot, etc still the same.
Example output of the netsh command:

C:\WINDOWS\system32>netsh interface ipv4 show config name=”Wi-Fi”

Configuration for interface "Wi-Fi"
DHCP enabled: Yes
IP Address: 10.1.0.38
Subnet Prefix: 10.1.0.0/24 (mask 255.255.255.0)
Default Gateway: 10.1.0.1
Gateway Metric: 0
InterfaceMetric: 70
DNS servers configured through DHCP: 172.31.1.1
Register with which suffix: Primary only
WINS servers configured through DHCP: None

So I tried using the “netsh” command to reset it by entering a static DNS:
netsh interface ipv4 set dnsservers name="Wi-Fi" source=static address=8.8.8.8

Now I had working name resolution, but this is not a fix for me to have to set a correct DNS server for all the networks I go to, so I set it to DHCP settings again.
netsh interface ipv4 set dnsservers name="Wi-Fi" source=dhcp

Name resolution broke again, as the “show config” returned my home DNS again.. So I turned to the Windows registry to find where that IP address exists. Find yielded the following result. In Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces\{interface-uid} there was a registry key called ProfileNameServer. It had a value that matched my problematic DNS server entry. After deleting registry key and reconnecting to the WiFi I finally saw that the DHCP given DNS server list was being used and network connection was working normally again.

7 Comments

  1. THANK YOU SO MUCH!
    I have been trying to a few days now to get my dns server setup working properly. Kept trying to fix dnsmasq settings on the server. Should have known it was Win10 all along. I would guess this happens whenever you set a static dns, and it doesn’t get properly cleaned up when you select automatic again later… Typical M$

  2. Thanks a million, I was really lost when my work computer at home was not taking the correct DNS adress from the DHCP…
    After a quick search on my best friend google, here i am and BAM now it works !
    Greetings from France 🙂

  3. THANK YOU! This is the only place I’ve been able to find this fix. Happened to me on Windows 11 preview. Worked great.

  4. Stef Nighthawk

    January 12, 2022 at 11:39

    Had the same issue this morning.
    There was a weird character in the NameServer key that prevented the key to be updated by DHCP. After removing the erroneous entry it got fixed.
    Thanks for showing us the registry path.

  5. Mike Rogerson

    August 16, 2022 at 17:10

    You are a genius!

    I’d already figured out the DHCP DNS was wrong and used Google’s to make a temporary fix.
    What I never considered was the registry was holding these duff ip addresses.

    Keep up the amazing work

  6. Worked for me! Although, ultimately found 4 instances, so probably best to use search to catch them all.

Leave a Reply

Your email address will not be published. Required fields are marked *