Testing With the Hosts File

You may want to view your domain before the DNS changes propagate or you are testing your domain before you point your domain name to us. You can achieve this by editing the hosts file on your computer. To edit your hosts file on either Windows 7 / Vista, Windows 10, Mac OS X and Unix based systems, follow the respective instructions. * * * ## Windows 7 and Vista Browse to '**Start**' -> '**All Programs**' -> '**Accessories**'. ![alt text](https://i.imgur.com/pFsrJgO.jpg "Host files 1") * * * Right mouse click '**Notepad**' and select '**Run as Administrator**'. ![alt text](https://i.imgur.com/gNp6jMT.jpg "Host files 2") * * * Click '**File**' -> **'Open**'. ![alt text](https://i.imgur.com/HWU7dp9.jpg "Host files 3") * * * Browse to '**C:**' -> '**Windows**' -> '**System32**' -> '**Drivers**' -> '**etc**'. ![alt text](https://i.imgur.com/uuhkGjq.jpg "Host files 4") * * * Change the file down file menu from '**Text Documents (*.txt)**' to '**All Files (*.*)**'. ![alt text](https://i.imgur.com/n9DZGPn.jpg "Host files 5") * * * Select '**hosts**' and click '**Open**'. ![alt text](https://i.imgur.com/P2iLiCw.jpg "Host files 6") * * * In your hosts file, you may already see a line as such: > 127.0.0.1 localhost What you would need to do is add a line at the end of your hosts file with the server IP that we have provided you (replacing IPADDRESS shown below) along with your actual domain name. ```127.0.0.1 localhost``` ```IPADDRESS www.your-domain.com``` ![alt text](https://i.imgur.com/8cESsPt.jpg "Host files 7") Please check that the line you've written does not start with a hash character '**#**' character because this will not work. * * * Close Notepad and '**Save**' the changes when prompted. ![alt text](https://i.imgur.com/bpUhrrl.jpg "Host files 8") Ensuring that all web browser windows have been closed, if you now visit the domain that you specified, you should find that it loads from the specified IP address. * * * ## Windows 10 On Windows 10, to edit the hosts file, navigate to '**C:\Windows\System32\Drivers\etc**'. Copy the '**hosts**' file onto your Desktop. ![alt text](https://i.imgur.com/b7YPcTc.png "Host files 9") * * * Right mouse click the copied file and choose '**Open with**. ![alt text](https://i.imgur.com/vLErdfG.png "Host files 10") * * * Select '**Notepad**' as the chosen application. ![alt text](https://i.imgur.com/sTsHFXl.png "Host files 11") * * * Append your new mappings at the bottom of the document (replacing IPADDRESS with the server IP address) in this format: ``` IPADDRESS www.your-domain.com``` ![alt text](https://i.imgur.com/VIQcLtc.png "Host files 12") From the Notepad menu, choose '**File**' > '**Save**'. * * * Next, move the copy and paste the file to its original location. ![alt text](https://i.imgur.com/Sa6OyVi.png "Host files 13") * * * You will be asked if you want to overwrite the file. Choose '**Replace the file in the destination**'. ![alt text](https://i.imgur.com/UUMdXyW.png "Host files 14") * * * Windows will ask for Administrator permissions. Click '**Continue**'. ![alt text](https://i.imgur.com/RCcD1tk.png "Host files 15") Ensuring that all web browser windows have been closed, if you now visit the domain that you specified, you should find that it loads from the specified IP address. *** ## Mac OS X Head into your launchpad and search at the top '**terminal**'. ![alt text](https://i.imgur.com/uCuVXku.png "Host files 16") * * * Once the Terminal application loads, open the hosts by typing on the Terminal that you have just opened by typing the following followed by enter: ``` sudo nano /private/etc/hosts``` ![alt text](https://i.imgur.com/eXlnGYe.jpg "Host files 17") * * * Type your Mac OS X user account password when prompted and press enter. ![alt text](https://i.imgur.com/tYOiOCS.jpg "Host files 18") Ensuring that all web browser windows have been closed, if you now visit the domain that you specified, you should find that it loads from the specified IP address. * * * Append your new mappings at the bottom of the document (replacing IPADDRESS with the server IP address). You can navigate the file using the arrow keys. ``` IPADDRESS www.your-domain.com``` ![alt text](https://i.imgur.com/EoePXLW.jpg "Host files 19") * * * Press **control-o** to save the file. Press **enter** on the filename prompt, and **control-x** to exit the editor. ![alt text](https://i.imgur.com/36m9pm5.jpg "Host files 20") * * * ## UNIX On Unix-based systems You can find the hosts file at **/etc/hosts**. You will need to open the terminal (on most distributions is located at the following): '**Menu**' > '**Applications**' > '**Accessories**' > '**Terminal**'. Open the hosts by typing on the Terminal that you have just opened by typing: ``` sudo nano /private/etc/hosts``` Type your system user account password when prompted. Append your new mappings at the bottom of the document (replacing IPADDRESS with the server IP address). You can navigate the file using the arrow keys. ```IPADDRESS www.your-domain.com``` ![alt text](https://i.imgur.com/EoePXLW.jpg "Host files 21") Press **control-o** to save the file. Press **enter** on the filename prompt, and **control-x** to exit the editor. Ensuring that all web browser windows have been closed, if you now visit the domain that you specified, you should find that it loads from the specified IP address. * * *
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to log into cPanel

There are two different methods to log into your cPanel control panel in order to manage every...

What's the difference between Aliases, Addon and Subdomains?

### Aliases An Alias domain does not have a unique website. It is a domain that is masked to...

Creating a MySql Database

If your website uses PHP or you need to hold a collection of records which need to be accessed...

Importing a MySql Database

You can import a MySQL database via phpMyAdmin which is available in the cPanel control panel....

Exporting a MySql Database

You can export a MySQL database via phpMyAdmin, available in cPanel, if you want to keep a backup...