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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
Are you saving HOSTS after you make the changes?

It is the HOSTS folder you want to open as Administrator, not the Notepad.
You can change the permissions and ownership on the Security tad by following these instructions

Or add "Take Ownership" to the right click options

I assume you are editing the HOSTS file that is IN Windows: C:\Windows\System32\drivers\etc\hosts and not a copy of the HOSTS file you have created outside Windows: C:\Windows\System32\drivers\etc\hosts

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

MOSTAGHASSIAuthor Commented:
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
MOSTAGHASSIAuthor Commented:
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.
MOSTAGHASSIAuthor Commented:
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
MOSTAGHASSIAuthor Commented:

I right click on hosts file but there is not option 'open as administrator'.
NVITEnd-user supportCommented:
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.
MOSTAGHASSIAuthor Commented:

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

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?
MOSTAGHASSIAuthor Commented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.