Modifying local Hosts file

  • Launch Terminal, type sudo nano /private/etc/hosts and press Return. You’ll need to also enter your admin password to execute it, as with all sudo commands.
  • You will now have the hosts file open in the Nano editor. Use the arrow keys on your keyboard, to navigate and edit the file.
  • Like with the Windows method above you should just add the desired IP followed by the host name (or domain name).
  • Press Control-O to save the file.
  • Use your Web browser to test the changes and flush the cache with dscacheutil -flushcache if they still haven’t taken into effect.