You can re-enable SIP afterwards if you want. If you want to modify your hosts file, you have to disable SIP. This is how you edit the hosts file Jon, a prerequisite is not encouraging anything. Shame for encouraging it for something as simple as editing a hosts file. Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below. While the aforementioned approaches work in all modern versions of Mac OS X, earlier versions of Mac OS X can also launch the TextEdit binary with hosts directly from the command line with the following syntax. The trick is largely the same as Text Edit, still requiring the use of sudo, but changing the specified application name as follows. This is necessary for modern versions of Mac OS X, though you can choose to edit the hosts file using the command line with nano as described here without adjusting SIP. An incorrectly formatted hosts file or improper entry can lead to DNS issues and problems with various internet services. This offers a more user friendly option compared to going through the command line.
Many users edit and modify the hosts file so that they can point a domain to a different IP address, whether for the purpose of local development, blocking sites, or simply to access alternate servers from various apps and system level functions.