Category: General

How to Update Windows Hostfile to ensure domain points to a specified IP address

Note: this will trick your browser on the machine with the host’s file only.

The host’s file is normally found at the following path:


Edit the file with a text editor, if for example, you want to force domain to point to IP address, you would add the following entry to the host’s file. Remember to remove the entry when you are finished.

# Copyright (c) 1993-2006 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
::1             localhost

Save the file and close down all browsers after each change. Now hit from your browser and it will be pointing to the specified IP.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.