How To Use Hosts File to Test Websites on Windows

Host files are called special files on a workstation computer. This file stores and contains absolutely all information about the IP address and domain name. This file is checked before DNS. and if you put an entry in this file, it will replace everything that is set in DNS. This function is very useful when testing the site, because it allows you to monitor and verify which IP address your local computer visited.

Host file format

This file is very simple; each of its stock contains the host name and IP address, usually separated by one or more spaces. They have entries for LOCALHOST as well as some comments that give a description of the file and how to use it.

Below is an example;
  1. Next you need to find “Notepad” If you use widows with version 8 or 10, then it is located in the Start menu If you are using Win XP or Vista 7, then find it in: “All Programs -> Accessories -> Notepad”;
  2. Right-click on the notepad tool and select “Run as administrator”;
  3. In Notepad, you need to click “Open” and select the file C:\Windows\System32\Drivers\etc\hosts;
  4. You need to edit the file, then save it.

Check settings

  1. Open a cmd;
  2. Use the command ping -c2
  3. Ping results will show IP adres. This means that he answers.

Was this article helpful?

Related Articles

Leave A Comment?