Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

I blocked a site, How do I Unblock it?

Hi everyone,


I used Gas Mask which and app that changes the host file to block websites and I used it to block youtube because I was spending to much time on. But I now need it for school purposes and I don't know how to reverse the block.


If anyone has any clue as to how to fix this problem please do help. It will be well appreciated.


Thank You

Posted on Oct 5, 2013 1:09 PM

Reply
Question marked as Best reply

Posted on Oct 5, 2013 5:13 PM

You hacked the system to block certain servers. The file modified is /etc/hosts.


First, I suggest you delete "Gas Mask."

The easiest way to fix the hosts file is to restore it from a backup that predates the modification, or to copy the unmodified file from another Mac. If you can't do that, then do as below. Please read this whole message before doing anything.


Back up all data. This is a simple procedure, but if you don't follow the instructions exactly, you could be left with an unbootable system. In that case, you'll have to restore from a backup or reinstall OS X.



If you have more than one user account, you must be logged in as an administrator. I've tested these instructions only with the Safari web browser. If you use another browser, they may not work as described.


Triple-click anywhere in the line below on this page to select it:

open -e /etc/hosts

Copy the selected text to the Clipboard (command-C).

Launch the Terminal application in any of the following ways:


☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)


☞ In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.


☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.



Paste into the Terminal window (command-V). A TextEdit window should open. At the top of the window, you should see this:


##

# Host Database

#

# localhost is used to configure the loopback interface

# when the system is booting. Do not change this entry.

##

127.0.0.1 localhost

255.255.255.255 broadcasthost

::1 localhost

fe80::1%lo0 localhost


Below that, you'll see some other lines. There should be nothing above the first line "##". If you have any doubt about that, STOP and ask for guidance. Make sure you scroll all the way to the bottom of the document. Scroll bars are hidden by default until you actually start scrolling, so you may not realize that you’re not seeing the whole document.


If the contents of the TextEdit window are as described, close it, then enter the following command in the Terminal window in the same way as before (by copy and paste):


sudo sed -i~ '11,$d' /etc/hosts

This time, you'll be prompted for your login password, which won't be displayed when you type it. If you don’t have a login password, you’ll need to set one before you can run the command. You may get a one-time warning to be careful. Confirm. Quit Terminal.

If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. Log in as one and start over.

That will fix the hosts file. There is now a copy of the old hosts file with the name "hosts~" in the same folder as "hosts". You can delete the copy if you wish. Don't delete the file named "hosts".

1 reply

There are no replies.

I blocked a site, How do I Unblock it?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.