View your DreamHost site using a hosts file



A hosts file is a text file on your home computer. It is used to map a domain name to a specific server. If you edit it, you can change where your computer searches for a website.

For example, when you look up a URL in your browser, your computer sends out a query into the Internet to find where your site is located. Your site is located where your DNS is pointed to. If you edit the hosts file, you can change where your computer searches for a website.

In this way you can view a site on your DreamHost server when the DNS is pointed to another company.

This article explains how to view your site before pointing your DNS to DreamHost by editing the hosts file on your desktop or laptop computer (not a mobile device).

To test on a mobile device, or for another option on how to view your site at DreamHost before pointing DNS, view the following article:

Locate your A records

Each site at DreamHost has two A records for the URL. One for your domain with and without www. For example:


View the DNS article for details on how to view these records. Make a note of these as you'll need to add the IP to your hosts file in the next step.

Using Windows 10

On most Windows systems, you can find the hosts file in the following directory:


Notepad is a basic text editing program that is already install on Windows. To open the hosts file with Notepad, follow the steps below:

  1. Open the Start menu.
  2. Start to type in the word 'notepad' and it will display the icon.
  3. Right-click on the Notepad option and choose Run as administrator.

    You may receive a pop-up message titled User Access Control asking, Do you want to allow this app to make changes to your PC? Click Yes. This opens a blank Notepad file.

  4. On the top left of this blank file, click the File > Open... menu option.
  5. In the Explorer window, navigate to This PC and then to the C:\Windows\System32\drivers\etc directory.
    02 Hosts file Windows.png
  6. Choose the hosts file and click Open. You may need to change the Text Documents (*.txt) in the lower right to All Files in the dropdown list.
  7. At the bottom of the file, add your DreamHost site IP followed by the domain.
  8. Save the file.
  9. Make sure to flush your computer's DNS to ensure the new settings update.
  10. Restart your browser and try accessing your domain.

You can now view your site as it appears on your DreamHost server. Once you point your DNS to DreamHost, you can then remove these lines.

Using Apple Mac OS

  1. Launch Terminal by pressing command (⌘) + spacebar which opens the search box.
  2. Type the word Terminal.
  3. Press the return key or click the Terminal icon beneath TOP HIT.
  4. View the Creating and editing a file via SSH article for instructions on how to edit this file. This example uses the nano editor.
  5. Type the following into your terminal:
    [server]$ sudo nano /private/etc/hosts
  6. Enter the administrator password. Note: Typed passwords are not displayed on the command line.
    08 DNS hosts.fw.png
  7. Once the hosts file is open, use the arrow keys to navigate to the bottom to make any modifications.
  8. When finished, save and close the file to return to your terminal prompt.
  9. Close Terminal when finished.

Make sure to flush your DNS to ensure the new settings update. Once you point your DNS to DreamHost, you can then remove these lines.

Using Linux

On most Linux-based systems:

  • The hosts file can be located in the /etc/ directory.
  • The hosts file is usually called hosts.
  • The full path is /etc/hosts.

The steps to edit and save the file are the same as the 'Mac OS' instructions above.

Move WordPress instructions

This section explains how to view your WordPress site (at DreamHost) if it was moved by the Professional Services Team. This section only applies to NON-DreamPress migrations.

First, read through the sections above to locate and edit your computer's hosts file.

Normally, updating a hosts file only requires you to add two lines (as mentioned above). With this migration process, you also need to add a third line of text for the MySQL server. For example, if your site was, you would add these lines to the bottom of your hosts file:

Replace the example IP addresses above with your site's actual IP addresses.

You can use the following instructions to find your IP addresses on the DNS records Page:

  1. Navigate to the Manage Websites page.
  2. Open the DNS Settings page:
    DNS Settings
    • If in Grid view, click the 'vertical 3 dots' button for your domain. From the popout menu, click the DNS Settings link.
    • If in List view, either click the DNS link or click the 'vertical 3 dots' button to the right of your domain. From the popout menu, click the DNS Settings link.
      The domain's DNS records display.

If you need further assistance locating your site's IP addresses, view the DNS article for more detailed instructions.

Confirming the 'hosts' file is working

You can confirm you are loading the migrated site from DreamHost's servers if you are able to load the following page (replacing with your domain):


View your public site through a proxy

Once your hosts file is working, your computer will show you how your site looks at DreamHost. If you want to also view your current (public) site, you must use a proxy website.

An example of a proxy site is Visit that link in your browser, enter your domain name in the box, then press Enter. It uses your site's public DNS (not your local hosts file) to view the site at your current hosting company.

Comparing the sites

Viewing your site using a hosts file and a proxy site allows you to view both versions of your site for a side by side comparison. You can have one browser tab open on the migrated site (viewed using your hosts file) and another browser tab open on the proxy site (viewed using DNS) to see your current public site.

Making further changes to your site

During your inspection of the site, you may feel the need to change the setting of something that was out of scope of the migration service. Please refrain from changing anything that may alter the look or behavior of the site since the Professional Services Team must be able to compare the migrated site (at DreamHost) to the live site (at your current host).

If you must update something, make sure to document any change so the Professional Services Team can separate what may have been affected by the migration from subsequent alterations on your end.

See also

Did this article answer your questions?

Article last updated PST.

Still not finding what you're looking for?