How to use the Hosts File

From OCS Support Wiki

Jump to: navigation, search

Contents

[edit] 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.

[edit] 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.

[edit] Windows XP and Vista

Click Start, Run, type notepad c:\windows\system32\drivers\etc\hosts and click OK (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.

[edit] Windows 95/98/ME

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