How to block YouTube without getting blocked to Google in Pfsense


Blocking YouTube is a hard thing when you really need to do it in a Pfsense gateway. Although you block it using the Squid, Squid-guard or whatever URL blocking mechanism in Pfsense still YouTube will be accessible via   HTTPS and there is no other way than blocking this via the Pfsense firewall. So here is the deal when you block it using the firewall you will lose access to Google.com as well. So How to block YouTube without getting blocked to Google. We are going to achieve this using the DNS resolver service in Pfsense

Here are the Steps it’s pretty easy

STEP 1

Open Pfsense web interface and under “Services” click on “DNS Resolver”


STEP 2

Under Host Overides click on the plus mark and enter the Following:
  • HOST : www
  • Domain: youtube.com
  • IP address : xx.xx.xx.xx (Any IP address - Fake - that is out side your local network address – Eg: 192.168.100.100)
  • Description : any (Eg: YouTube Block)
Click save in both places and test it and you are done !

29 comments:
Write comments
  1. And how i allowed 5 user youtube

    ReplyDelete
  2. How can i allow some ip or user to access youtube?

    ReplyDelete
    Replies
    1. Let me do some research and get back to you soon!

      Delete
    2. It seems that there is no other way. The only way is changing the DHCP settings to real DNS addresses for the users who needs access to you tube.

      Delete
  3. Hi
    i still can't block youtube. please help

    ReplyDelete
    Replies
    1. can you send me your configurations

      Delete
    2. how can i block video streaming only from facebook but not blocking the facebook

      Delete
  4. Took 2 minutes. Great and thank you. The kids hate me now.

    ReplyDelete
  5. still can't block youtube, pls help

    ReplyDelete
    Replies
    1. Your clients Should have the first DNS address to your pfsense gateway IP address

      Delete
  6. hi ...

    your idea is good, bu, what happen if i like to permit an a user or group of user to reach youtube ...how can i do that ???, because your solucution is to every body into lan .....

    could you help me with that

    thanks for your post and i hope you can auxiliary me.

    best regards.

    ReplyDelete
    Replies
    1. Yes - if you would like to permit the users then set their DNS to actual DNS in their DHCP settings then they will be able to access You Tube. that is how I am doing . By the way upgrade your pf sense to 2.3.3-RELEASE-p1, then you can block you tube even Https via Squid filter

      Delete
    2. Thanks for the info sir! just to make it clear, with pfsense 2.3.3, I don't need to block using DNS resolver? I can just do it through squid filter?

      Delete
  7. I have a main DNS server on a windows 2012 box and a working DNS RESOLVER on my PFSENSE box. Like VirtualResh states adjusting your DHCP settings all my users that are allowed Youtube, dns through the windows dns and the non-allowed users go through the resolver dns which blocks Youtube.

    ReplyDelete
    Replies
    1. This is the idea- Correct - what I do is instead of another DNS server I point it to a actual DNS IP like google for those who requires access to You tube. Thanks

      Delete
  8. how can i block video streaming only from facebook but not blocking the facebook

    ReplyDelete
    Replies
    1. Find out the video streaming URL from FB and block it - Most of the time it will be YouTube only-

      Delete
  9. did it also work with DNS forwarder ?

    ReplyDelete
  10. thanks i have been looking for this for ages

    ReplyDelete
  11. A guide for uploading your own video onto YouTube. This article will show several steps on how to create a video and upload it onto YouTube. youtube french

    ReplyDelete
  12. Hello everyone, Can someone elaborate me more on how to set the client DNS to Actual DNS through DHCP setting?, Would be thankful

    ReplyDelete
  13. A great content material as well as great layout. Your website deserves all of the positive feedback it’s been getting. I will be back soon for further quality contents. Cheap YouTube Services

    ReplyDelete