Editing local hosts file on PC

A good cheat for viewing a website before it is live on a server is to add an entry to your Host file on your PC. This file bypasses the DNS so you can view the site whilst it's still in development.


On Windows

1. Open Notepad with Administrative privileges by clicking Start, All Programs, Accessories, and then right-click Notepad and select to run as Administrator.

 

2. Now that Notepad is open with Administrative privileges click the File menu then click Open

 

3. Browse to (C:\Windows\System32\drivers\etc)

 

4. Then click show all files in bottom right drop down.

 

5. Open the hosts file.

 

6. You can edit the file by placing your IP and host below the last line and save the file.

 

7. Now you can test your sites as if they were live. If you clear your browser cache and browse to the domain. You may need to clear your browser cache if you still see the old site. 

Note: To go back to using the public DNS you need to revert the changes made to your local host file. To do this, do the exact same steps above, but remove the new entries you made, then save as detailed in step 6. You may need to clear your browser cache once again not ensure everything is fresh. 

NB: If you entered www.example.com in your host file, you'll need to browse to www.example.com.
Example.com would still show the current live site unless you also place this in the hosts file.

Was this answer helpful?

 Print this Article

Also Read

SSL Warning from Google/Webtools

I’ve had an SSL Warning from Google/Webtools: Googlebot noticed your site uses an SSL certificate...

Edit DNS Records on our Nameservers

You will first need to add the domain to our nameservers by following step 3 in the guide here:...

Pointing a domain to your server

To get your domain hosting up and running you will need to add a DNS entry onto our Name...

NOC - Emergency Out of Hours Service

Nimbus have an emergency out of hours service for if your server goes down outside of our...

Repair a MySQL database table

Occassionally you may get a database error that requires a repair to one of your database tables....