Viewing a website before going live

Viewing a website before going live

To test your website with your own domain name before DNS propagation has completed, you can use your local computer's HOSTS file. Your computer will use the entries in your HOSTS file before it looks up the DNS information for your domain. This article contains instructions for editing the HOSTS file on Windows 95/98/Me/2000/XP/2003/Vista/7, and Apple's Mac OS X.

When you are finished testing, remember to remove the custom lines that you added.

Cartika is not responsible for custom configurations on your local computer. If you are uncomfortable with editing configuration files on your computer, please do not follow the instructions below.


Windows

  1. Locate the HOSTS file on your computer. Typically it is in one of the following locations:
    • Windows NT/2000/XP/2003/Vista/7 - C:\windows\system32\drivers\etc\hosts
    • Windows 95/98/Me - C:\windows\hosts
  2. Open this file with a text editor such as Notepad or Wordpad.
    • Right-click on Notepad and select the option to Run as Administrator - otherwise you may not be able to open this file.
    Then, open the file. Consider performing a "Save As" so you have an original copy of the file that you can restore later. You will see two columns of information, the first containing IP addresses and the second containing host names. By default, a windows hosts file should be similar to the following:

    Filename: hosts

    127.0.0.1 localhost

    You can add additional lines to this file that will point requests for a particular domain to your new server's IP address. Example:

    Filename: hosts

    127.0.0.1 localhost
    70.32.88.203 example.com
    70.32.88.203 www.example.com
    
  3. Save your changes.
  4. Restart any currently open browsers. You may also want to flush your DNS cache. In Windows XP, go to Start, and then Run, then type "cmd" and hit enter. Type the following:
    ipconfig /flushdns
  5. Visit your new site using http://example.com or http://www.example.com/

Mac OS X

  1. Open Terminal, which is in Applications, then the Utilities folder.
  2. You may want to first make a backup copy of your existing hosts file:
    sudo cp /private/etc/hosts /private/etc/hosts-orig

    Enter your user password at the prompt.

    Type the following command to edit your hosts file:

    sudo vi /private/etc/hosts

    Enter your user password at the prompt.

  3. You will see a file with contents similar to the following:

    Filename: hosts

    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    ##
    127.0.0.1 localhost
    255.255.255.255 broadcasthost
    ::1 localhost
    fe80::1%lo0 localhost
    

    Add your domain and IP address to the bottom of the file. For example:

    Filename: hosts

    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    ##
    127.0.0.1 localhost
    255.255.255.255 broadcasthost
    ::1 localhost
    fe80::1%lo0 localhost
    70.32.88.203 example.com
    70.32.88.203 www.example.com
    
    4. You may also need to grant yourself sudo priveleges, if you got a permission error in Step 2. In your "Help" menu, search for "root" and select the instructions for "Enabling the root user." Follow these
    
    5. Restart any currently open browsers. You may also want to flush your DNS cache:   
    
    Command: dscacheutil -flushcach
    
    6. Visit your new site using http://example.com/ or http://www.example.com/
    • Related Articles

    • Domain Redirects in Website Panel

      The easiest way to set up redirects when utilizing Website Panel(WSP) is to do it within WSP directly. Sign in to your WebSitePanel hosting control panel Click on Web Sites Click on your domain At the Home Folder tab, select the radio button with ...
    • How do I access Webmail / Control Panel without going to CartikaHosting.com?

      Webmail can be accessed directly by going to http://mail.yourdomain.com/ and selecting the Webmail application you would like to work with.  
    • Enabling Inline HTML Viewing in Horde

      To display HTML messages in-line, it may require a configuration adjustment to Horde, as noted by the Horde IMP "INSTALL" documentation. * By default, IMP is configured to NOT display text/html message parts inline. This is done for various security ...
    • Temporary Hsphere URL to view website before making dns changes

      User would like to view contents of domain before making DNS changes. Typically occurs when users are migrating from another hosting provider and wants to make certain the site is configured properly before making any changes. Each account within ...
    • How to change a domain name in Hsphere on live site

      1) Add the new domain domain1.com to the account via hsphere control panel and make sure you point the domain to the nameservers listed in hsphere before proceeding (and give it time to resolve etc) 2) Log into the account via FTP (or use web shell) ...