The /etc/hosts file on the Mac can be hard to find. Here are some tips for finding and editing it, and what you can do with it.
Where is the /etc/hosts file in Mac OS X?
The hosts file used by Mac OS X is in /etc/. Windows users sometimes have problems finding it since there’s no %SystemRoot%system32driversetc folder in the Mac OS. UNIX users might not expect /etc/ to be hidden by the Mac OS X Finder, so they often look in /Library/Application Support/.
Make sure the entry you added is properly formatted: IP address followed by a space or tab, followed by the name, then a linefeed at the end of the line. Try printing the hosts file with cat -vet /etc/hosts to make normally invisible characters visible. The line should look like '192.168.1.249^Iholub.com$' (the '^I' is a tab, and the '$' is the. Times to use the /etc/hosts A Local Network for Desktop Environments. Using the /etc/hosts file to give a human readable name to a local system within a desktop environment is perfectly reasonable. The hosts file is great to use in a home network or even in a small business environment where the machine count is only a handful of systems. $ sudo nano /etc/hosts. Step 3: Now you can edit the host file. To add a new host entry, on it’s own line enter it in the format: IP Address Host 0.0.0.0 example.domain.com. Step 4: Save the changes to your host file by pressing SHIFT + Z twice in vi. As soon as you save this file the changes you made will take effect. SUDOEDITOR=nano sudo -e /etc/hosts Using sudo -e ensures that temporary files etc. Are handled in the proper way and you don't run into permission issues with them. Nano is a simple console-based editor which is quite user-friendly. This is a downgrade as previous version, more useful the extension icon and editor soo. So much dificult to access /etc/hosts files in MAC. Uninstalling Posted by Dani - Jan 15, 2015 Reply.
Accessing /etc/hosts
/etc/ is hidden by default in the Finder. The easiest way of getting to the mac hosts file is to open /Applications/Utilities/Terminal.app. Then type:sudo nano /etc/hosts
…you will need to type in your password. Your hosts file will open in the text editor nano.
Why ‘sudo nano’?
The hosts file, in addition to being hidden, is also protected by the system. Using sudo makes the editor nano run as a super-user, which makes editing the file possible.
Adding entries to the /etc/hosts file on Mac
In nano, on a new line type the IP Address followed by at least one space or tab and then the hostname. Examples:127.0.0.1 mydevsite.local
192.168.1.222 ads.shadycompany.biz
…hit ctrl + o to Save, and then ctrl + x to Quit the text editor.
Background: What is /etc/hosts used for?
Etc Hosts Mac App Shortcut
The hosts file is a simple way of mapping IP Addresses to hostnames. It overrides mappings provided by the Domain Name System network. The hosts file is commonly used by network administrators to provide access to LAN resources when no name resolution is available. The other common usage is to block access to specified hosts by adding host entries resolving them to — for example — 127.0.0.1.
Another use for the hosts file is for easily allowing your Mac to run multiple virtual servers, mainly useful for web developers. See here for more about using /etc/hosts for Virtual Servers: Adding an entry to /etc/hosts on OS X.
Etc Hosts Mac App Free
More Resources:
http://en.wikipedia.org/wiki/Hosts_(file).