Host File in the Registry

G

Guest

Could someone please help me locate where the host file is in the registry.
I know where it is using Windows explorer but dont know how to translate
that to the registry.
 
C

Code-Curious Mom

Is this what you are looking for?
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath
 
G

Guest

I believe that is it. Now if I export that file using reg.exe would it give
me the contents of the host file? If not any idea on how I would do it by
using the registry not windows explorer.
 
C

Code-Curious Mom

The registry key gives the *location* of the hosts file, not it's entire
contents. You could use that location via commandline instead of the GUI,
but I don't think the actual contents of the hosts file is stored in the
registry.
 
T

Touch Base

| Could someone please help me locate where the host file is in the registry.
| I know where it is using Windows explorer but dont know how to translate
| that to the registry.
| --
| Ekka@DeeWhy


It's not in the registry...

you'll find it here.

C:\WINDOWS\system32\drivers\etc\HOSTS

open with Notepad or Wordpad
 
T

Tom Porterfield

Ekka said:
I believe that is it. Now if I export that file using reg.exe would it give
me the contents of the host file? If not any idea on how I would do it by
using the registry not windows explorer.

No, that registry key only tells the location of the hosts file. If you
want the contents you'll need to open the hosts file at that location
(%windir%\system32\drivers\etc\hosts) and read the contents. There is
no way to get the contents of a file on the hard drive via the registry
editor or reg.exe.
 
U

Uncle Grumpy

Ekka said:
Now if I export that file using reg.exe would it give
me the contents of the host file?

Opening the host file in any text editor will do that. That's the
only way.
 
K

Ken Blake, MVP

the hosts file is situated at C:\Windows\System32\drivers\etc and u can
modify it using "HostMan".


It's just a simple text file. You can easily modify it using notepad,
or any text editor. No special software is required for this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top