Preview website on new server without changing DNS

  • February 8, 2015
  • 0 Comments

When migrating a website to our servers you will usually want to preview the site before changing the DNS.

 You can change your "hosts" file to force your PC to resolve your domain to the new server while everyone else continues to see the site on the old server:


On Windows: http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

Here is how to do it on  MAC:


  1. Open the Mac's Terminal.
  2. You may either type Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.

  3. Open the hosts file for editing.
  4. In the terminal window you just opened copy/paste the command string below, and press return.

    sudo nano /private/etc/hosts

    You'll be prompted to enter your Mac user's password. NOTE: you won't see the cursor move. This is normal, so press return when done.

  5. Edit the hosts file by adding these two lines to the bottom of the file.
  6. SERVER_IP_ADDRESS domain.com
    SERVER_IP_ADDRESS www.domain.com

    For example, it should look like:

    199.38.112.234 google.com
    199.38.112.234 www.google.com

    Make sure that there is a space between the IP and the URL! Otherwise, the rule will not work.

    Be sure to place domain.com with your actual domain name. If you're not sure which IP address to use, please contact our Support Department for further assistance.

  7. Save save your changes by pressing control-o on your keyboard then return to accept the filename. Exit the editor by pressing control-x. This takes you back to the terminal screen.
  8. You may need to flush your Mac's DNS cache, so copy/paste the below command string into terminal, and press return.
  9. dscacheutil -flushcache

    This completes the hosts file modification, so you should now be able to see your site here with us using your domain in your browser's address bar.

    When testing is complete you may undo these changes by repeating the steps above but removing the information entered in step 3.


How helpful was this article to you?

Posting has been disabled.