Skip to content

How to Edit Your Hosts File on Mac

pexels-lukas-574080

Follow the below instructions to update your hosts file on Mac.

1. Open Terminal

2. Type in the following command to open your host file in Terminal:

sudo nano /etc/hosts

You’ll then be asked for your user password, enter it.

Terminal will open the nano editor and it should look something like this:

3. To add a new entry, add the IP address followed by the domain. Or make other edits to the file as needed.

21.215.0.0 mydomainname.com

4. Hit CTRL + X to exit the editor and hit ENTER to save when prompted.

Posted in

Daniel Lemky

As the founder of Quantum Fire Labs, Daniel has over a decade of web and IT experience. He has worked with clients across North America and has helped them build professional and effective online business solutions.