Download
Option 3 – How to Edit Hosts File on Mac. If you want a quick and easy method, we recommend checking out Gas Mask. It’s a free application which can be used as hosts file manager, hosts files editor, and switch between them. Otherwise, you can follow the steps below to edit your hosts file on Mac manually. Sudo -b /Applications/TextEdit.app/Contents/MacOS/TextEdit. Open /etc/hosts in this new TextEdit instance using any of the following methods: Append the path to the end of the previous command. Use File → Open. Drag the file to the sudo'd TextEdit on the Dock. Alternatively, you can edit in Terminal using nano. Edit Hosts File. Open the Terminal application. You may either type Terminal in the Spotlight search or by navigating to Applications, then the Utilities folder, then click on the Terminal app. Open the hosts file for editing. In the terminal window you just opened copy/paste the command string below, and press return.
Mac Change Hosts File
- In order to access sites locally you need to edit your hosts file. Add a line to the bottom of this file for your virtual host. It should match the value you used for the ServerName configuration. For example, my site: 127.0.0.1 jasonmccreary.local. I like to run the following to clear the local DNS cache: dscacheutil -flushcache.
- This is actually a compilation of answers and my own expirience. So, get/install a copy of ADB, then type. Adb devices -l # make sure your gadget is listed adb shell # run a shell there su # become the root (don't miss confirmation request!) mount -o rw,remount /system # allow to write vi /system/etc/hosts ## edit the file in place - do what you whant, then:wq ## mount -o ro,remount.
Release binaries can be downloaded from GitHub or CodePlex.
Features
- Cut, copy, paste, duplicate, enable, disable and move one or more entries at a time
- Filter and sort when there are a large number of host entries
- Enable and disable entire hostsfile from application or tray
- Archive and restore various hostsfile configurations when switching between environments
- Automatically ping endpoints to check availability
main editor screen with optional archive visible on right
tray icon with context menu
Usage Notes
Edit Hosts File Mac App
![Edit Hosts Mac App Edit Hosts Mac App](/uploads/1/3/4/1/134119384/876583106.jpg)
By default the application closes to the tray. To exit completely you must select Exit from the File menu or tray context menu. Only one instance of the application is allowed at a time. If you try to open it again it will just activate the previously running instance.
When selecting rows to move, delete, copy, or cut be sure to select the entire row using the row header cell. If no entire rows are selected, cut, copy, paste, and delete apply individually to the selected cells.
Using the filter and sort while editing is quirky. The filter and sort are applied once a cell is edited so your cell may change positions or disappear depending on the current sort and filter.
Build
Requires Visual Studio 2017 or newer. To build the installer you must have WiX Toolset 3.7+.
Run
build-release.bat
or build-debug.bat
.The binaries and setup file will be copied to the
bin
directoryLicense
Equin.ApplicationFramework.BindingListView is by Andrew Davey and licenseterms can be found athttp://blw.sourceforge.net/.
Icons are from the Open Icon Library and their license and terms can be found athttp://openiconlibrary.sourceforge.net/.