Jan 11, 2009 1:43 PM
Back in November (2016) we wrote an article on how to edit your hosts file on your Windows computer. In that article we covered a few things such as what a hosts file is and why you should make changes to your computer’s hosts file.
How to Edit Hosts File on Mac. By editing Mac hosts file, it’s possible to emulate DNS change and set the desired IP for a domain name. With the hosts file you can overwrite any DNS values set by your Internet service provider. This is helpful if your domain name is not yet registered or not pointed to a hosting account, but you want to preview your website. In case the hosts file does not save, we overwrite the content, the user moved that hosts file to the desktop or another directory to edit. Then copy to the etc directory to overwrite the existing hosts file. Method 2: Edit the hosts file on the Mac via Terminal. For Mac OS, we have more ways to fix hosts file via Terminal. Editing the Hosts File on a MAC. To edit the host file, you must first open it by double clicking it. You will notice that it is a simple file that contains just a few lines of text and characters such as pound and hash tags. The file also list the IP address of the localhost and broadcasthost. Before making changes on the hosts file. The computer file hosts is an operating system file that maps hostnames to IP addresses.It is a plain text file. Originally a file named HOSTS.TXT was manually maintained and made available via file sharing by Stanford Research Institute for the ARPANET membership, containing the hostnames and address of hosts as contributed for inclusion by member organizations.
For those of you who haven’t read that article, a hosts file is a file on your computer that allows you to map hostsnames to IP addresses. In simpler terms, it can give you the capability to test a website on a new IP before updating the DNS on that domain. For example, we use this process and prefer it over temporary URLs here at PeoplesHost for testing purposes when migrating new customers over to our environments. This allows us to test the website after it has been migrated to make sure there are no errors and the website is displaying properly.
Changing the hosts file on a MAC computer is a fairly straightforward process for anyone that has used Terminal (or any other similar command line application or tool). If you haven’t used Terminal before this process will be new to you, but don’t be afraid because this tutorial is beginner friendly.
If you have any questions about this process don’t hesitate to reach out to support.
Looking for reliable Windows or Linux hosting with Award Winning Customer Support?
Grab your hosting today with a 20% discount. All plans come with our 60 Money Back Guarantee!