Preview a Site Without Pointing a Domain
It is possible to preview your website without pointing your domain to your server by forcing your computer to load from your Site5 server instead of using the current DNS configuration of your domain. To do this, you’ll need to know your server’s IP address and then edit your computer’s hosts file.
How to Find your Site’s IP Address
You can find your SiteAdmin IP address within the welcome letter you received when you signed up for our hosting services. If you no longer have this, you can request our team re-send it to you, or you can follow the steps below to find the IP address either in SiteAdmin or cPanel.
The following article will assist you with locating your IP address through SiteAdmin or cPanel:
How to Edit your Hosts File
Once you know your server IP address, there are 2 ways that you can change the host your domain loads from. This article will cover each of them:
Browser Plugin
There are several plugins for popular browsers that will allow you to make this change without editing system files. This is one of the fastest and easiest ways to check your server before pointing your domain:
- Firefox: Change Hosts
- Chrome: Virtual Hosts
Both plugins require your desired host and your server IP to load it from. Each plugin will have different instructions to use. Instructions for proper use may differ based on version.
Editing System Files
You may change the host your local computer loads your website from by directly editing your system’s hosts file. This method will be easier if you are an experienced user of the operating system on your local PC.
All operating systems will have a hosts file like our example:
- 127.0.0.1 localhost
- 123.45.67.89 www.example.com
- #98.76.54.32 www.another-example.com
Add the second line in this example to your system’s hosts file, with the following edits:
- Replace “123.45.67.89” with your server IP.
- Replace “www.example.com” with your actual domain name.
You may deactivate a line to undo this change by prefacing it with a “#” (as in the third line above). This will cause the line to be ignored.
Look below to get instructions for making this change to your desired operating system:
Windows
Windows 8 or 10:
- Select the Start key and locate Notepad. (If you do not see it on your current Start page, begin typing “Notepad” and a search box will appear on the right side of the screen with a list of programs under it. Notepad should be at the top of this list.
- Right click on Notepad. You will see options appear on the bottom portion of the Start Page.
- Select Run as administrator.
Note: Performing this action may cause Windows User Account Control to prompt you with a warning or, if you are logged in as another user, a request for the Administrator password. This step is necessary to modify system files such as the hosts file.
- Click File in the menu bar at the top of Notepad and select Open.
- Click the dropdown box in the lower right hand corner that is set to Text Documents (*.txt) and select All Files (*.*)
- Browse to C:\Windows\System32\Drivers\etc and open the hosts file.
- Make the needed changes, as shown above, and close Notepad.
- Save when prompted.
Windows 7 or Vista
- Browse to Start > All Programs > Accessories.
- Right-click Notepad, and select Run as administrator.
- Click Continue on the UAC prompt.
- Click File > Open.
- Browse to C:\Windows\System32\Drivers\etc.
- Change the file filter drop-down box from Text Documents (*.txt) to All Files (*.*).
- Select hosts, and click Open.
- Make the needed changes, as shown above, and close Notepad.
- Save when prompted.
Windows XP and Earlier
- Browse to Start > Find > Files and Folders.
- Select the hosts file in your Windows directory (or WINNT\system32\drivers\etc).
- Verify that the file is not “read only” by right-clicking it, and choosing Properties.
- Open the file for editing with Notepad.
- There should already be an entry for “localhost.” Earlier versions of Windows have different formats for hosts file entries. Be sure to follow the same format as you find in your file when inserting the HostGator IP and the domain name:
On Windows 98 and Windows 95, the order may be hostname, IP address.
On Windows 2000 and Windows ME, the order is IP address, hostname.
- Make the needed changes and close Notepad.
- Save when prompted.
You may also need to reboot for the change to take effect. The next time you visit your domain, your browser will try to find the domain at the corresponding IP instead of looking up the IP through DNS.
Mac OS X
Follow the instructions below to edit your hosts file if you are running Mac OS X.
- Open the Terminal application. Start by typing Terminal on the Spotlight or by going to Applications > Utilities > Terminal.
- Open the hosts file by typing in the Terminal that you have just opened:
sudo nano /private/etc/hostsNote: Some versions of Mac OS X will lock permissions on the hosts file (the file is marked as immutable). In the event this happens, use the following command instead: sudo chflags nouchg /private/etc/host
- Type your user password when prompted.
- The hosts file contains some comments (lines starting with the # symbol), as well as some default hostname mappings (e.g. 127.0.0.1 localhost). Simply append your new mappings underneath the default ones. You can navigate the file using the arrow keys.
123.45.67.89 domain.com www.domain.com
Replace “123.45.67.89” with the server IP that HostGator provided you in your cPanel. Replace domain.com with your actual domain name. Additional domains, subdomains or addon domains (such as www.domain.com) can be added at the end of the line, separated by spaces.
- When done editing the hosts file, press Control-o to save the file.
- Press Enter on the filename prompt, and Control-x to exit the editor.
UNIX
On Unix-based systems, you can find the hosts file at /etc/hosts. Most distributions of Unix will have terminal located in the same location.
To open the terminal:
- Go to Menu.
- Select Applications.
- Choose Accessories.
- Select Terminal.
To edit the hosts file:
Unix users can edit hosts files in the same process as Mac users. Please refer to steps 2 through 4 in the Mac section above.
DNS Flush
Once you have modified your hosts file, it is recommended that you flush your DNS so that the new changes can be implemented more swiftly. DNS flushing must be done using command line. Depending on your computer’s OS, there will be different commands.