16 Apr 2024 
Support Center » Knowledgebase » Web Hosting Services » How do I modify my computer's hosts file?
 How do I modify my computer's hosts file?
Article Microsoft Windows

1. Go to Start > Programs > Accessories
2. Right click on Notepad and select Run As...
3. Select to run the program as Administrator.
4. Open My Computer.
5. Navigate to Windows > system32 > drivers > etc
Sometimes it may show a notice saying the files are hidden. Click to show the files.
6. In the etc folder, open the 'hosts' file using Notepad.
7. On a new line, enter the IP and hostname that you want to create an entry for. Such as:
184.12.34.567  example.com
Note: Entering example.com will NOT direct www.example.com to that IP. To do that, you would need to make another entry such as:
184.12.34.567 www.example.com
8. Click Save.
9. To check that the hosts file has been modified correctly, you will need to ping the hostname:
10. Go to Start > Run...
11. Type cmd and press Enter
12. The Command Prompt window will pop up. Type in:
ping example.com
13. Press Enter
14. If the correct IP shows up then you have edited the hosts file correctly.

Mac OS X

1. Go to Applications > Utilities > Terminal
2. The Terminal program window should pop up. Type in:
sudo nano /etc/hosts 
3. Press Enter
4. When prompted, type in the administrator password and hit Enter.
5. Use the arrow keys to navigate. On a new line, enter the IP and hostname that you want to create an entry for. Such as:
184.12.34.567  example.com
Note: Entering example.com will NOT direct www.example.com to that IP. To do that, you would need to make another entry such as:
184.12.34.567 www.example.com
6. When you are done making changes, hit Ctrl+O to save changes. When it prompts you to enter a file name, hit Enter to keep the current name.
7. Hit Ctrl+X to return to the prompt.
8. To check that the hosts file has been modified correctly, you will need to ping the hostname. Type:
ping example.com
9. Press Enter
10. If the correct IP shows up then you have edited the hosts file correctly.


Article Details
Article ID: 284
Created On: 14 May 2014 12:39 PM

 Back
 Login [Lost Password] 
E-mail:
Password:
Remember Me:
 
 Search
 Article Options
Home | Register | Knowledgebase | Troubleshooter | News | Downloads
Language:

Help Desk Software by Kayako SupportSuite v3.60.02