OCS Solutions Web Hosting Design and Consulting Web Hosting and Consulting Call Us
OCS Home  |  Wiki Front Page  |  Web Hosting  |  Virtual Dedicated Servers  |  Consulting  |  Support  |  Contact Us

How to use the Hosts File

From OCS Support Wiki

Jump to: navigation, search

Contents

What does the HOSTS file do?

The hosts file is a shortcut to pointing your computer to a certain server address when it goes to a specific domain name. Essentially, it lets you temporarly redirect a domain to a different server. This is handy when you haven't changed your nameservers yet but want to confirm a site works on your new hosting account.

IMPORTANT NOTE: The IP addresses listed below is strictly for demonstration. We recommend you contact support if you are unsure as to what IP to use. The IP you would use in most cases however is the one listed in your welcome letter.

Linux and MacOS X

Simply add these two lines to the /etc/hosts file (replace yoursite.com with your actual domain name):

67.15.64.79 yoursite.com
67.15.64.79 www.yoursite.com

Once you've completed these steps, you should be able to see the site now.

Windows

NOTE: The instructions work on Windows 7, Vista, XP and 2000. Both 64-bit and 32-bit versions use the same instructions.

Click Start, Run, type notepad c:\windows\system32\drivers\etc\hosts and click OK (Windows 7 and Vista users will have to press CTRL+SHIFT+ENTER instead as Vista protects the hosts file via UAC). At the bottom of the file, add (replace yoursite.com with your actual domain name):

67.15.64.79 yoursite.com
67.15.64.79 www.yoursite.com

Save the file, File-Save. Closing all browsers is recommended before attempting to go to the address.

Windows 95/98/ME

Same as Windows XP, except the hosts file is found in C:\Windows\Hosts

Personal tools