Testing webhosting before setting up DNS

If you need to test your website without pointing the domain to our server in DNS (e.g. you want to migrate your hosting to us and prepare and test it first), use the "hosts" file. This file is used for local domain name to IP address resolution and overrides DNS servers.
 

Editing the file


The hosts file can be found here:
  1. WindowsC:\windows\system32\drivers\etc\hosts or search for "hosts" in the Start menu.
    When launching a text editor (Wordpad, Notepad++) you need to choose "Run as Administrator" using right-click, otherwise the file cannot be saved.
  2. LinuxMacOS – open Terminal, enter the following command, press enter and enter the user password if prompted:
    sudo nano /etc/hosts
Then add a line to this file with the IP address of the webserver and the name of your domain, and save the file. To find out which IP address to use for your hosting, refer to this article: Domain redirection to FORPSI webhosting.
 
The new line in the hosts file should look like this:
 
185.129.138.202 your-domain.cz www.your-domain.cz
 
After adding the line with the server's IP address and your domain to the hosts file, restart your web browser or open a new incognito/private window.
Then when you enter the address http://www.your-domain.cz, the pages will load from the server with the IP address 185.129.138.39. The browser sees the relevant IP address in the hosts file and no longer queries DNS servers, but connects directly to the specified server.
 
To edit and manage the hosts file, you can also use dedicated software such as Hosts File Editor.

For Android, you can use apps based on VPN without root access, such as Hosts Go or DNS66.