Windows remembers old DNS suffix

dhcpwindows

I just changed the DNS domain of my local network from home.local to mydomain.local, after purchasing mydomain.com. I made all the necessary changes in my BIND and DHCP server, and linux clients on the network now have domain mydomain.local in their /etc/resolv.conf and seem to be working as expected.

However, Windows machines (Win 8.1, not joined to a domain) still seem to hang on to the home.local domain in it's DNS Suffix Search List. I have released my lease, removed network profiles, scanned the registry, grep:ed the entire dns/dhcp server for occurences of the old domain, rebooted everything… Still, the windows machines keep searching home.local.

Output from ipconfig /all on an affected machine:

Windows IP Configuration

  Host Name . . . . . . . . . . . . : MY-MACHINE
  Primary Dns Suffix  . . . . . . . :
  Node Type . . . . . . . . . . . . : Hybrid
  IP Routing Enabled. . . . . . . . : No
  WINS Proxy Enabled. . . . . . . . : No
  DNS Suffix Search List. . . . . . : home.local

Ethernet adapter Ethernet:

  Connection-specific DNS Suffix  . : mydomain.local
  Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
  Physical Address. . . . . . . . . : 00-11-22-33-44-55
  DHCP Enabled. . . . . . . . . . . : Yes
  Autoconfiguration Enabled . . . . : Yes
  Link-local IPv6 Address . . . . . : fe80::1234:1234:1234:1234%3(Preferred)
  IPv4 Address. . . . . . . . . . . : 192.168.0.97(Preferred)
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Lease Obtained. . . . . . . . . . : den 24 januari 2015 19:42:25
  Lease Expires . . . . . . . . . . : den 25 januari 2015 19:43:27
  Default Gateway . . . . . . . . . : fe80::1111:2222:3333:4444%3
                                      192.168.0.1
  DHCP Server . . . . . . . . . . . : 192.168.0.10
  DHCPv6 IAID . . . . . . . . . . . : 12312312
  DHCPv6 Client DUID. . . . . . . . : 00-11-22-33-44-55-66-77-88-99-AA-BB-CC-DD

  DNS Servers . . . . . . . . . . . : 192.168.0.10
  NetBIOS over Tcpip. . . . . . . . : Enabled
  Connection-specific DNS Suffix Search List :
                                      home.local

EDIT

Note that the connection-specific DNS suffix is correct, but the suffix search list is wrong, both connection specific and general IP configuration.

The WMI queries show the same – the suffix for the connection is correct, but it is not added to the search list, which instead seems to reuse the same suffix as previously. Possibly it remembers this based on the server being the same?

Best Answer

Sounds like DNS caching issue. To resolve this, run cmd as administrator and perform

ipconfig /flushdns

or even (although the /allcompartments switch could seem to be superabundant)

ipconfig /allcompartments /flushdns

Further hints: ipconfig /?

Clearing the ARP cache might help as well:

arp -d

Edit according to what others advise: Group policy DNS Suffix Search List could be found as value SearchList in next registry key:

HKLM\Software\Policies\Microsoft\Windows NT\DNSClient

Edit 2 what output from next CLI commands? Is there listed unwanted DNS suffix?

wmic path Win32_NetworkAdapterConfiguration get caption, DNSDomainSuffixSearchOrder
wmic path Win32_NetworkAdapterConfiguration get caption, DNSDomain

Edit 3 Check values NameServer and SearchList in next registry key:

 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

and under next registry keys (i.e. in each interface-related subkey):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters\Interfaces

To put changes in validity: restart computer.


Edit 4 Check all NameServerList value of REG_MULTI_SZ type in all keys of next pattern

HKLM\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces\Tcpip_{interface_CLSID}

Next PowerShell code should set the DNS suffix search order. Stolen here as I'm not well-skilled in PS.

#First store the suffixes to set in a variable
$suffixes = 'mydomain.local'

#Since this is a static method, get a class object and then call the method. 
$class = [wmiclass]'Win32_NetworkAdapterConfiguration'
$class.SetDNSSuffixSearchOrder($suffixes)

As the last resort: disable system restore, restart, check wmic mentioned above...

Related Question