Resetting the Hosts File (Blocking)

ActivTrak allows administrators to block websites they do not want users accessing.  




In order to do this, we make changes to the host file saved on every Mac and PC and use a routing service for the Chrome agent.

Some Anti-Virus agents will prevent ActivTrak from writing to these host files as that can potentially be a security vulnerability. While whitelisting ActivTrak (steps to do this can be found here: will prevent this in most scenarios, it may be necessary to manually remove any blocked websites from this file if your Anti-Virus is preventing the agent from writing to the hosts file.



On PCs the hosts file can be found in C:\windows\system32\drivers\etc



if we open the hosts file, we'll see the following:



Everything in-between "Begin ActivTrak" and "End ActivTrak" are domains that have been added to the block list on and will be blocked by the agent.


Per Microsoft, these are the steps for resetting the hosts file back to default:


  1. Open Notepad. To do this, search for “Notepad” using Cortana, and then tap or click the Notepad icon.

  2. Copy the following text, and then paste the text into the file:
    # Copyright (c) 1993-2006 Microsoft Corp.
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    # For example:
    #          # source server
    #              # x client host
    # localhost name resolution is handle within DNS itself.
    #       localhost
    #       ::1             localhost 
  3. On the File menu, select Save as, type "hosts" in the File name box and then save the file to the desktop.
  4. Close Notepad.

  5. Search for %WinDir%\System32\Drivers\Etc using Cortana, and then select the File folder icon.

  6. Tap and hold or right-click the Hosts file, select Rename, and then rename the file as "Hosts.old".

  7. Copy or move the Hosts file that you created in step 3 from the desktop to the %WinDir%\System32\Drivers\Etc folder. If you are prompted to enter an administrator password, select Continue.



To modify the hosts file on a Mac, we will need to use Terminal.

We'll start by entering sudo nano /etc/hosts and entering the admin password when prompted.

Note: When entering your password in terminal, you will not see the characters appear inside Terminal.




 The highlighted section shows the domains currently being blocked by ActivTrak. 



Next, move the cursor (using the arrow keys) to the lines we want to remove.  



Press Control + K and that line will be removed. Repeat for each desired deletion.

After this is completed, press Control+X and you will be prompted if you want to save your changes.




Enter "Y" for yes and the hosts file with be modified to reflect those changes.


The Chrome Agent is the easiest to reset the hosts file for. 

Simply open your Chrome browser and navigate to chrome://extensions and locate the ActivTrak extension, then click on "Remove".



Was this article helpful?

0 out of 2 found this helpful


No comments