Link to home
Start Free TrialLog in
MOSTAGHASSIFlag for United States of America

asked on

Problem in working of 'hosts' file in win7


I want to edit 'hosts' file in Windows: C:\Windows\System32\drivers\etc\hosts and i do as this below but it doesn't work,where is the problem?

-I open notepad as administrator and edit the 'hosts' file but it doesnt work.

I have checked the properties of hosts file and in security section->permissions of users the section 'allow'  all check marked but ,
read &execute  and  read  are gray.
Avatar of cwstad2
Flag of United Kingdom of Great Britain and Northern Ireland image

i usually edit it and save it to a different location. Rename the original then copy the newly edited one to the original hosts location
"I open notepad as administrator" - you do that via rightclick on notepad.exe and selecting "run as administrator"? Then it would work.
Avatar of jcimarron
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial


I save it correctly ,and i right click on notepad for editing as administrator.

I get ping from my IP and it is ok ,but in browser cannot see the site,it connect to main server which is running now.
So it saves? Saving is not the problem, it only doesn't get used somehow?
Ok, I got that wrong.

You write "I get ping from my IP" - what does that mean?
Please do add a line to your hosts

Save it and ping test
Does that ping
Please add content of your hosts file
the result of ping test:

C:\Users\SunMedia>ping test

Pinging test [] with 32 bytes of data:
Reply from bytes=32 time<1ms TTL=128
Reply from bytes=32 time<1ms TTL=128
Reply from bytes=32 time<1ms TTL=128
Reply from bytes=32 time<1ms TTL=128

Ping statistics for
    Packets: Sent = 4, Received = 4, Lost = 0 (0%
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
That works. Please describe what doesn't work and add the contents of your hostsfile.
When i type the address of domain that i have mapped in hosts file in address bar then i connect to main server which is running now.

this is as example
i add 2 lines as below to hosts file:

than i type in address bar so i expect that connect to server but i connect to main server .
"and i right click on notepad for editing as administrator"

No, you click on HOSTS and run as Admin.

So  you were able add my to your HOSTS file?

Have you looked into the other suggestions I made?  http:#a40858014

I right click on hosts file but there is not option 'open as administrator'.
Another way to run notepad as administrator...

Pick Start.
Type notepad.
Right-click the notepad program and pick run as administrator
After notepad opens, drop your hosts file onto the open notepad.

I read your links,first link is ok on my pc,and second link i cannt see any file for downloading.

I could find the zip file(Takeownership) but i fear that after installing it stop my pc,are you sure that it is ok ?
What was your problem? You were able to edit the hosts file before, so why did you select that solution?
Editing was ok but because i didn't had permission it doesn't work.
What does that mean? When you can save it, the job is done. Changing ownership does not change anything, then.