In ws2_32 getaddrinfo test one can see that localhost is not resolved properly from name to IP.
Problem consists of 3 problem places.
1. When dhcp client (dhcpcsvc) is writing registry values it does not update DhcpDomain in main tcp parameters key and interface key.
2. If code calls GetComputerNameEx (ComputerNameDnsDomain or ComputerNamePhysicalDnsDomain) then it receives only Domain registry value, but it should actually check also DhcpDomain value in tcp parameters. This function is used by GetNetworkParams called by adns.
3. GetNetworkParams should fill some more info (SearchList).
4. adns should use Domain returned by GetNetworkParams for searches.
5. adns should use SearchList for searches.