Home » Helpdesk » IT Support » How to Create a Host File Entry

How to Create a Host File Entry

Your hosts file is a small, but important text document that has the ability to map hostnames to specified IP addresses. Although the modern Internet uses a variety of public and private DNS servers to map IP addresses, the hosts file is a handy way to override those DNS servers, allowing you to manually point a website address to a desired IP address, or block access to a site altogether by pointing to an unused or internal IP address.




Mac

Mac host are located in "/private/etc/hosts"


To edit host files on a mac downlad this preferences panel that give a graphical interface for host file entries

https://github.com/downloads/specialunderwear/Hosts.prefpane/Hosts-1.2.pkg




To add a new hosts entry 

1) click the "+" button at the bottom of the window


2) enter the IP of the server


3) enter the domain you wish to point to this IP


4) save


To disable the host file entry, uncheck the box under the Use column.


Windows

1) Navigate to C:\Windows\System32\drivers\etc


2) Open hosts file with Notepad or a text editor


3) Add a line break space under this text in the hosts file

127.0.0.1 localhost
::1 localhost


4) Create hosts entry in this format

[IP address] [domain]

[IP address] www.[domain]


Example:

50.62.188.213 websightdesign.com

50.62.188.213 www.websightdesign.com


5) save the hosts file


To disable the host file entry add a # to the front on the entry like so:

# 50.62.188.213 websightdesign.com

# 50.62.188.213 www.websightdesign.com


 Or delete the entry from the host file entirely