how to edit host file in mac using terminal code example Example: edit hosts file mac terminal sudo nano /etc/hosts