Restrict Youtube Content

This guide will show you how to implement Restricted YouTube control on the DNS Cache for ClearOS in accordance with this Google Guide.


This method is not exhaustive and has some limitations in operability due to the nature of the underlying DNSMasq service. You will be required to input current information for some domains into your hosts file and then create CNAME records in your DNSMasq cache. The reason for the host file entries is due to a limitation in DNSMasq. See the manual page for DNSMasq for more information.

Host Entries

According to the Google Doc, you need to create CNAME records for the following host names:

Due to a limitation in DNSMasq, you will need to create these as host files. You can do that in your DNS and Hosts app in Webconfig or you can modify the /etc/hosts file.

First, find the IP address associated with each hostname. For example:

ping -c 1
ping -c 1
ping -c 1
ping -c 1
ping -c 1

That produces these results (at the time of this writing): ( ( ( ( (

From this list I would make the following entries in the DNS and Hosts app or the /etc/hosts file: 
IP to hostname assignments can change regularly. This information can easily be invalidated by Google at any time and these addresses reflect only the addresses returned for just one of many on a query at the time of the writing of this article. You will need to keep these files up to date.


Now that the host entries are made, DNSMasq is able to assign CNAME records. Modify your /etc/dnsmasq.conf file and add the entries for the CNAME records at the bottom of your config file:,,,,,

Restart the dnsmasq service:

service dnsmasq restart

Now, test your entries with 'dig':

dig @localhost
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.37.rc1.el6_7.5 <<>> @localhost
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31186
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;		IN	A


;; Query time: 1 msec
;; WHEN: Mon Mar 14 13:23:49 2016
;; MSG SIZE  rcvd: 74


content/en_us/kb_restricted_youtube.txt · Last modified: 2016/03/14 19:39 by dloper