𝔩𝔢𝔩𝕠𝔭𝔢𝔷
Theme

Homelab

Content Filtering

Configuring Content Filtering in UniFi: CyberSecure for Restricted VLANs

Overview

This article configures DNS-based content filtering for Restricted VLANs using UniFi's CyberSecure feature. You'll create a filter policy that blocks inappropriate content categories, enables ad blocking, and enforces safe search on major search engines. All filtering happens at the network level - no client software required.

Before You Begin

Prerequisites

What We're Setting Up

FeaturePurpose
Content CategoriesBlock adult, malware, gambling sites
Ad BlockingRemove ads network-wide
Safe SearchEnforce on Google, Bing, YouTube

How CyberSecure Works

CyberSecure intercepts DNS queries from devices on the filtered VLANs. Queries are checked against blocklists (partnership with NextDNS). Blocked domains return NXDOMAIN, preventing the connection.

StepWhat Happens
1Device requests example.com
2UDM intercepts DNS query
3Domain checked against blocklist
4Allowed: Return real IP
4Blocked: Return NXDOMAIN
Note:DNS filtering can be bypassed with DNS-over-HTTPS (DoH) or VPNs. For determined users, consider device-level controls as well.

Create Filter Policy

Navigate to Settings → CyberSecure → Content Filtering.

Create New Policy

Click Create New Policy and configure:

NameNetworks
Restricted FilterRestricted-Trusted (40), Restricted-Isolated (45)

Category Selection

Enable blocking for these categories:

CategoryReason
Adult ContentAge-inappropriate material
MalwareSecurity protection
PhishingSecurity protection
GamblingAge-inappropriate
DrugsAge-inappropriate
WeaponsAge-inappropriate
Tip:Start with fewer categories and add more based on what gets through. Over-blocking creates frustration and workarounds.

Ad Blocking

In the policy settings:

  1. Enable Ad Blocking
  2. This blocks known ad-serving domains
Note:Ad blocking may break some free services that require ads. Add exceptions as needed.

In the policy settings:

  1. Enable Safe Search
  2. This enforces safe search on:
    • Google
    • Bing
    • YouTube (Restricted Mode)
    • DuckDuckGo

Add Exceptions

Some educational or entertainment sites may be incorrectly categorized. Add exceptions as needed.

Allow Specific Domains

Navigate to Settings → CyberSecure → Content Filtering → [Restricted Filter] → Exceptions.

Add allowed domains:

DomainReason
example.eduSchool website
educational-game.comApproved game

Block Specific Domains

You can also explicitly block domains that aren't in categories:

DomainReason
time-waster.comProductivity

Verify Content Filtering

Test Blocked Category

From a device on Restricted-Trusted:

  1. Try accessing a known adult site
  2. Should see "This site can't be reached" or similar DNS error

From a device on Restricted-Trusted:

  1. Go to google.com
  2. Search for something that would show inappropriate results without safe search
  3. Verify results are filtered

Test Ad Blocking

From a device on Restricted-Trusted:

  1. Visit a site with known ads (news sites work well)
  2. Verify ads are blocked or show placeholder

Check Filter Logs

Navigate to Settings → CyberSecure → Activity to see:

  • Blocked queries
  • Which devices triggered blocks
  • Category distribution
Previous
Firewall Rules