![mac os x hosts file mac os x hosts file](https://cdn.osxdaily.com/wp-content/uploads/2016/01/edit-hosts-file-textedit-mac-os-x1-610x375.jpg)
Finally, to update our browsers DNS records and make these changes go live in your browser, enter the following command: sudo killall -HUP mDNSResponder Conclusion Now, press Control+X to exit the nano editor.ġ0. Next, press Control+O to overwrite the existing file, then press Enter to confirm the overwriting. (In the example below, we used the IP address 123.123.123.123 and the domain name )Ĩ. This little text file actually holds a major control over internet access.
![mac os x hosts file mac os x hosts file](https://i0.wp.com/techdirectarchive.com/wp-content/uploads/2020/04/screenshot-2020-04-06-at-14.01.41.png)
MAC OS X HOSTS FILE MAC OS X
On a new line, enter the testing server's IP address and the domain name you want to use for that IP address. Editing a Host file on Mac OS X would allow users to point the user towards a specific web site while a web address is put on the address box, or block the website from being accesses on a certain Apple Mac computer. Next, use the arrow keys to move the cursor to the bottom of the file. Then, enter the sudo password for your user to allow edit access to the file.ħ. Now, enter the following command: sudo nano /etc/hostsĦ. Double-click Terminal to launch the Terminal window.ĥ. To edit the file, follow the steps below.ġ. We've included step-by-step instructions for locating the Hosts file, but you can also watch this video:īut where is the Hosts file on our Mac located, and how do we edit it? The Hosts file on a Mac is found in the /etc/hosts folder. To locate the Hosts file on Mac: Select Go Go to Folder from the Mac menu bar Type in /private/etc/hosts Click Go You should end up within the 'etc' folder and have the Mac Hosts file highlighted. This allows us to test functionality without modifying the DNS for our production site. As long as that information is contained in your Hosts File, your browser will redirect the request to display the site on the specified IP address. To make your computer display your test website rather than the live site, you must add the test site's IP address, along with the domain name, to the Hosts File. While most users will never need to alter their Hosts File, a web developer or user may need to modify the file to view a new site that is still under development. The Hosts File is an essential tool to change how your computer views a particular website.