Problem in working of 'hosts' file in win7

Hello;

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

cwstad2Commented:
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
0
McKnifeCommented:
"I open notepad as administrator" - you do that via rightclick on notepad.exe and selecting "run as administrator"? Then it would work.
0
jcimarronCommented:
MOSTAGHASSI--
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
http://www.addictivetips.com/windows-tips/windows-7-access-denied-permission-ownership/

Or add "Take Ownership" to the right click options
http://www.howtogeek.com/howto/windows-vista/add-take-ownership-to-explorer-right-click-menu-in-vista/

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
0

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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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.
0
McKnifeCommented:
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
test 127.0.0.1

Save it and ping test
Does that ping 127.0.0.1?
0
cwstad2Commented:
Please add content of your hosts file
0
MOSTAGHASSIAuthor Commented:
the result of ping test:

C:\Users\SunMedia>ping test

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

Ping statistics for 127.0.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0%
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
0
McKnifeCommented:
That works. Please describe what doesn't work and add the contents of your hostsfile.
0
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:

2.2.2.2      mydomain.com
2.2.2.2      www.mydomain.com

than i type mydomain.com in address bar so i expect that connect to 2.2.2.2 server but i connect to main server .
0
jcimarronCommented:
MOSTAGHASSI--
"and i right click on notepad for editing as administrator"

No, you click on HOSTS and run as Admin.

So  you were able add 2.2.2.2 my domain.com to your HOSTS file?

Have you looked into the other suggestions I made?  http:#a40858014
0
MOSTAGHASSIAuthor Commented:
jcimarron--

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

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

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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.