Restrict YouTube in OpenWrt

Last Modified: Wed, 15 Sep 2021 21:17:17 +0000 ; Created: Wed, 15 Sep 2021 21:17:17 +0000

You have to configure your OpenWrt DNS resolver to point the YouTube domains to restrict.youtube.com.

/etc/config/dhcp

config domain
        option name 'restrict.youtube.com'
        option ip '216.239.38.120'

config cname
        option cname 'www.youtube.com'
        option target 'restrict.youtube.com'

config cname
        option cname 'm.youtube.com'
        option target 'restrict.youtube.com'

config cname
        option cname 'youtubei.googleapis.com'
        option target 'restrict.youtube.com'

config cname
        option cname 'youtube.googleapis.com'
        option target 'restrict.youtube.com'

config cname
        option cname 'www.youtube-nocookie.com'
        option target 'restrict.youtube.com'