How to modify your hosts file on a mac ?

STEP 1Open the Mac's Terminal.

You may either type Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.

STEP 2 Open the hosts file for editing.

In the terminal window you just opened copy/paste the command string below, and press return.

sudo nano /private/etc/hosts

You'll be prompted to enter your Mac user's password. NOTE: you won't see the cursor move. This is normal, so press return when done.

STEP 3 Edit the hosts file by adding these two lines to the bottom of the file.


For example, it should look like:

Be sure to place with your actual domain name. If you're not sure which IP address to use, please contact our Support Department for further assistance.

STEP 4 Save your changes by pressing control-o on your keyboard then return to accept the filename. Exit the editor by pressing control-x. This takes you back to the terminal screen.

STEP 5You may need to flush your Mac's DNS cache, so copy/paste the below command string into terminal, and press return.

dscacheutil -flushcache

You may have to add sudo to this command, for example:
sudo dscacheutil -flushcache

This completes the hosts file modification, so you should now be able to see your site here with us using your domain in your browser's address bar.

When testing is complete you may undo these changes by repeating the steps above but removing the information entered in step

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Flush DNS Cache

Windows operating systems To clear DNS cache on Microsoft Windows, follow these steps: Open a...

How to run a traceroute on Windows XP/Vista/7/8 and MacOS

Running a Traceroute on Windows :1. Go to Start and choose "Run" (start button on the lower left...

How to modify hosts file on windows and linux ?

Below is how to locate and edit the hosts file on several OS platforms. Once the proper domain...

How to setup Chrome Remote Desktop

Step 1 Open Chrome Browser and Sign into Google Account. You need to be logged in to initiate or...

How to Identify a Phishing or Spoofing Email

Don’t trust the display nameA favorite phishing tactic among cybercriminals is to spoof the...