Question:
How do I block a website on my mac?
dreamcatcher13
2011-02-25 09:34:24 UTC
I've looked on here for an answer, I've tried using the terminal but it didn't block the website. I tried going through my parental controls and that also didn't do it? I'm trying to block Facebook if that helps? I'm no genius on this, but I'm running Mac OS X version 10.6.6.
Please help, I'd like to get this finished before school lets out.
Three answers:
anonymous
2011-02-25 09:58:10 UTC
log on to your router and block it from there.



Im a PC, not a MAC but i know networks, and you can block sites from the router the source.



or



you can edit the MAC's host file by putting in this entry: 127.0.0.1 www.facebook.com

This will point anything facebook to the local system therefore rendering the site unaccessable.

Steps below.



Editing the hosts file



Editing the hosts file in Mac OS X – Leopard, is a pretty easy task, especially if you are familiar with the terminal.



Step 1 – Open the Terminal.app



Either by start typing Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.



Step 2 – Open the hosts file



Open the hosts by typing on the Terminal that you have just opened:



view sourceprint?1 $ sudo nano /private/etc/hosts



Type your user password when prompted.



Step 3 – Edit the hosts file



The hosts file contains some comments (lines starting with the # symbol), as well as some default hostname mappings (e.g. 127.0.0.1 – localhost).

Simply append your new mappings underneath the default ones. Or edit one of the default values if you know what you are doing!

You can navigate the file using the arrow keys.



Step 4 – Save the hosts file



When done editing the hosts file, press control-o to save the file.

Press enter on the filename prompt, and control-x to exit the editor.



Step 5 – Flush the DNS cache



On Leopard you can issue a simple Terminal command to flush the DNS cache, and have your host file changes to take immediate effect:



You can now test your new mapping on the browser!
?
2011-02-25 10:00:03 UTC
If your using a school computer they likely have a special hidden program that resets the computer back to the way it was before you started messing with it.



If you have admin access to the computer and it's yours, you can use the free TextWrangler to "open file by name" and use "/etc/hosts" as the filename. (no quotes)



When /etc/hosts open, at the very bottom (don't touch what you see there!) add only:



0.0.0.0 www.facebook.com





Then save the file using the admin name and password and quit.



The computer will refuse to connect to Facebook.





Note: using 127.0.0.1 causes issues on OS X and Terminal editing programs have a lot to be desired, don't work as expected. TextWrangler is free and very GUI friendly, allows copying and pasting, other abilities to edit system files.
stallard
2016-12-02 04:49:51 UTC
particular, in case you decide directly to place in some content fabric filtering utility on your laptop that runs OS X you're able to do this. Or in case you basically choose to block some particular web content, you're able to do this extra somewhat on your router. i do no longer think of OS X comes with any content fabric filtering utility out of the container however, if that's what you needed to be attentive to.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...