DNS - Viewing site before DNS change

From DreamHost
Jump to: navigation, search

Getting Started

Introduction

Transferring domains between registrars can be scary stuff! Minimizing downtime is something pretty important to most of you, so here's the best way to get your account set up at DreamHost to help eliminate downtime during the switch.

Click here for a similar article relating to databases.

Getting Started

First, you need to have an active DreamHost account. Once you've signed up for the service and received your activation e-mails, you'll need to upload your content to the folder created for your domain. You'll receive information on how to access your account via FTP in one of the welcome e-mails sent out to you.

There are two ways to reach your DreamHost site without changing the DNS records:

1) FTP to the server on which your site will live -- find that server's name via the "Account Status" drop-down tab near the top-right of the DreamHost Web Panel, under "Your Web Server". Then FTP to servername.dreamhost.com. E.g. if your server's name is "meatball" you should ftp to "meatball.dreamhost.com".

2) You can also create a free sub-domain of dreamhosters.com and mirror your site there; e.g. if your domain is "yourdomain.com" you can mirror it at "yourdomain.dreamhosters.com", then when the DNS records for that site have updated, you can FTP straight to that address to access your home directory.

Note: in either case, if you have associated a unique user with your domain in your DreamHost panel, you must log in as that user to see the domain's files. Otherwise you will still be able to log in, but the domain's files will be invisible.

These methods will work at any time. Once your domain's DNS records have switched, you may also FTP straight to yourdomain.com.

Warning about using Dreamhosters.com with a CMS

Content Management Systems like WordPress and Joomla! have the domain name stored as a setting in their configuration and they use that setting A LOT. You can setup the site fine on the Dreamhosters.com subdomain, but you'll have to do some extra work when you want to switch the site over to using the main domain name. WordPress.org has great instructions for how to move to a new domain name. Or, if you want to skip the extra work, just build the site like normal (don't use Dreamhosters.com) and use the other techniques on this page so you can finish the CMS customization before changing your name servers.

For more WordPress directions see Installing WordPress with DreamHosters

Setting it all up

For temporary web viewing, you need to add a sub-domain to DreamHosters.com once setup you will be able to see your site at yoursite.dreamhosters.com. This will mirror your actual domain, and allow you to access the website before changing your DNS. Here's how you do it!

  1. First visit the the Domains >> Manage Domains section of the control panel.
  2. From there, click the Add New Domain/Sub-Domain link found at the top of the page.
  3. There are many sections to this page - you only need to fill in the 'Mirroring' section, so scroll down. Type in what you'd like your DreamHosters.com address to be - the whole address: yoursite.dreamhosters.com.
  4. Select the domain to be mirrored (that was added automatically after signup) from the drop down list below.
  5. Click the 'Mirror with this domain now!' button to set it up!

It may take about 3-9 hours for this newly-created mirroring to be set up, but once it is you'll be able to access your domain (via this mirror) before you change the name servers for your domain. If you want to access your site faster to might want to purchase an IP address specific to your web site.

NOTE: After testing is complete and you change the name servers for your domain to use ours this mirror won't be necessary any longer and can be deleted from the control panel.

The wrap-up

As you can see, this won't affect the current registration or hosting of your actual domain, but basically provides an alternate method for accessing your domain before (and even after) you flip the DNS switch and move your domain's nameservers over to DreamHost. Diagram of how DNS works: #1

Speaking of nameservers... now that you've confirmed everything's good to go on our side, it's time for the moment of truth. Flipping the DNS switch. You'll need to login to the control panel with your current registrar (or contact their support team) to modify the nameservers to the following:

  • ns1.dreamhost.com 66.33.206.206
  • ns2.dreamhost.com 208.97.182.10
  • ns3.dreamhost.com 66.33.216.216

Flip!

Diagram of how DNS works: #2

Don't hesitate to contact the support team if you need any help with this!

Here's something that will not work

One thing that will not work is trying to access your site directly via its IP address. For example, you might be tempted before flipping the DNS switch (as described above) to give your site one last look by browsing to http://208.97.159.132 (or whatever ip address you see in your control panel for your domain).

That's not going to work. You'll get a bad_httpd_conf error page, and this is normal behavior. Here's the word on it straight from Dreamhost support:
It would be expensive and unnecessary to put each domain on its own IP, so an IP is shared between many sites. So just visiting the IP will give you an error like that since apache doesn't know which site is should give you.

So check out the operation of your site at yoursite.dreamhosters.com, and then be brave and flip that DNS switch.

Changing your hosts file

A trick to view your site before changing your nameservers to point to DreamHost is to temporarily edit your hosts file to force your computer to view the DreamHost-hosted version. After creating your DreamHost account, open the hosts file in your computer. You'll need to get the IP address assigned to your domain. You can view this information by clicking the 'DNS' link that appears under your domain in the Manage Domains portion of the control panel. Look for the 'A' record and the IP address listed next to it. Copy that IP address. Now add the following line to the hosts file, substituting the 192.* address with the one you just wrote down, and 'www.example.org' with your actual domain.

192.168.1.1 www.example.org

Do not forget to remove that line from the hosts file once you point your domain's nameservers to DreamHost or if you want to view the old site.

What happens with this trick is that your system no longer resolves the name to the IP address via your ISPs DNS but instead looks it up from your local hosts file. This bypasses your ISPs DNS completely. The server at Dreamhost will receive the incoming connection with the correct domain name in the URL and it will serve you the pages. Keep in mind that only people that have made this modification will be able to access your domain as hosted on DreamHost prior to pointing your nameservers to DreamHost.

Locating your hosts file

Windows

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. Save the hosts file and flush the DNS cache on your system. Restart your browser and try accessing your domain. If all is well, you should be able to access your site.

Linux

On most Linux-based systems, the hosts file can be located in the /etc/ directory.

The hosts file is usually called 'hosts' there. The full path is '/etc/hosts'.

Apple Mac OS

  1. Launch Terminal , found in /Applications/Utilities/ or launched through Spotlight.
  2. Type the following command at the prompt:
    sudo nano /private/etc/hosts
  3. Enter the administrator password when requested. You will not see it typed on screen as usual with the command line.
  4. Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications.
  5. When finished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts, then hit Control+X to exit out of nano.
  6. Quit out of Terminal when finished.

Viewing your MySQL Data Base before DNS change

If you need to access a MySQL databse before DNS changes, you can do much the same thing by using this same process with a "temporary" MySQL host arrangement. More information on that process is available in the Dreamhost WIki article on viewing a Database before DNS changes.

See also