Hosts file has an essential role in website configuration. So you can make own rules about your website hosted on the Local mac running on macOS Mojave, High Sierra, EI Capitan, Yosemite or OS X Server. Point IP address to the desired website URL So you can override DNS temporary by making changes in hosts file located on Mac System. For Edit hosts file on Mac, we need little technical knowledge, and then you can do with ease. However, to edit hosts file follow the below steps carefully.
Note: Before making changes, please take backup of your host’s files or copy lines of text on to another text file. Here you have two common solutions that might be very useful on Edit hosts file on Mac OS X or OS X Server.
Steps on how to Edit the Hosts file on Mac Mojave: EI Capitan, Yosemite, Or OS X Server
Apple didn’t make any changes on the path of hosts file location and Command syntax for older OS X version. Same steps you can try on any OS X version.
Step 1: Open a Finder Window on your Mac.
Step 2: From Top menu, go to the GO > GO TO FOLDER.
Step 3: Move to Hosts files location type in the text box: /private/etc/hosts and Click on Go.
Step 4: double click on file named hosts, File will be open in the text editor.
Step 5: Inside the hosts file you can edit after broadcasthost.
Here I redirected twitter account to another website IP for my Mac only. Not work on other Mac. Before Edit file you have to make the new copy of host file, and changes will be saved to a new copy. Then you have to replace that new file with original file (/private/etc/hosts) manually. Due to privacy reason, you can’t make changes directly on original hosts file.
Second: Using Terminal, Sudo command for edit hosts file on Mac
Open terminal on Mac, Type terminal on spotlight search.
Enter Mac Admin password and press return.
Type in terminal: sudo nano /private/etc/hosts
Host file will be on screen, looks like above. Get More help on commands.
You can make changes by shortcut keys give on screen.
That’s it. Nothing else. Want more help on Edit hosts to file on Mac Mojave, EI Capitan, Yosemite or OS X Server. Share with me on the comment.
Useful: Best Dictation software for Mac