Using the HOSTS file to access development sites

How To:  Using the HOSTS files to access ALP development sites

Applies To:  All clients with development sites hosted by ALP

Procedure:  For clients who have chosen to do so, ALP provides a development site to facilitate user acceptance testing and increase reliability and security.  To access this development site, clients must create an entry in their computer's HOSTS file.

Important: Make a backup of the HOSTS file prior to editing. 


Windows 7 and Windows Vista user account control block access to the hosts file, so it is important to "run as administrator."  Some anti-virus applications may see editing the HOSTS file as potential malicious activity.  It is important to disable any anti-virus and anti-spyware applications temporarily while editing the file.
  1. Back up the HOSTS file by using Windows Explorer (My Computer or Computer, or right-click the Start menu button and choose "Open Windows Explorer") to browse to C:\Windows\System32\Drivers\etc\ and copy the file called HOSTS to a safe location.  This file does not have a file extension
  2. Go to Start --> All Programs --> Accessories, right-click Notepad, and choose "Run As Administrator"
  3. Go to File --> Open in Notepad
  4. In the file type dropdown (next to the textbox for the file name), change the value from "Text Documents (*.txt)" to "All Files"
  5. Open the file C:\Windows\System32\Drivers\etc\hosts
  6. Enter the IP address and hostname provided by ALP staff separated by a TAB (see example below)
  7. Save and close the file
*If you receive an error trying to save the file, you most likely did not choose "Run As Administrator" when you opened notepad.

  1. Back up the HOSTS file and copy the file called HOSTS to a safe location. This file does not have a file extension
  2. Go to Applications -> Utilities -> Terminal and type $ sudo nano /private/etc/hosts into terminal (without the $ symbol at the beginning).  It should prompt for an administrator password. Enter your Mac's administrator password.
  3. The hosts file contains some commented lines (lines starting with the # symbol), as well as some default hostname mappings (e.g. – localhost). Simply enter the IP address and hostname provided by ALP staff.
  4. Save (Ctrl + o) and close (Ctrl + x) the file.

An example of a properly formatted HOSTS file:

# Copyright (c) 1993-2009 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
#          # source server
#              # x client host

# localhost name resolution is handled within DNS itself.
#       localhost
# ::1             localhost       

Add Feedback