• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Enable youtube restrict mode for some users using DNS Resolver?

Scheduled Pinned Locked Moved DHCP and DNS
2 Posts 2 Posters 80 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    aGeekhere
    last edited by 4 days ago

    I am trying to have some users use restrictmoderate.youtube.com in the DNS Resolver
    So far i have tried

    # Access control view definitions:
    # These rules assign client IP addresses to specific views.
    # Clients matching these IPs will use the "unrestricted-youtube" view.
    # All other clients will fall into the default view, which we'll configure as "restricted-youtube".
    access-control-view: 192.168.1.100/32 unrestricted-youtube  # Example: Single IP (e.g., your admin PC)
    
    server:
        # Global server options (from default config)
        local-zone: "use-application-dns.net" always_nxdomain
        include: /var/unbound/pfb_dnsbl.*conf
    
        # Define the 'restricted-youtube' view
        # This view will be the default for clients not explicitly assigned to 'unrestricted-youtube'.
        view: "restricted-youtube"
            # Force YouTube Restricted Mode (Moderate) for these clients
            # Pointing YouTube domains directly to the restrictmoderate.youtube.com IP (216.239.38.119)
            local-data: "youtube.com A 216.239.38.119"
            local-data: "www.youtube.com A 216.239.38.119"
            local-data: "m.youtube.com A 216.239.38.119"
            local-data: "youtubekids.com A 216.239.38.119"
            local-data: "youtubego.com A 216.239.38.119"
            local-data: "ytimg.com A 216.239.38.119"
            local-data: "youtu.be A 216.239.38.119"
            # Additional domains for comprehensive coverage
            local-data: "youtubei.googleapis.com A 216.239.38.119"
            local-data: "youtube.googleapis.com A 216.239.38.119"
            local-data: "www.youtube-nocookie.com A 216.239.38.119"
    
        # Define the 'unrestricted-youtube' view
        # Clients assigned to this view will have normal (unfiltered) YouTube access.
        view: "unrestricted-youtube"
            # No local-data for YouTube domains here, so they will resolve normally via upstream DNS.
            # This view inherits all global server settings not explicitly overridden here.
    

    and

    access-control-view: 192.168.1.100/32 unrestricted_youtube
    access-control-view: 0.0.0.0/0 restricted_youtube
    
    view:
        name: restricted_youtube
        view-first: yes
        local-zone: "use-application-dns.net" always_nxdomain
        local-data: "youtube.com A 216.239.38.119"
        local-data: "www.youtube.com A 216.239.38.119"
        local-data: "m.youtube.com A 216.239.38.119"
        local-data: "youtubekids.com A 216.239.38.119"
        local-data: "youtubego.com A 216.239.38.119"
        local-data: "ytimg.com A 216.239.38.119"
        local-data: "youtu.be A 216.239.38.119"
        local-data: "youtubei.googleapis.com A 216.239.38.119"
        local-data: "youtube.googleapis.com A 216.239.38.119"
        local-data: "www.youtube-nocookie.com A 216.239.38.119"
    
    view:
        name: unrestricted_youtube
        view-first: yes
        local-zone: "use-application-dns.net" always_nxdomain
    

    With issues as i am not sure if view is fully supported.

    I do not want to bypass the DNS Resolver as i have other host overrides i want users to use.

    Am i close ?

    Never Fear, A Geek is Here!

    G 1 Reply Last reply 4 days ago Reply Quote 0
    • G
      Gertjan @aGeekhere
      last edited by 4 days ago

      @aGeekhere

      When I read several "unbound access-control-view" I'm pretty certain that "access-control-view:" needs to be placed in a server: block :

      server:
           access-control-view: 192.168.1.100/32 unrestricted_youtube
           access-control-view: 0.0.0.0/0 restricted_youtube
      ....
      

      What I'm not sure about : you use IPs fro youtube resources.
      This :

      local-data: "youtube.com A 216.239.38.119"

      might be true for one moment, and the next moment it's another IP, as Youtube uses many (like : a lot) of IPs so they can do load sharing, prtect against DOS, update/upgrade their servers in real time.
      And : protect themselves against people that try to limit the access to their services ^^

      No "help me" PM's please. Use the forum, the community will thank you.
      Edit : and where are the logs ??

      1 Reply Last reply Reply Quote 0
      1 out of 2
      • First post
        1/2
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
        This community forum collects and processes your personal information.
        consent.not_received