Windows

1. First you need to find the HOSTS file on your local machine.

2. Open the HOSTS file with a text editor with administrator rights.

3. Add additional lines for your domain.

4. Save the changes made to the HOSTS file and restart any open browsers.

5. If you need to flush your DNS cache.

6. Now try browsing to the site you added to the HOSTS file

 

NB: remember to revert changes back after testing.

 

Mac OS X

As previously stated this involves changing local files and is only recommend for experienced users. In the case of the Mac OS we will be using Terminal and VI (text editor) so users should be familiar with these two before trying to make any changes.

1. First we need to open Terminal. This can be found in the Utilities folder under Applications if you do not have a shortcut for it.

2. Make a backup of the existing HOSTS file.

3. Edit the HOSTS file and add additional line for your domain.

##
# 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
##
# 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
92.168.23.18 yourdomain.com
92.168.23.18 www.yourdomain.com

4. If you run into any permission errors along the way you may not be running terminal as the root user. You can enable this if it isn't already but going to the 'Help' menu and searching for the wood 'root'. You will see an article for 'Enabling the root user'

5. Restart any open browsers and flush you DNS cache if you need to.

6. Now try browsing to your domain you added to the HOSTS file.

 

NB: remember to revert changes back after testing.