How to Edit the Hosts File on Mac OS

Overview

Edit Hosts File Using Terminal

  • Open Terminal
  • Run following command
$ sudo vim /private/etc/hosts
Password:

NOTE!: If you still don’t get desire result, You have to Flush DNS Cache Guide.

NOTE!: If you don’t know how to use VIM, You can check VIM - An Advance Text Editor

Edit Hosts File Using Text Editor

  • Open Finder
  • Click on Finder’s Menubar
  • Click on Go > Go to Folder

Edit the Hosts File

  • In the box, type /private/etc/hosts location and press Enter. Edit the Hosts File

  • Right on hosts file and open with your favorite text editor.

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost

192.168.0.100   edytk.github.io

NOTE!: If you still don’t get desire result, You have to Flush DNS Cache

You Might Also Like

  1. How to Edit the Hosts File on Linux
  2. How to Access Staging Website Without Editing Hosts Files or DNS


Newsletter

Get updated when I create new content.
Unsubscribe whenever. Never any spam.

Note

I'm Tama. I turn down every ad, affiliate, and sponsor request I get. I write free resources that help people. If you enjoy my content, please consider supporting what I do.

Support my work