YouTube has an amazing, but not well known, mode that allows you to block access to unsafe (adult or violent) videos and block comments. Learn more about the YouTube Restricted and Moderate Modes.

YouTube Restrict and Restrict-Moderate

YouTube provides a way for parents and schools to enforce a children friendly mode on all browsers and devices using your network. That’s done by enabling the Restrict.YouTube (or Restrict-Moderate.YouTube) filter to all YouTube domains – that can’t be undone at the browser level. It means you can be more confident that the kids won’t be seeing adult content or reading the comments on the videos they are watching.

If you are using CleanBrowsing, we enforce YouTube’s Restrict-Moderate mode automatically on our Family Filter and you do not have to take any of these steps.

Configuring Restricted YouTube DNS

YouTube Restrict works by re-mapping YouTube IP addresses to the CNAME (or It means that instead of visiting YouTube at their normal IP addresses, you will re-route the traffic to a special load balancer provided by Google that will block access to non children friendly videos. YouTube offers two modes: More strict mode. It blocks access to videos with violence, language, sexuality or adult content. It is the closest to the YouTube Kids mode. Blocks comments. Recommended for kids under 12. Less strict mode. It blocks access to videos with possible violence, sexuality or adult content. It also blocks comments.

You can choose the filter that fits your needs the best. Note that for the following steps, you will either have to use the IP address for the restrictmoderate filter or

Re-mapping via /etc/hosts

The first way to do that is via the /etc/hosts file on your Mac or Linux (or \WINDOWS\system32\drivers\etc\hosts on Windows). That file overwrites the IP address of any domain added to that file. You have to open it and append the following lines at the bottom of it:

If you add those 5 entries above, you will force the restricted mode. To verify it is working, save the file and go to to check that you can’t see comments or any more adult video.

Re-mapping at your router

Re-mapping at your router can be a bit more difficult. You have to login to your router, and find the DNS and Domain mapping option (It might be under DHCP or Settings on some router versions). Once you find the place to map domain names, you will have to add the IP address as the map for,,, and

Safe YouTube

Kids spend quite a bit of time on YouTube, so it is critical to block access to some of the dirty content that is in there. Try these steps above and see if they work for you. Another option is to use CleanBrowsing, as we deal with it automatically.