NOTE: The following guide is intended to assist if you are using a Mac OS X computer. If you are using Windows, please refer to our guide on how to Modify Your Hosts File Using Windows.
The hosts file is used by your computer to lookup/resolve domain names to an IP address. This file can be used to force your computer to resolve your website to a specific IP address rather than resolving your website using the DNS found in the name servers the domain is pointed to. Manually configuring your domain with the IP address of your InMotion Hosting server, will allow you to test your website without affecting the server where your domain is pointed to via the name servers/DNS.
Edit Hosts File
- Open the Terminal application.
- Open the hosts file for editing.
- Edit the hosts file by adding these two lines to the bottom of the file.
- 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 either type Terminal in the Spotlight search or by navigating to Applications -> Utilities -> Terminal.
In the terminal window you just opened copy/paste the command string below, and press return.
sudo nano /private/etc/hosts or sudo nano /etc/hosts on newer MacOS.
You’ll be prompted to enter your Mac user’s password.
NOTE: you will not see the cursor move. This is normal, simply enter your password and press the Return when done.
For example, it should look like:
NOTE: Be sure to replace domain.com with your actual domain name. If you are not sure which IP address to use, please contact our Support Department for further assistance.
WARNING: Be sure that there is a space between the IP and the URL. Otherwise, the rule will not work.
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.