I'm trying to centralize the Hosts file onto a network hard disk for a group of computers at my work place. However, the HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DatabasePath registry item appears to be ignored by WIndows7. I need help to either fix or work around this problem.
So far, after hours of researching on the Internet, and experimentation on one Win7 machine (Home Ed.), I have come to a personal conclusion that Windows7 does not support the DatabasePath anymore, and the existence of DatabasePath is either a left-over or backward-compatibility for apps and programs. I have found on the Internet only one (ask&ans) post on Aug/24/2011 that directly asks about both Win7 and the fact that the DatabasePath registry value being ignored. So far, the poster is still waiting for an answer. (ref http://superuser.com/q/319949)
From the Internet, it seems that the problem with relocating the Hosts file happens mostly with Win7 (and works fine with WInXP), and any problems in the other Windows versions are mainly due to errors of some kind with either the registry's DatabasePath, or the Hosts file, or security authorization.
In my experiments, I used a temporary folder in my 'c' drive to hold the test Hosts file, and I verified the following points:
-My test Hosts file does work as I've copied and tested it in the \Windows\System32\drivers\etc folder.
-No matter what the HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DatabasePath is set to in the registry, Win7 will always read the Hosts file in c:\Windows\System32\drivers\etc even after a reboot or "ipconfig /flushdns."
-I could MOVE the \etc folder to the \Windows folder, set DatabasePath to c:\Windows\etc (or even %SystemRoot%\etc), reboot, and Win7 will still try to find 'Hosts' in c:\Windows\System32\drivers\etc, after which Win7 operates as if the Hosts file was empty. (After verifying that Win7 will not load the Hosts file from c:\Windows\etc, moving the \etc folder back to c:\Windows\System32\drivers, and either rebooting or issuing an "ipconfig /flushdns"--without changing the registry--will reload the Hosts file table properly.)
-On the chance a program was interfering, I did a clean boot (using msconfig to prevent loading all non-system programs at boot-up), and Win7 still tried to read a c:\Windows\System32\drivers\etc\hosts file when DatabasePath was pointed somewhere else.
-The registry really is case-INsensitive.
So far, after hours of researching on the Internet, and experimentation on one Win7 machine (Home Ed.), I have come to a personal conclusion that Windows7 does not support the DatabasePath anymore, and the existence of DatabasePath is either a left-over or backward-compatibility for apps and programs. I have found on the Internet only one (ask&ans) post on Aug/24/2011 that directly asks about both Win7 and the fact that the DatabasePath registry value being ignored. So far, the poster is still waiting for an answer. (ref http://superuser.com/q/319949)
From the Internet, it seems that the problem with relocating the Hosts file happens mostly with Win7 (and works fine with WInXP), and any problems in the other Windows versions are mainly due to errors of some kind with either the registry's DatabasePath, or the Hosts file, or security authorization.
In my experiments, I used a temporary folder in my 'c' drive to hold the test Hosts file, and I verified the following points:
-My test Hosts file does work as I've copied and tested it in the \Windows\System32\drivers\etc folder.
-No matter what the HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DatabasePath is set to in the registry, Win7 will always read the Hosts file in c:\Windows\System32\drivers\etc even after a reboot or "ipconfig /flushdns."
-I could MOVE the \etc folder to the \Windows folder, set DatabasePath to c:\Windows\etc (or even %SystemRoot%\etc), reboot, and Win7 will still try to find 'Hosts' in c:\Windows\System32\drivers\etc, after which Win7 operates as if the Hosts file was empty. (After verifying that Win7 will not load the Hosts file from c:\Windows\etc, moving the \etc folder back to c:\Windows\System32\drivers, and either rebooting or issuing an "ipconfig /flushdns"--without changing the registry--will reload the Hosts file table properly.)
-On the chance a program was interfering, I did a clean boot (using msconfig to prevent loading all non-system programs at boot-up), and Win7 still tried to read a c:\Windows\System32\drivers\etc\hosts file when DatabasePath was pointed somewhere else.
-The registry really is case-INsensitive.