Editing Your Host File
For various reasons it may be necessary to update the hosts file on your computer to properly resolve a web site by its domain name. The most common reason for this is to allow people to view or publish web content immediately after purchasing a new domain name or transferring an existing domain name.
New and transferred domain names have a delay period that can be anywhere from a few hours to a few days. During this period of time the new or transferred domain information propagates around the internet, and is generally unavailable.
If you need to update your site immediately and cannot wait for the propagation of domain information around the internet, you can edit a file on your computer as a temporary work around.
Please note: this work around is only valid on the computer on which the change was made. It will not make the web site available to anyone on the internet.
Windows operating systems contain a file called ‘hosts’ that will force resolution of your domain name.
- Open the hosts file
- Go to the Start menu and choose Run. Type the following in the Run dialog box:
- For Windows NT and Windows 2000
- Windows XP, Windows Vista or Windows 7
- Click the OK button (This should open a window with several files in it.)
- Find the file called ‘hosts’ and double–click it. If prompted, specify that you would like to choose a program to open the file with from a list of programs.
- Choose ‘Notepad’ from the list of available programs.
- Edit and save the hosts file
- The contents of your hosts file should look something like this
- Start typing on a new line at the bottom of the file.
- To do so, place your cursor at the very end of the last line and hit ‘Enter’ to start a new line.
- Type these two lines of text like this example:
(use your server IP address and your site domain in–place of the defaults below)
- Your hosts file should look something like this when you are done
- Close the hosts file and save it when prompted.
- PLEASE NOTE: At this point you should be able to view and publish to your web site using your domain name. After 3–4 days, you will want to undo this change to your hosts file so that you can check to see that your domain name is now resolving without assistance over the internet.
- Undo the Hosts file change (after you have confirmed that it is resolving properly)
- Open the hosts file as described above.
- Delete the information that you added previously and close the file.
- Choose to save the changes to the hosts file when asked.