Browse a Website via the Hosts File Before Domain Propagation Print

  • hosting, transfer, hosts
  • 4

 

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

  1. Open Notepad as Administrator.
  2. From the menu, select File → Open and browse to:
    c:\Windows\System32\Drivers\etc\hosts
  3. At the end of the file, add the following lines (replace the IP and domain with your actual values):
    123.123.123.123 yourdomain.com
    123.123.123.123 www.yourdomain.com
  4. Save and close the file.

 

Editing the Hosts File on macOS

  1. Open the Terminal.
  2. Enter the command:
    sudo nano /etc/hosts
  3. Enter your user password and press Enter.
  4. Use the arrow keys to scroll to the bottom of the file.
  5. Add the lines with your hosting IP and domain name:
    123.123.123.123 yourdomain.com
    123.123.123.123 www.yourdomain.com
  6. Press Ctrl + X to exit, confirm with Y, then press Enter.
  7. 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.

 


Was this answer helpful?

« Back