How do I preview a website on my 123 Reg server using my host file?

This article applies to 123 Reg Servers.

This article will show you how to preview a website on your 123 Reg Server by updating your host file on your computer.

Windows

Step 1 of 6

Locate the HOSTS file on your computer.

Windows NT/2000/XP/2003/Vista/7

C:windowssystem32driversetchosts

Windows 95/98/Me

C:windowshosts

Step 2 of 6

Open this file with a text editor such as Notepad or Wordpad.

Tip: Right-click on Notepad and select the option to Run as Administrator - otherwise you may not be able to open this file.

Step 3 of 6

When you open the file you will see two columns of information, the first containing IP addresses and the second containing host names. By default, a windows hosts file should be similar to the following:

</>

127.0.0.1 localhost

Tip: Consider performing a “Save As” so you have an original copy of the file that you can restore later.

Step 4 of 6

You can add additional lines to this file that will point requests for a particular domain to your new server’s IP address.

</>

127.0.0.1 localhost
[[IP ADDRESS]] yourdomain.com
[[IP ADDRESS]] www.yourdomain.com

You will need to replace the [[IPADDRESS]] part with the IP address of your server.

Step 5 of 6

Save the changes to your HOSTS file.

Step 6 of 6

Restart any currently open web browsers and you may also want to flush your DNS cache. In Windows go to Start, and then Run, then type “cmd” and hit enter. Type the following:

</>

ipconfig /flushdns

You will now be able to view the website on your new server while keeping the domain pointing to its existing hosting.

Mac OS X

Step 1 of 4

Open Terminal, which is in Applications, then the Utilities folder. You may want to first make a backup copy of your existing hosts file:

</>

sudo cp /private/etc/hosts /private/etc/hosts-orig

Please Note: You may also need to grant yourself sudo privileges, if you get a permission error. In your Help menu, search for root and select the instructions for Enabling the root user. Follow these.

Step 2 of 4

Enter your user password at the prompt. You will see a file with contents similar to the following:

</>

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost

Step 3 of 4

Add your domain and IP address to the bottom of the file.

</>

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
[[IP ADDRESS]] yourdomain.com
[[IP ADDRESS]] www.yourdomain.com

Tip: Press i to enter insert mode so you can type and copy/paste. Press Esc to exit insert mode when you are done modifying the file. Type :wq to save and quit.

Step 4 of 4

Restart any currently open web browsers and you may also want to flush your DNS cache.

</>

dscacheutil -flushcache

You will now be able to view the website on your new server while keeping the domain pointing to its existing hosting.