The hosts file on a computer is the file used to store the resolution of Internet domains to IP addresses.
One common use of this file is to preview a website that is not yet pointing to the hosting where the website's content is being uploaded.
To make your computer internally resolve the domain name example.com to the Public IP from your server, you should open the file C:\WINDOWS\system32\drivers\etc\hosts on your PC, using Notepad or a similar text editor, and add the following line:
xxx.xxx.xxx.xxx example.com
Important information
You need to replace xxx.xxx.xxx.xxx with the IP of the VPS server where the website's data is uploaded and that you want to preview, and also replace example.com with your domain name.
Once you save the file, when you access example.com from your browser, you will be able to see the content you have uploaded to your server.
Note
This change does not affect the DNS resolution of the domain, it only affects the DNS resolution of the device where these changes have been made.
It is important to later remove the changes made to the hosts file, as they will always apply to the domains configured in the file, and it could create a problem or confusion in the future.
If you have any questions that are not fully resolved in this article, remember that you can always contact support.