Browse a Website via the Hosts File Before Domain Propagation
The easiest and most reliable way to preview a website before the domain points to the new hosting is by editing your system's hosts file. This allows you to force your browser to resolve a domain to a specific IP address.
Editing the Hosts File on Windows
- Open Notepad as Administrator.
- From the menu, select
File → Openand browse to:c:\Windows\System32\Drivers\etc\hosts - At the end of the file, add the following lines (replace the IP and domain with your actual values):
123.123.123.123 yourdomain.com123.123.123.123 www.yourdomain.com - Save and close the file.
Editing the Hosts File on macOS
- Open the Terminal.
- Enter the command:
sudo nano /etc/hosts - Enter your user password and press Enter.
- Use the arrow keys to scroll to the bottom of the file.
- Add the lines with your hosting IP and domain name:
123.123.123.123 yourdomain.com123.123.123.123 www.yourdomain.com - Press Ctrl + X to exit, confirm with Y, then press Enter.
- Close the terminal.
Note
After modifying the hosts file, you can visit the site by simply typing yourdomain.com in your browser, even if DNS propagation is not yet complete.