Editing your Hosts Files on Mac OS-X Operating Systems

Editing your Hosts Files on Mac OSX Operating Systems


To access your websites staging environment from your personal computer you will have to edit the hosts files on your computer. You can do this by accessing your computers terminal, then by adding the entry provided by Demac Media to allow your computer to access the staging environment.

You can access your terminal in Mac OSX operating system in one of the two following ways:

Access from search bar - Recommended 

To access your Terminal from your search bar, simply click on the search icon located at the top-right side of your screen, and start to type in Terminal. This should appear quite quickly in your search results:


Once you click on Terminal, then your terminal window will appear:


Access your Terminal from the Utilities Folder via Dock or Finder:


You can also access your Terminal from the Utilities folder found in your applications folder. To do so, start by selecting your Applications Folder either from your dock, or your finder:






Expand the utilities folder:


And click on Terminal to access your terminal:

Your terminal is a simple text window like you see below. The following steps will show you how to access your hosts-files through this terminal, and how to properly add the Demac Media Entry in order to access your staging environment:

Screen Shot 2013-07-18 at 12.59.00 PM.png

First, you need to provide a command to edit your hosts file. Do this by pasting the following code into the Terminal that you just opened:

            sudo nano /private/etc/hosts

Copy the code above into the empty space at the end of the entry like so…


…then press ENTER.

You are now prompted to input your password (login password for your computer). Do so, and click enter to gain access to your hosts file.

PLEASE NOTE that your password will not appear while you are typing it for security reasons:


You will now see your hosts file, and you want to add your Demac Provided entry(ies) as an alternate line item below the default line items like so:


A completed example can be seen below: PLEASE NOTE you may have to use the arrows on your computer to navigate the cursor, as this is a text based page.


When you are finished click Control + o to save, then press Enter, and then click Control + x to exit.

You now have access to your staging environment from your personal Mac computer.


If you do not have a password to input in step 2 above, simply create an account on your Mac by clicking on System Preferences/Users & Groups and simply create a new account. The password for the new account will be the one used in Step 2.


Written by: Jim Cover

Customer Success Manager at Demac Media 


Powered by Zendesk