How to adjust your hosts file (Windows)

If you are creating a new website but do not want to make it live yet, it is possible to test your website locally. This is possible by making a (temporary) adjustment in the hosts file on your computer.

This adjustment directs the domain name you enter to a specific IP address instead of the IP address determined by the DNS.

Here's how you can do it in Windows 10:

Step 1: Open Notepad as an Administrator

Right-click on the Start button and choose "Search." Enter "Notepad" and right-click on "Run as administrator."

Step 2: Open the hosts file

In Notepad, open the hosts file by choosing File > Open and searching for the following location: c:\windows\system32\drivers\etc\hosts.

Step 3: Enter the IP address and domain name

In the hosts file, for each domain name you want to test, enter two lines at the bottom. Begin with the IP address of the server where your website is located, followed by the domain name. Below that, enter the same line, but with the www version of the domain name. You can find the IP address in Plesk under Websites & Domains.

Step 4: Test your website

After making the change, save the hosts file and you can test your website locally using your browser. Once your website has been successfully tested, you can remove the lines you added to the hosts file.