Viewing site before DNS change
- 1 Overview
- 2 A note about using Dreamhosters.com with a CMS
- 3 Viewing your site through a dreamhosters.com subdomain
- 4 Viewing your site through your hosts file
- 5 Viewing your MySQL database before DNS change
- 6 See also
When you visit a website, you are redirected to the hosting company where your DNS is pointed. It’s also possible to upload your content to the DreamHost servers before you point your DNS to DreamHost and then view how the site will look on our servers. This wiki walks you through how to view the website you’ve uploaded to the DreamHost servers before this DNS change.
A note about using Dreamhosters.com with a CMS
Some Content Management Systems (CMS) like WordPress have the domain name stored as a setting in the sites configuration file.
You can install and set up your site on a dreamhosters.com subdomain. But when it comes time to migrate the site to the primary domain, you’ll need to update the URLs in the database.
Visit this link at Wordpress for further details on how to move the site to a new URL:
Viewing your site through a dreamhosters.com subdomain
For temporary web viewing, you are able to add a subdomain of DreamHosters.com on your Manage Domains page. For example, if your site is named mysite.com, you can set up a dreamhosters.com subdomain such as mysite.dreamhosters.com. Then, set that dreamhosters URL to MIRROR your primary website.
In the example below, your site is named yoursite.com and the dreamhosters subdomain is named yoursite.dreamhosters.com:
- Open your (Panel > ‘Domains’ > ‘Manage Domains’) page.
- Make sure your domain is set up as Fully Hosted.
- Click the Add Hosting to a Domain / Sub-Domain button found at the top of the page.
- Scroll down to the Mirrored section and fill in the two fields:
- Create the mirror at: Type in the dreamhosters.com address you wish to use. In this case, you’d type in "yoursite.dreamhosters.com".
- Mirror this site: Select the name of your primary domain to be mirrored.
- Click the Mirror this domain button to complete the setup. It may take up to 6 hours for this newly-created mirror to update, but once it does, you'll be able to access your domain (via this mirror) before you change the nameservers to point to DreamHost.
When you are ready to point your DNS to DreamHost, visit the following wiki pages which provide full instructions:
|Note:||Do not try to visit your site at DreamHost by its IP address, as the IP address is for the server, not the website. If you visit the IP, you’ll see a Site Not Found page which you can read about here:|
Viewing your site through your hosts file
You are also able to view the site that you’ve uploaded to our servers before changing your DNS to point to DreamHost using the hosts file on your computer.
To do this, you'll need to temporarily edit your hosts file which allows you to see your site in its uploaded form within our servers before the DNS change:
- Obtain the IP address assigned to your domain by looking in your panel at (Panel > ‘Domains’ > ‘Manage Domains’).
- You’ll see an A record with an IP address. Make a note of that IP address.
- Add that IP to your hosts file on your computer.
- In the following example, your site is named mywebsite.com and the IP is 22.214.171.124:
126.96.36.199 mywebsite.com www.mywebsite.com
- Add this information to the hosts file.
If you then visit your website, you’ll see the contents you’ve uploaded to our servers. If you want to view the actual website on the external host again, just remove this line from your hosts file.
How to locate your hosts file
On most Windows systems, you can find the hosts file in
C:\Windows\System32\Drivers\etc. It might be set to hidden so make sure you have 'show hidden files' turned on.
- Right-click on the hosts file and open it in Notepad.
- Add your new line to the bottom of this file.
- Save your changes to the hosts file and then flush the DNS cache on your system. You can visit our wiki for instructions on how to flush your DNS cache:
- Restart your browser and try accessing your domain.
You should be able to access your site as it appears on our servers.
On most Linux-based systems:
- The hosts file can be located in the
- The hosts file is usually called
- The full path is
Using Apple Mac OS
- Launch Terminal by pressing command (⌘) + spacebar which opens the search box.
- Type the word Terminal.
- Press the return key or click the Terminal icon beneath TOP HIT.
- The Terminal prompt opens.
- Enter the following in the Terminal command prompt:
sudo nano /private/etc/hosts
- Enter the administrator password. Note: Typed passwords are not displayed on the command line.
- Once the hosts file is open, use the arrow keys to navigate to the bottom to make any modifications.
- When finished, press Control + O followed by Enter to save changes to
- Press Control + X to exit out of nano.
- Quit Terminal when finished.
Viewing your MySQL database before DNS change
If you need to access a MySQL database before DNS changes, you can do the same thing by using a "temporary" MySQL host arrangement.
Visit the following wiki for more information: