We host our application in two data centers. During a production update, we point the customer traffic to datacenter1 and test the update by adding datacenter2 IP in our hosts file, where the update is being done to our domain name. This has been working fine until windows 10. ping returns the datacenter2 IP but not nslookup. Is there a configuration/registry to change the order of dns servers to first look at the hosts file?
I researched several posts like hosts file ignored, how to troubleshoot?, Nslookup not using hosts file, HOSTS file being ignored, etc. but to no avail. Among other things, I tried recreating hosts file with no extension, in the format "<space/tab>".
Any help is greatly appreciated.
hostsfile at all. This is not a new behavior in Windows 10, this is how it always worked. – Massimo Feb 15 '21 at 20:33nslookupuses DNS, not the hosts file. Ifnslookupis needed for your update solution, set up a simple DNS server (e.g.dnsmasqon a Linux VM; but easy to use solutions must exist on Windows) and point the PCs to it. – berndbausch Feb 15 '21 at 20:35hostsfile. You have simply been using the wrong tool for your testing. – Massimo Feb 15 '21 at 20:38nslookup(which would not be a good idea, but well...). – berndbausch Feb 15 '21 at 20:40hostsfile: using a web proxy. That would also completely bypass DNS lookup on the client machine. – Massimo Feb 15 '21 at 20:57