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;
220.127.116.11 example.com 18.104.22.168 www.example.com
- 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”;
- Right-click on the notepad tool and select “Run as administrator”;
- In Notepad, you need to click “Open” and select the file C:\Windows\System32\Drivers\etc\hosts;
- You need to edit the file, then save it.
- Open a cmd;
- Use the command
ping -c2 example.com
- Ping results will show IP adres. This means that he answers.