I’ve set the
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DatabasePath registry entry in Windows XP and it works as expected; the system loads and uses the HOSTS file in the directory I’ve pointed it to.
However, in Windows 7, it seems to ignore the entry, but I can find no information relating that it is not supported and/or an alternative way to relocate the HOSTS file in Windows 7. I have confirmed that it is still using the default path (
%systemroot%\system32\drivers\etc) by renaming
HOSTS to disable it, and renaming it back to re-enable it.
(Yes, I have made sure the directory is correct, made sure it does not include the filename, and made sure that the datatype is correct.(