Edit hosts file mac lion terminal

How To Edit Hosts File In Mac OS

To do this, type the IP address you wish to assign followed by a hostname. Now, whenever we try to go to www. Alternatively, you can enter the IP address of a valid site instead of 0.

Making Changes

For example, The New York Times website at www. You can add as many entries to the hosts file as you wish by entering new mappings on each line.

How to edit your hosts file on Mac and Windows

To flush the DNS cache on your Mac, open Terminal and use the following command sudo enables you to run this command as the admin of your machine :. The steps in the previous section are easy enough, but if you want to avoid copying the hosts file you can edit it directly in Terminal using the UNIX Nano Text Editor, which is built into macOS. To get started, launch Terminal, type the following command, and press Return.

To navigate and edit the file, use the arrow keys on your keyboard.

Just as we did with the TextEdit method, above, we can add, edit, or remove hostname mappings at will. Because we launched Nano using sudo, any changes will be authenticated and saved directly to the original hosts file, without the need to copy it outside of its home directory.


  1. How to Edit Your Mac's Hosts File & Why You Might Want To - AppleToolBox.
  2. install mac os x leopard on virtualbox.
  3. How to use the "hosts" file?.
  4. bot removal software for mac;
  5. Knowledgebase!
  6. How to edit your Mac's hosts file and why? Tips & tricks!
  7. enable java plugin chrome mac!

Our examples mentioned blocking and redirecting distracting sites in a work environment. You can also use these steps to manually block access to malicious websites or, of course, to play a prank on friends and family members.

How To Change Mac Hosts File Right Now – Setapp

Then Y key to save the changes and Enter to accept the default file. Delete the information that you added previously, then close and save the file. Please select a product. A hosts file is a plain-text file used by your Mac or Windows computer to map hostnames such as Autodiscover to IP addresses and is useful when you are unable to modify or access your DNS control panel. Open the hosts file as described above. Was this article helpful?

How to Edit the Hosts File in OS X

Please let us know how we can improve this FAQ article Submit. SherWeb's Solution. Follow us. Follow SherWeb.


  • Apple OS X Snow Leopard & Leopard.
  • Subscribe to RSS?
  • oki c5650 driver mac lion.
  • java applet download mac 10.8.
  • SherWeb on. Our Partners. Site Links Contact Us Legal.