none
Ignored (Hosts/TCP/IP) DatabasePath registry value. (answers & discussion welcomed)

    Question

  • 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 Windows 7. I need help to either fix or work around this problem. (Though I'm seeking an answer, I don't mind a civil discussion as well.)

    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 Win7 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 a (ask&ans) post on Aug/7/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.
    • -Disabling IPv6 (in both the registry and network adapter settings) does not have any effect/change of how Win7 finds the Hosts file.


    Creating DNS server is not a feasible solution for my work place. If I can't find a way to make the registry value to work, then I would either have to see if Microsoft SyncToy can help as a work-around, or give up on this project and manual update each machine's Hosts file.

    ------------
    Pete-ohki


    • Edited by Pete-ohki Thursday, October 13, 2011 9:14 PM
    Thursday, October 13, 2011 9:00 PM

Answers

  • Hi,

    After researching on this, I found that Windows 7 does not support moving hosts file to the other place. You may refer to the following link to use script to copy hosts file to etc folder.

    http://www.techimo.com/forum/networking-internet/108391-using-hosts-file-across-network.html

    Important Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    • Marked as answer by Pete-ohki Tuesday, October 18, 2011 7:41 AM
    Monday, October 17, 2011 8:48 AM
    Moderator

All replies

  • Hi,

    After researching on this, I found that Windows 7 does not support moving hosts file to the other place. You may refer to the following link to use script to copy hosts file to etc folder.

    http://www.techimo.com/forum/networking-internet/108391-using-hosts-file-across-network.html

    Important Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    • Marked as answer by Pete-ohki Tuesday, October 18, 2011 7:41 AM
    Monday, October 17, 2011 8:48 AM
    Moderator
  • Thanks!

    I was afraid that was such the case. Unfortunately, I'm not too familiar with scripting to understand how I would used it (based on the example given), or how it may be automated for Windows. The batch file I will probably make if I need to resort to manual updating the Hosts file. For now, I'll just investage how MS SyncToy may help.


    Pete-ohki
    Tuesday, October 18, 2011 7:50 AM