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 www.domain.com to point to IP address 184.108.40.206, 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: # # 220.127.116.11 rhino.acme.com # source server # 18.104.22.168 x.acme.com # x client host 127.0.0.1 localhost ::1 localhost 22.214.171.124 domain.com 126.96.36.199 www.domain.com
Save the file and close down all browsers after each change. Now hit www.domain.com from your browser and it will be pointing to the specified IP.