While your website is being developed, it may live on one of Hiilite’s servers and not be live to the open internet. To view your under-development site, ask your rep at Hiilite for the IP address of the server your site is hosted on, then follow the steps below to point your computer’s host file at our server.
*Note: don’t forget to undo this process when your site is launched, otherwise you will not get the correct experience.
Like many Unix-based and Unix-like operating systems, it is possible to change the hosts file on your Mac to manually set a domain to a certain server.
Changing this file will override any DNS settings you might receive from your ISP, so this is a good way to test a site before you have transferred the domain from your old host to us.
Modifying the hosts file in Mac OS X 10.2 and later is a pretty easy task, but it must be done as the “root” user in the terminal. This change will point ONLY your Mac to your site with us. It will not affect other computers’ access to your site at your former host.
Steps to editing your hosts file
- Open the Mac’s Terminal.
You may either type Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.
- Open the hosts file for editing.
In the terminal window you just opened copy/paste the command string below, and press return.
sudo nano /private/etc/hosts
You’ll be prompted to enter your Mac user’s password. NOTE: you won’t see the cursor move. This is normal, so press return when done.
- Edit the hosts file by adding these two lines to the bottom of the file.
For example, it should look like:
Make sure that there is a space between the IP and the URL! Otherwise, the rule will not work.
Be sure to place domain.com with your actual domain name. If you’re not sure which IP address to use, please contact our Support Department for further assistance.
- Save your changes by pressing control-o on your keyboard then return to accept the filename. Exit the editor by pressing control-x. This takes you back to the terminal screen.
- You may need to flush your Mac’s DNS cache, so copy/paste the below command string into terminal, and press return.
You may have to add sudo to this command, for example:
sudo dscacheutil -flushcache
This completes the hosts file modification, so you should now be able to see your site here with us using your domain in your browser’s address bar.
When testing is complete you may undo these changes by repeating the steps above but removing the information entered in step 3.
What is a hosts file modification?
A hosts file modification is a simple Windows tweak that is used to trick your computer into resolving to a specific IP. This is especially useful when developing your site on our server when your nameservers are not pointed to us yet, and you are working with domain-name-dependent software (like FrontPage or a php content management system such as Joomla or WordPress).
Run Notepad as administrator
To perform a hosts file mod, you will need to first run Notepad as administrator. This is because the hosts file is a system file and cannot be modified otherwise. Note: If you are running Windows XP or lower, you won’t need to run it as administrator as this functionality only exists in Vista and above. Locate Notepad within your Start menu. If it is not already there, you can type “notepad” into the search box to show it. Then, right-click on it and click on “Run as administrator”.
Opening your hosts file
After you have Notepad up and running as administrator, you can then locate your hosts files and open it. While not all Windows versions store it in the same place, it is typically located within c:\windows\system32\drivers\etc\hosts. If you don’t see it there, other possibilities are as follows:
- Windows 95/98/Me c:\windows\hosts
- Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts
- Windows XP Home/Vista/Windows 7 c:\windows\system32\drivers\etc\hosts
- Windows 8 c:\windows\system32\drivers\etc\hosts
- Windows 10 c:\windows\system32\drivers\etc\hosts
Now, we need to open our hosts file. With Notepad already open, click on “File”, then “Open…”. As the hosts file is not a standard .txt file as Notepad will look for by default, you will change the dropdown in the bottom right that says “Text Documents” to instead display “All Files(*.*)” Navigate to the location of your hosts file and double-click on it to open the file in Notepad.
Windows 8: Note on Windows Defender
If you are using Windows 8, Windows Defender is running by default and it prevents the change of the HOSTS file. You will need to allow this file to be edited by going into Windows Defender and doing the following steps:
- Navigate to Windows Defender hover over the right corner to bring up the navigation bar. Click on the icon that appears to be a magnifying glass to start a search. Type in “Windows Defender”, click on the icon that appears. It will be labelled “Windows Defender.” Click on this icon and the application will launch.
- When Windows Defender opens, click on the tab labelled Settings.
- Next, type in the location of the hosts file based on location of the Windows installation. Here’s the default path: c:\windows\system32\drivers\etc\hosts
- Click on the Add button and you’ll see it added to the list beneath the file locations.
- Click on Save Changes in the bottom right and then close Windows Defender.
- The next step will be actually edit the file. As per the instructions above, you will need to edit the file as an Administrator. Hover over the right side again, and then search for “Notepad”. Open it as an administrator.
- Open the file as per your HOSTS file path.
- Make your edits, and click on SAVE by clicking on “File” to bring up the menu. This completes the HOSTS file edit in Windows 8.
Windows 10 – Administrator permission required for change
If you are using Windows 10, you will need to make sure that you are using the text editor as an administrator in order to make changes to the HOSTS file. Windows may require that you log-in as an Administrator level user in order to save your changes.
Modifying your hosts file
Now that you have your hosts file open, its time to edit it. Within your hosts file, you should see something like the following:
# Copyright (c) 1993-1999 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
# For example:
# 188.8.131.52 rhino.acme.com # source server
# 184.108.40.206 x.acme.com # x client host
Be sure to make a backup of your hosts file first
Just like any other changes such as ones that you would make on your website, be sure to back everything up before you make any changes. The do so, you may follow these steps:
- In Notepad, click on “File” and select “Save As…”
- In the file name, enter something you will remember such as hosts_file_09.16.2013
- Click “Save”
Locate the IP address that is associated with your account
You may locate your IP easily from right within cPanel.
- Log into cPanel
- To the left, you will see an option that says “Expand Stats”. Click it to open more information about your account
- Scroll down to where you see “Shared IP address”. If you have a dedicated IP, it will say “Dedicated IP” instead. This is the information that you will need for your hosts file mod.
Making the change
Using the information you have just gathered from cPanel, you will add some lines to your host file. They will look something like this:
After making the change, click on “File”, then “Save”. You have now made your hosts file modification.
Flushing your DNS cache
If your computer has cached your DNS, you will need to clear it. Luckily, we have an article that can teach you how to do just that:
How do I know that it worked?
The easiest way to see that it worked is to just go to your domain. Does it show your new site as it should on our servers? If there were no changes to your site from when you moved it, you might need to run a ping test to ensure that it shows the correct IP.