Host File in the Registry

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
Is this what you are looking for?
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath
 
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.
 
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.
 
| 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
 
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.
 
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.
 
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.
 
Back
Top