Add a Host Entry

A Host Entry can be added when you want your domain to resolve to our server locally (on your own computer only) while the real domain is still pointed elsewhere. 

The way to add a Host Entry differs on each computer Operating System. 



Windows

Use a text editor like Notepad (with Administrator priviledge) to open the file below:-
====
C:\WINDOWS\system32\drivers\etc\hosts
====

Add your domain with the following format:-
====
xxx.xxx.xxx.xxx yourdomain.com www.yourdomain.com
====

Where xxx.xxx.xxx.xxx is the Shared or Dedicated IP for your hosting account. 

Save the file and make sure Notepad does not add any extension to the file (like .txt). 



Mac OS X

Open Terminal.app by going to Applications -> Utilities -> Terminal.

Enter the following command:-
====
nano /private/etc/hosts
====

Add your domain with the following format:-
====
xxx.xxx.xxx.xxx yourdomain.com www.yourdomain.com
====

Where xxx.xxx.xxx.xxx is the Shared or Dedicated IP for your hosting account. 

Press control-o to save the file. Press enter on the filename prompt, and control-x to exit the editor.

OR

Go to Finder, and in the Finder menu bar select Go => Go to Folder
Type the following; /private/etc/hosts
Right click on the hosts file, and select to edit the file with the text editor
Edit the file and don't forget to save the changes. 

If you are unable to edit the file directly at the current location, drag the hosts file to your desktop and edit the file. Once done, remember to drag the hosts file back. 

In order to reload the DNS cache, open Terminal and type the following command: 

On OSX Lion or Mountain Lion;
====
sudo killall -HUP mDNSResponder
====

OSX 10.6;
==== 
sudo dscacheutil -flushcache
====

Ubuntu Linux

Use a text editor (with sudo) to open the file below:-
====
/etc/hosts
====

Add your domain with the following format:-
====
xxx.xxx.xxx.xxx yourdomain.com www.yourdomain.com
====

Where xxx.xxx.xxx.xxx is the Shared or Dedicated IP for your hosting account. 

Save the file. 

Was this answer helpful?

 Print this Article

Also Read

Performing a Trace Route

Windows:1.) Click the start menu and choose or type run then hit enter.2.) In the box that pops...