How to Block YouTube on Ubiquiti UniFi (2026)

Block YouTube on a Ubiquiti UniFi network using Traffic Rules, Firewall rules, and DNS filtering. Covers UniFi Network Application 7.x and later. Updated for 2026.

Last updated 11 April 2026·
Difficulty🔨🔨🔨
Free
Bypass risk🐹🐹🐹🐹🐹

What You'll Need

  • A Ubiquiti UniFi setup (UDM, UDM Pro, UDR, USG, or UXG with a UniFi controller)
  • Access to UniFi Network Application (local controller or UniFi Site Manager at unifi.ui.com)
  • About 15–20 minutes
🔧

This is a prosumer guide

Ubiquiti UniFi is designed for technically capable users. This guide assumes you're comfortable navigating the UniFi Network Application (formerly UniFi Network Controller). If you have a consumer router, see the TP-Link, ASUS, or generic router guide instead.

Method 1: Traffic Rules (Easiest — UDM/UXG running UniFi Network 7.x+)

UniFi Network Application 7.x added Traffic Rules, a simplified interface for blocking domains without writing raw firewall rules.

Log into the UniFi Network Application

Go to https://unifi.ui.com (cloud) or your local controller address. Navigate to your site.

Go to Firewall & Security → Traffic Rules

In the left sidebar: Firewall & Security → Traffic Rules (or Traffic Management → Traffic Rules depending on your version).

Create a new rule to block YouTube

Click Create New Rule → set:

  • Action: Block
  • Source: Specific clients, a network segment, or "All Clients"
  • Destination: Domain/IP Group

Create a Domain Group for YouTube

Click Create New Group (or navigate to Firewall & Security → Firewall Groups → New Group):

  • Group Type: Domain Name
  • Group Name: YouTube
  • Values: Add each domain:
    • youtube.com
    • youtu.be
    • googlevideo.com
    • yt3.ggpht.com
    • ytimg.com

Save the group.

Apply the group to the traffic rule

Back in the Traffic Rule, set Destination to the YouTube domain group you just created. Set the rule to apply Always or on a schedule. Save.

Test

On a client in the affected network, try youtube.com — it should be blocked.

Method 2: DNS Filtering via DHCP (Simplest Router-Wide Block)

Change the DNS server your DHCP hands out to clients — every device gets the filtered DNS automatically.

Go to Networks → Edit your LAN network

Networks → find your LAN or home network → click Edit (pencil icon).

Find DHCP Name Server settings

Scroll to DHCP → expand Advanced (or DHCP Service Management). Look for DNS Server or Name Server.

Set to Custom DNS

Switch from Auto to Custom → enter:

  • DNS Server 1: 185.228.168.168 (CleanBrowsing Family)
  • DNS Server 2: 185.228.169.168

Save.

Force DHCP lease renewal on clients

On Windows: ipconfig /release && ipconfig /renew. On Mac: turn Wi-Fi off and on. Mobile devices: forget and rejoin the network. This forces clients to receive the new DNS server address.

Method 3: UniFi Firewall Rules (Legacy — USG / EdgeRouter)

For older UniFi setups using the classic firewall rules interface:

Go to Routing & Firewall → Firewall → Rules → LAN IN

Navigate to Routing & Firewall → Firewall → Rules tab → LAN IN group → Add Rule.

Create a block rule for YouTube IPs (less reliable — use DNS instead)

Blocking by IP is unreliable for YouTube because Google uses a large, rotating range of Anycast IPs. DNS filtering (Method 2) is more reliable for domain-based blocking.

For USG: Use Method 2 (custom DNS via DHCP) as the primary approach.

Method 4: UniFi Identity — Client-Level Content Filtering (Paid)

UniFi Identity (part of Ubiquiti's Advanced Data Center or Enterprise features) provides per-user content filtering, but requires a subscription and a more complex deployment. For a home or small office setup, Methods 1 and 2 are sufficient.

🐹

How Kids Bypass This

DNS bypass via manual device settings: If a client sets a manual DNS server (or uses a VPN), they bypass the DHCP-assigned DNS filter. Traffic Rules (Method 1) are harder to bypass since they work at the firewall level, not just DNS.

HTTPS inspection: By default, UniFi does not perform SSL inspection. YouTube traffic is HTTPS — blocking at the domain level (via DNS or Traffic Rules domain matching) works without SSL inspection. Deep packet inspection of HTTPS content requires a separate setup and CA certificate installation on clients.

Blocking YouTube may affect other Google services: googlevideo.com is shared infrastructure for some Google services. In practice, blocking youtube.com and googlevideo.com specifically only affects YouTube. Monitor your network after the rule is active.

Mobile data bypass: All router/network controls only affect traffic on your home network. Use device-level controls (Screen Time on iOS, Family Link on Android) for coverage off your network.

🔨

Counter-Measures

Traffic Rules (Method 1) is the most robust block on UniFi: Domain-based Traffic Rules work at the firewall level and are harder to bypass than DNS-only filtering. Use both — Traffic Rules to block the domain group, and DNS filtering (Method 2) to block the domains at resolution time. Two independent layers.

Use per-network VLAN blocking for child devices: For maximum control, put your child's devices on a separate VLAN and apply YouTube blocking rules to that VLAN only. This leaves your devices unrestricted while fully locking down their network segment.

Review UniFi traffic logs: UniFi Network Application → Traffic Analysis → filter by client to see what a specific device is accessing. This shows whether YouTube is being attempted or successfully blocked.

Want a personalised plan?

Answer 5 questions and get a guide for every device your child uses.

Take the Quiz →
Take the Quiz →