How do I edit my hosts file?

G

Guest

I'm in the process of developing a website for someone and their server admin
has told me to edit my hosts file in c:\windows\system32\drivers\etc to
include the ip and domain for the website I'm working on... problem is when I
open the hosts file in wordpad, I can edit it, but then it won't let me
overwrite the original file. It will only let me save it as a text file.
Anybody know how to fix this?
 
D

David H. Lipman

Easy, don't use Wordpad which is an editor but NOT an ASCII editor. Use; notepad.exe
Here is the command line to do it or make a ShortCut from it...

notepad %windir%\system32\drivers\etc\hosts

Dave



| I'm in the process of developing a website for someone and their server admin
| has told me to edit my hosts file in c:\windows\system32\drivers\etc to
| include the ip and domain for the website I'm working on... problem is when I
| open the hosts file in wordpad, I can edit it, but then it won't let me
| overwrite the original file. It will only let me save it as a text file.
| Anybody know how to fix this?
 
M

MikeVa [MSFT]

You DO want to save it as a text file.
It's possible the file might be marked Read-Only

Here's what I would recommend:
1. open a command prompt.
2. cd /d %SystemRoot%\System32\Drivers\etc
3. attrib hosts -R
4. notepad hosts
5. -- add your ipaddres and its fqdn --
6. save the file

If this fails, make sure you have the necessary NTFS permissions to modify
the file.

--
MikeVa [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
G

Guest

Wow, I really appreciate the quick response, but I'm afraid the explanation
is a little over my head... can you elaborate a little further... how do I
open a command prompt?

MikeVa said:
You DO want to save it as a text file.
It's possible the file might be marked Read-Only

Here's what I would recommend:
1. open a command prompt.
2. cd /d %SystemRoot%\System32\Drivers\etc
3. attrib hosts -R
4. notepad hosts
5. -- add your ipaddres and its fqdn --
6. save the file

If this fails, make sure you have the necessary NTFS permissions to modify
the file.

--
MikeVa [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--
Please do not send e-mail directly to this alias.
This alias is for newsgroup purposes only.
--
Troy said:
I'm in the process of developing a website for someone and their server
admin
has told me to edit my hosts file in c:\windows\system32\drivers\etc to
include the ip and domain for the website I'm working on... problem is
when I
open the hosts file in wordpad, I can edit it, but then it won't let me
overwrite the original file. It will only let me save it as a text file.
Anybody know how to fix this?
 
D

Dave Patrick

Start|Run|cmd.exe

or easier yet David's command;

Start|Run|notepad %windir%\system32\drivers\etc\hosts


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Wow, I really appreciate the quick response, but I'm afraid the
explanation
| is a little over my head... can you elaborate a little further... how do I
| open a command prompt?
 
D

David H. Lipman

Are you joking ?
What are doing then -- "...developing a website for someone and their server admin..."

Leave it for someone who has the knowledge !

Dave




| Wow, I really appreciate the quick response, but I'm afraid the explanation
| is a little over my head... can you elaborate a little further... how do I
| open a command prompt?
|
| "MikeVa [MSFT]" wrote:
|
| > You DO want to save it as a text file.
| > It's possible the file might be marked Read-Only
| >
| > Here's what I would recommend:
| > 1. open a command prompt.
| > 2. cd /d %SystemRoot%\System32\Drivers\etc
| > 3. attrib hosts -R
| > 4. notepad hosts
| > 5. -- add your ipaddres and its fqdn --
| > 6. save the file
| >
| > If this fails, make sure you have the necessary NTFS permissions to modify
| > the file.
| >
| > --
| > MikeVa [MSFT]
| >
| > This posting is provided "AS IS" with no warranties, and confers no rights.
| > Use of any included script samples are subject to the terms specified at
| > http://www.microsoft.com/info/cpyright.htm
| > --
| > Please do not send e-mail directly to this alias.
| > This alias is for newsgroup purposes only.
| > --
| > | > > I'm in the process of developing a website for someone and their server
| > > admin
| > > has told me to edit my hosts file in c:\windows\system32\drivers\etc to
| > > include the ip and domain for the website I'm working on... problem is
| > > when I
| > > open the hosts file in wordpad, I can edit it, but then it won't let me
| > > overwrite the original file. It will only let me save it as a text file.
| > > Anybody know how to fix this?
| >
| >
| >
 
B

Bruce Chambers

Edit it with NotePad (*NOT* WordPad), and save it.

--

Bruce Chambers

Help us help you:



You can have peace. Or you can have freedom. Don't ever count on
having both at once. - RAH
 
B

Bruce Chambers

Actually, he does and he doesn't. The file does need to be saved
in plain text format, but it mustn't have any extension (such as
..txt), which is what WordPad is trying to automatically append.

--

Bruce Chambers

Help us help you:



You can have peace. Or you can have freedom. Don't ever count on
having both at once. - RAH
 
M

Matt Anderson

David H. Lipman said:
Are you joking ?
What are doing then -- "...developing a website for someone and their
server admin..."

Leave it for someone who has the knowledge !

Dave
Just becasue he's not an SE doesn't mean he's not qualified for web design.

Matt
MCT, MCSE
 
D

David H. Lipman

I never mentioned anything about "qualification".
However, there is a minimum level of knowledge to perform software work on a computer.
This is not brain surgery yet it is "NT based OS 100." In other words it is basic knowledge the OP should already have.

C'mon, the following is NOT what you want to hear from *anyone*, " ....developing a website for someone and their server admin... "

" ...but I'm afraid the explanation is a little over my head... can you elaborate a little further... how do I open a command prompt? "

Those are the OP's words, not mine.

Dave





|
| | > Are you joking ?
| > What are doing then -- "...developing a website for someone and their
| > server admin..."
| >
| > Leave it for someone who has the knowledge !
| >
| > Dave
| >
| Just becasue he's not an SE doesn't mean he's not qualified for web design.
|
| Matt
| MCT, MCSE
|
|
 
M

Matt Anderson

I never mentioned anything about "qualification".
However, there is a minimum level of knowledge to perform software work on a
computer.
------

This is a newsgroup, post in plain text.... for someone who is bashing
someone else you should get it together.

Look, I don't know how to do any work on my car, but I can drive it down to
road... Just because someone doesn't know how to open a command prompt
doesn't mean they can't drive the computer.

Matt
MCT, MCSE
 
D

David H. Lipman

While the driver doesn't need to know how to dismantle and rebuild a carburetor, he has to
know how to check the air in the tires, or change them if they go flat. I think opening a
Command Prompt is synonymous to checking the air in one's tires. It is basic knowledge.
but then again, he is not just a mere driver. The OP indicated he is "...developing a
website for someone and their server admin...". that's more like the technician at a Jiffy
Lube which again requires a minimum level of knowledge and is certainly more than what is
needed to just drive the car.

Dave
BTW: Can you point me to the Microsoft URL that states that posts can not be made on their
server in HTML ?



|
| | I never mentioned anything about "qualification".
| However, there is a minimum level of knowledge to perform software work on a
| computer.
| ------
|
| This is a newsgroup, post in plain text.... for someone who is bashing
| someone else you should get it together.
|
| Look, I don't know how to do any work on my car, but I can drive it down to
| road... Just because someone doesn't know how to open a command prompt
| doesn't mean they can't drive the computer.
|
| Matt
| MCT, MCSE
|
|
 
M

Matt Anderson

David H. Lipman said:
Dave
BTW: Can you point me to the Microsoft URL that states that posts can not
be made on their
server in HTML ?
Never meant cannot, just standard usenet courtesy.

Matt
 
E

Enkidu

I'm in the process of developing a website for someone and their server admin
has told me to edit my hosts file in c:\windows\system32\drivers\etc to
include the ip and domain for the website I'm working on... problem is when I
open the hosts file in wordpad, I can edit it, but then it won't let me
overwrite the original file. It will only let me save it as a text file.
Anybody know how to fix this?
Do you mean that it saves it as "hosts.txt"?

Try "Save As" and put "hosts" in quotes as the filename.

Or save as "hosts.txt", delete the old one and rename it.

Cheers,

Cliff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top