Redirect Webpages

in macOS edited January 2014
I'm having trouble with people at my workplace spending too much time on non-work related websites (MySpace, YouTube, etc...). Ideally, I'd like to be able to do the following, but of course, this is a Mac. I would need it to work for both Safari and Firefox


Prank your friends by redirecting there favourite site into something there not expecting!!! NOTE: Heres the written tutorial because i forogot to put audio onto the video... sorry ;( Written Tutorial: STEP 1. Find a website that your friend would NOT like to go to... STEP 2. Go to the site: STEP 3. Type in the URL you would like to direct in the "Enter a host name for Forward DNS Lookup:" box STEP 4. Press look it up, and copy the IP address down. STEP 5. Click on "Start" ---> "Run" and type in "notepad c\windows\\system32\\drivers\\etc\\hosts" STEP 6. On the last line paste the ip address, press tab and type in the URL your friend will visit STEP 7. Save and test Once he goes to the website he wishes, it will redirect into the website you set it to Hope this prank goes well!

Failing that, is there a simple way of just blocking websites from the OS and only allowing administrator access to bypass these?


  • Reply 1 of 1
    MarvinMarvin Posts: 14,223moderator
    Macs have a hosts file in /etc/hosts.

    You can get here using the Finder Go menu > go to folder and type /etc.

    Then copy the hosts file somewhere like the desktop. Open it in textedit and add a new line per blocked host. The first entry is the destination so if you wanted to block youtube, you would add the line at the bottom:\tlocalhost\tbroadcasthost

    ::1 localhost\

    and save the file. You need to move this saved file back into /etc/hosts to take effect.

    Move the hosts file in there to trash and authenticate your password. Then hold alt and drag the new hosts in and authenticate. This will copy instead of moving so you can make additional changes.

    Sometimes you have to refresh a couple of times to get it to work but it should have blocked saying it can't find the server.

    One flaw is that with sites like youtube, they have a whole list of domains so if you block, they can still access The hosts file doesn't allow wildcards (e.g *.youtube.*).

    This process can also be quite painstaking if you have a lot of machines to block but if you have network access to them all, it's maybe not that bad.

    It would be easier if your router had a URL blocking feature on it. You could also setup a DNS server on say your own computer and have the others access your DNS server:

    It's a bit complicated though. That method and the router method allow you to update the blocked URLs more easily - the DNS server supports URL wildcards.

    It might be easier for workers to remove the DNS URLs though than know what a hosts file is.
Sign In or Register to comment.