Editing your host file

The "Hosts" file in an operating system is used to associate host names with IP addresses. A series of steps are used when searching for IP addresses that go with these host names. The first step, and the one that concerns us here, is the hosts file on your local computer. The Hosts file tells your computer what the name is in numbers so the computer can go find it. If the IP address is found in your Hosts file, the computer will stop looking and go to.

There are instances where you would need to edit your host file. If that need arises, you can follow the step-by-step procedure stated below:

For Windows:
1. Right click on Notepad or Notepad++ and select Run as administrator
2. Select File > Open > and browse to c:\windows\system32\drivers\etc\hosts
3. Once the 'hosts' file is open, you will see a commented description of the file in the first few lines and then below you will see an example on how to use it. The content of the file is actually divided into two columns. the "IP" column and the "domain" column.
3. Fill in the host file with the appropriate IP and domain information that you want to add.
4. Save the file.

For Mac:
1. Open "Terminal" Application under Application -> Utilities.
2. Once the terminal window is open, type "sudo vi /etc/hosts".
3. System will then ask you for your password, Input your password.
4. The file will then be opened by the "vi" editor. You will see a commented discription of the file in the first few lines and then below you will see an example on how to use it. The content of the file is actually divided into two columns, the "IP" column and the "domain" column.
5. To add another line, go to the last line and press "i" (insert).
6. Input the appropriate IP and Domain you wish to add.
7. When finished, press "Esc" key once.
8. On the bottom left part of the terminal console you will see a ":" (colon).
9. Type "wq", (write and quit) then press the "Enter" key.
10. Once back to the prompt, type "exit".

For Linux/Unix:
1. Open the "/etc/hosts" file using a text editor of your choice.
2. Add the necessary information on the hosts file.
3. Save file. 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Accessing A Preview Of Your Site Or Temporary URL

Plesk provides a quick easy way to access your website on a temporary url. This is useful if you...

Checking DNS Records

How do I check DNS records? You can check your DNS records on dnsstuff.com by using the...

Disabling mail service/web service

You can disable either or both services from your Control Panel.To disable Web Service1. Login to...

Flush your DNS cache

The huge volume of requests generated by a system like DNS, the designers wanted to provide a...

What is rDNS (Reverse DNS)?

If DNS is used to translate human-readable Internet addressses (www.fluidhosting.com) into...