How do I edit my hosts file in Windows XP?

To view your domain before you update your name servers at your registrar, you will want to temporarily put an entry for your domain and its IP address in the "hosts" file for your computer. For a Windows XP system, the file is located at c:windowssystem32driversetchosts. Other operating systems may have the hosts file in a different location, use a different file or may not have it at all. Open the hosts file in a text editor like notepad.

A typical Windows XP hosts file will initially look like this:

# Copyright (c) 1993-1999 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:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost

You'll want to add a few lines at the bottom of the file as follows:

# Copyright (c) 1993-1999 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:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
123.123.123.123 yourdomain.com  #(you can add a description here)
123.123.123.123 www.yourdomain.com

Replace 123.123.123.123 with your real IP address and yourdomain.com with the real address of your site. If you want, you can also add a description for each site after a '#' symbol after each site (refer to the above example).

This will force your computer to look at your new site when you use the name of your domain, instead of looking at your old site.

Important: Make sure that about a week after updating your DNS at your registrar that you remove the entry from the hosts file so you are able to access the new site normally. Failure to do this may cause problems in the future if your site changes its IP address.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I set up custom error message pages (such as 404) on a Plesk 5 hosting account?

These instructions apply to the MDH and Universal Pipe hosting accounts. In your Plesk 5...

What is the full path to web-server root created with Plesk?

The full server path to the web-server root for Upipe hosting accounts is:...

Can I delete access_log and error_log files from my UPipe account?

You can delete any log file with "processed" as part of its name in the Log Manager portion of...

How do I set up SSL for my website? (Plesk 5)

These instructions are valid for installing a SSL certificate on a Plesk 5 website. Our MDH and...

In my control panel, what's the difference between a domain user and a web user?

A domain user allows you to log into the Plesk control panel using the domain name as the user...