How to Edit Hosts File on Windows

To edit the hosts file no a Windows computer, you would need to open the file C:WindowsSystem32driversetchosts as an Administrator.


  1. Go to the Start menu > Programs > Accessories and locate Notepad.
  2. Right click on Notepad and click on Run as Administrator
  3. Press Ctrl + O and enter "C:WindowsSystem32driversetc", and this should take you to an empty folder
  4. Type in the word hosts and click Open
  5. Go ahead and make the updates that you need and then Save & Exit.
  1. What is a Hostname? - Click to read more.
  2. The Hosts File and What It Can Do For You - Click to read more.
  3. How to Edit Hosts File on Mac - Click to read more.
  4. Need to Migrate a Website? Contact my web development agency and we'll be more than happy to do it for you.
  5. Need a New Web Host? Sign up with Groove Host—my clients have experienced significantly faster web page load times after moving over.


>>YAN HUANG: How do you change the hosts files -- edit the hosts files -- on Windows?

Basically, the file is located under your system root:

system 32driversetc, and the filename is hosts.

But don’t try to navigate there, because it’s a hidden file, so

you won’t find anything if you actually try to go there by clicking.

What you have to do have to open Notepad.

You can’t just open it normally.

You have to go to your Start menu, navigate to Notepad, right-click on Notepad, and

click on “Run as administrator.”

If you don’t do this, you won’t be able to edit the file.

So, after you click on “Run as administrator,” it’s going to prompt you ---

it’s going to ask you...are you sure.

Go ahead and click Yes.

Now go ahead and go to your file,


and navigate to your system root.

I’ll provide the actual path for you in the link below this video, so

go ahead and click on that link.

Then you can just copy and paste the exact path.

But it’s basically under your system root:

system 32driversetc

Then, once you’re in the etc folder,

you actually have to type in the word, “hosts”.

Then, it won’t show anything in the actual box because it’s a hidden file,

unless you’ve enabled hidden files, which -- it doesn’t come by default on Windows.

So after you’ve typed that in, go ahead and press Open,


and then you’ll see the hosts file.

What you will want to do will want to add the IP address, and also the hostname,

which is also, for the most part, in the context of the Internet,

will be the domain name.

If the IP address is...whatever [laughs], and then

the domain name is,

then you would type that --


Also, make sure you enter a new line, whatever IP address,


That way...because a lot of websites, they have links that will send you to www version,

and other links that will send you to normal version.

You want to make sure you cover both of them.

That’s basically in a nutshell how you would change the IP or

edit the hosts files on a Windows.

To make sure that’s working, you can just go on your new Web host,

if you’re doing a website migration --

go to the new Web host and upload, like, a file, like a test.html file.

You know, just put in “test” in it.

Go to your browser, type in

If it shows up, that means you did it properly.

If it doesn’t show up, that means it’s probably still pointing to your old Web host.

Hopefully, you found this helpful. If you did, please leave a comment here and like this video.

Go to my blog,, Like me on Facebook, follow me on Twitter,

1+ my Google+, and subscribe to my mailing list.

Make sure you subscribe to my mailing list!
This entry was posted in . Bookmark the permalink.

Leave a Reply