Skip to main content
All CollectionsTechnical SupportFAQs
How to preview a website if nameservers (DNS) aren't propagated or switched
How to preview a website if nameservers (DNS) aren't propagated or switched
Carlos Escalante avatar
Written by Carlos Escalante
Updated over a week ago

If you would like to preview your website before pointing DNS at it, here are a few options on how to do so.


1. Using a third-party service.

This method is quite easy and fast to set up, using a third party site/service that would translate/proxy the requests.

An example is https://www.skipdns.link/, please keep in mind though we are not affiliated with them.

Once you get into their website, you need to provide the IP of the server and the URL/web address and they will return a link for your webpage:

2. Updating your local hosts file.

This method lets you run the site directly, using the real domain, which can be useful if your site depends on being visited through a specific address.

To do this, you can edit your computer's hosts file, which means the site (as hosted in StableHost) would only be available to this computer, which is often fine when developing it.

The path of the file depends on the operating system, on Linux/MacOS it is '/etc/hosts' on Windows it is 'C:\WINDOWS\system32\drivers\etc\hosts' (make sure you edit the file as an administrator)

Assuming your account's IP address is '1.2.3.4', you will need to add something like the line below:

1.2.3.4 yourdomain.com www.yourdomain.com

2.1 Updating your hosts file on MacOS

  • Open Terminal (Go to Spotlight Search -> Terminal)

  • Write this command, it will edit the hosts file:

    • sudo nano /etc/hosts

  • You will be asked for the admin password to proceed. If your Mac account has admin access, put your own password otherwise you will need to admin password of that computer.

  • Go to the bottom of the file using the arrow keys.

  • Add the IP/domain line as previously explained. (example: 1.2.3.4 yourdomain.com www.yourdomain.com)

  • Press Ctrl+X to save and close the file.

  • You will be asked for confirmation, press 'Y' and then press Enter.

  • Flush your DNS cache by running this command at the Terminal:
    dscacheutil -flushcache

  • Once it ends, close the Terminal app.

2.2 Updating your hosts file on Windows

  • Press the Windows key

  • Search for Notepad.

  • Once you get the search results, right-click on Notepad and select 'Run as Administrator'.

  • From Notepad, open the following file:

    c:\Windows\System32\Drivers\etc\hosts

  • Add the IP/domain line as previously explained. (example: 1.2.3.4 yourdomain.com www.yourdomain.com)

  • Go to File > Save.

  • Close the editor.

2.3 Updating your hosts file on Linux

  • Open Terminal.

  • Write this command, it will edit the hosts file:

    • sudo nano /etc/hosts

  • You will be asked for the admin password to proceed.

  • Go to the bottom of the file using the arrow keys.

  • Add the IP/domain line as previously explained. (example: 1.2.3.4 yourdomain.com www.yourdomain.com)

  • Press Ctrl+X to save and close the file.

  • You will be asked for confirmation, press 'Y' and then press Enter.

  • Close the Terminal app.

Did this answer your question?