How to Edit the Hosts File on Your Mac

Editing the hosts file on your Mac allows you to test your site before it goes live. Launch Terminal, copy and paste the following command:

sudo nano /etc/hosts

Add the IP address (example: 123.45.67.89) of the site’s server follow by the domain name:

123.45.67.89 visualgui.com

Save the file by pressing Ctrl+O then exit with Ctrl+X.