
If you have any doubts, drop it in Comment Section. Video Tutorial is embedded for your Convenience. You can Block websites through Hosts File.You can Block applications while connecting to some addresses.You can add # symbol to add Comment inside the Hosts file, for future reference.You can Redirect your hostnames to desired IP addresses.Start by typing Terminal on the Spotlight or by going to Applications > Utilities > Terminal. To locate Mac hosts files location: Navigate to the Terminal application. Cancel Duplicate' The hosts file belongs to the root user and while anyone can easily open the hosts file in TextEdit, one cannot just edit it unless opened as root, as suggested in the accepted answer, although that too may have issues all these years later. You can consider few tips that can be applied to hosts file. Follow the instructions below to edit your hosts file if you are running Mac OS X.

Tips to Consider When Editing Hosts Files Now you can ping or type the URL in the browser to check. Replace original Host file with the one which you edited. Now Copy or Cut the File from the Desktop and Paste it in the Windows/System32/Drivers/Etc. Upon typing a url address on the browser, the system is checking if there is a relevant entry on the hosts file and. Open the Host file with the Notepad which you copied earlier to the Desktop.Īdd your Hostnames and IP Addresses then Save the File. Introduction The hosts file is a text file that maps hostnames to IP addresses. (You cannot be able to edit the file inside that Folder). Open My Computer and Navigate to the Primary Partition which consist of Operating System and go to WINDOWS/SYSTEM32/DRIVERS/ETCĬopy the Host File to the Desktop to Edit.

#Edit hosts file mac os x how to
Now you can ping or type the URL in the browser to check. How To Edit Hosts File In Mac OS XSierra, EL Capitan, Yosemite, Lion, Mavericks, Lion, Mountain Lion, Snow LeopardEdit host file with terminalOpen 'Te. Press Control+O followed by ENTER/RETURN key to Save the Hosts File. Tap the Down Arrow key to bring the cursor down and start adding your Hostnames and IP addresses. Type SUDO NANO /PRIVATE/ETC/HOSTS and press Enter. The first is by using TextEdit since the hosts file is a plain text document. Open Terminal from Applications/Utilities How to Edit Your Mac Hosts File with Text Edit There are two primary ways to edit the hosts file in Mac OS X.

#Edit hosts file mac os x mac os x
Now I’m going to show you how to edit Hosts file in both MAC OS X and Windows Operating System. It can be edited and you can even block host names on your own. The Hosts file is used to block certain hostnames. If you type URL in the browser, it will check the hosts file and if it is located, then it will redirect to the IP which you have provided, otherwise it will go to the IP via DNS server of your active connection. The Hosts file is a text file which has map hostnames to IP addresses.
