Mac OS forum

General discussion

Blocking websites

by savanger / June 15, 2007 2:33 AM PDT

Is is possible to block a website so that it will redirect to the 404 page not found screen? I thought someone on here might know if it was possible.

Discussion is locked
You are posting a reply to: Blocking websites
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Blocking websites
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
It can be done by
by mrmacfixit Forum moderator / June 15, 2007 2:36 AM PDT
In reply to: Blocking websites

editing the HOST file.

I don't have the details right now, XP at work, but if you get no other answers, I'll check when I get to the house.


Collapse -
by savanger / June 15, 2007 6:34 AM PDT
In reply to: It can be done by

I knew it had something to do with editing host files but I don't know where to find them.

Collapse -
A place to find instructions and tips
by mrmacfixit Forum moderator / June 15, 2007 10:45 AM PDT
In reply to: Thanks

This site is the best one I can find for step by step instructions on how to edit the Hosts file in OS X
Starting from 10.3 the OS has consulted the Hosts file before going to DNS. By editing the Hosts file you can make the request end up on the local machine and display a 404 error.

I have never done this myself but it "seems" fairly straight forward if you read ALL the instructions,.

Good luck


Collapse -
block sites.
by Trapper1204 / June 22, 2007 2:11 PM PDT
In reply to: Thanks

create your custom 404 html, and name it index.html and put in your sites folder
enable websharing in system prefs.

Open Terminal
Type this

cd etc
sudo vi hosts

press i

type this on a new line the ip.of.your.machine

press esc
press :wq
press return


Popular Forums
Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


Your favorite shows are back!

Don’t miss your dramas, sitcoms and reality shows. Find out when and where they’re airing!