Modifying your hosts file enables you to override the DNS for a domain, on that particular machine. This is useful when you want to test your site prior to going live and for other DNS-related reasons. Modifying your hosts file causes your local machine to look directly at the IP address specified. After your site goes live, you should remove this DNS override.
To modify the hosts file, you add a line to the file that contains the IP address that you want the site to resolve to and the address. In this example we are going to forward katycomputer.com to the Fastnet1 web server:
After you add the domain information and save the file, your system begins resolving to the specified IP address. After testing is finished, remove these entries.
Windows 10, Windows 8, Windows 7, and Windows Vista use User Account Control (UAC), so Notepad must be run as Administrator.
- Press the Windows key.
- Type Notepad in the search field.
- In the search results, right-click Notepad and select Run as administrator.
- From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts
- Make the necessary changes to the file:
Insert this line at the top of the hosts file, substituting katycomputer.com with your domain
220.127.116.11 katycomputer.com www.katycomputer.com
- Click File > Save to save your changes.