Modifying Your Hosts FileWritten by Brad Markle
Click here to watch a video tutorial
While reviewing this article, if you are not sure exactly what you need to do, we recommend reviewing the following flash tutorial:
The following information is for Windows users. If you are using a Mac, please see our article on How to edit your hosts file on a Mac
A hosts file modification is a simple Windows tweak that is used to trick your computer into resolving to a specific IP. This is especially useful when developing your site on our server when your nameservers are not pointed to us yet, and you are working with domain-name-dependent software (like FrontPage or a php content management system such as Joomla or Wordpress).
First, find where your hosts file is located:
- Windows 95/98/Me c:\windows\hosts
- Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts
- Windows XP Home/Vista/Windows 7 c:\windows\system32\drivers\etc\hosts
Hosts is the name of the hosts file and not another directory name. It does not have an extension (extensions are the .exe, .txt, .doc, etc. endings to filenames) and so appears to be another directory in the example above.
We recommend that you back it up onto a usb drive or into another directory on your hard drive so that you may restore it if you do not like the results, or in case something else goes wrong while you are trying to set this up. It is always better to be safe than sorry in the event of an unforeseen mishap. Please make a backup copy.
Open your hosts file in Notepad. If you receive any permissions related errors during this process, please review the following link for further assistance:
It should look something like this when you open it:
# 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
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# 184.108.40.206 rhino.acme.com # source server
# 220.127.116.11 x.acme.com # x client host
You can now add addresses to your Hosts file. For example:
Once you make your changes, save the hosts file and restart your web browser. This should force those sites to resolve to the given IPs.