Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: HOSTS file

27 Sep 2010   #1

windows 7
HOSTS file

I setup a hosts file in windows xp in order to use my website locally using the exact domain name by editing the hosts file by adding the line:

This should resolve my local ip address for the site and if apache is running, then it should load the website into my browser. I edited the file using a web document editor that is run as the administrator and i edited the file in the c:\windows\system32\drivers\etc and i saved it with no problem. The thing is that if i try and open my domain name in my browser, it says that the webpage cannot be displayed. I know from installing my apache that windows has two versions of file in the program files and if you save it, then instead of saving it to the program files folder, it instead saves it to c:\users\username\appdata\localstore.... which caused mw quite a lot of frustration. Has anyone had any success with doing this in windows 7?

My System SpecsSystem Spec
30 Sep 2010   #2

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)

So the host file is on the XP machine with apache running?? Or is apache running on another machine??

It would be best to just use the address of the machine that has the web site on it. So if say is where apache is then edit your host file with that IP address. You can do that in all the internal machines so they will stay on the local network and not access the internet.

On the web server (apache) machine type ipconfig in a command prompt to get the IP address.
My System SpecsSystem Spec
03 Oct 2010   #3
Bare Foot Kid
Microsoft MVP

W 7 64-bit Ultimate

My System SpecsSystem Spec


 HOSTS file

Thread Tools

Similar help and support threads
Thread Forum
Problem modifying hosts file, change file permissions?
Hi all,win7 Home Premium 64 bit. I'm having difficulties modifying my hosts file. Following guidance from this forum, I open Notepad++ as administrator & can navigate to and open the hosts file. But the "Save" option is greyed out, so I can't save directly to the original location. I can Save As...
General Discussion
Hosts file ignored and replaced with hosts.original
Hello. I am trying to use the hosts file. However both pings and web addresses still bypass the hosts file. I noticed that there is another file in the C:\Windows\System32\drivers\etc directory called 'hosts.original'. When ever I delete this file, it reappears seconds later. I have made sure that...
General Discussion
HOSTS File - Create a "Edit HOSTS file" Shortcut
How to Create a "Edit HOSTS file" Shortcut in Windows 7 and Vista The HOSTS file is a .txt file used in Vista and Windows 7 to map hostnames to IP addresses. Your computer checks this file first to resolve any network names to its corresponding IP address before it tries to check the Internet....

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 06:42.
Twitter Facebook Google+