


Always add new hosts to their own unique line.The preceding IP address is where the following domain will resolve to.The following tips go beyond Mac OS X and apply to any hosts file, be it on a Mac, Windows, or Linux. Tips to Consider When Editing Hosts Files Note: the procedure is the same with older versions of Mac OS X, though the path to hosts could be /etc/hosts if the version of Mac OS X is dated significantly. If you’d like to see how this entire process is accomplished before doing it yourself, watch the video below to see a demonstration of the hosts file being modified on Mac OS X to block the website ‘’ from loading: When flushing DNS cache with that command you will need to enter the admin password. You can verify your hosts modifications immediately with ping, Safari, or any other network app.Ĭhanges take effect immediately though some adjustments may need to be accompanied by a DNS flush which can be done with the following command in macOS 10.12+ through OS X 10.9:ĭscacheutil -flushcache sudo killall -HUP mDNSResponder When finished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts, then hit Control+X to exit out of nano.Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications.
#EMACS FOR MAC OS X MOUNTAIN LION PASSWORD#
#EMACS FOR MAC OS X MOUNTAIN LION HOW TO#
We’ll walk through how to manually edit the hosts file in macOS Big Sur, MacOS Mojave, MacOS Catalina, MacOS High Sierra, MacOS Sierra, OS X El Capitan, Yosemite, OS X Lion, OS X Mountain Lion, and OS X Mavericks, this will be done with the command line using the simple text editor called nano.
