You can block access to YouTube via Xiaomi router in a number of ways, from simple parental controls to complex firewall rules, which will suit the owners of Mi Router 4A/4C/5/6, AX3000, AX6000 and other models with MiWiFi or Padavan firmware. We will analyze all current methods, including those that bypass VPNs and proxies, and explain why some methods stop working after updates.
The main problem when blocking YouTube is that the service uses dozens of domains and IP-Adding YouTube.com to a blacklist is not enough: videos will be uploaded through googlevideo.com, ytimg.com and other subdomains, so we'll focus on end-to-end solutions that block access to all of the associated resources. If you need to restrict access for children or reduce traffic, choose a method that is tailored to your tasks.
1. Blocking through parental control (the easiest way)
The built-in parental controls in Xiaomi routers allow you to restrict access to sites on a schedule or permanently, which is suitable for families with children, because it does not require technical knowledge. However, it only works for devices connected to the Xiaomi network - if a child uses mobile Internet (4G/5G), the lock will only work on the home Wi-Fi network.
To set the limit:
- π± Open the Mi Wi-Fi app (or Xiaomi Home for new models).
- π§ Go to Settings. β Parental control.
- β Add the device for which you want to block YouTube (select from the list of connected gadgets).
- π Under Blocked Sites, type: youtube.com *.youtube.com *.googlevideo.com *.ytimg.com
- β° Set a schedule (e.g. lock from 20:00 to 8:00) or select Permanently.
The device added to the control list|YouTube Domains Entered Without Errors|Schedule maintained and active|Testing from a locked device-->
β οΈ Note: Parental controls in Xiaomi are blocked only by the HTTP-If the website is opened by HTTPS (YouTube always uses a secure connection, the router will not be able to analyze traffic. To circumvent this restriction, turn on the router settings. DNS-interception (see next section).
2. Blocking through DNS change (bypasses HTTPS)
Shift. DNS-The router's servers are a more reliable way, because it works at the level of domain name resolution. DNS We'll connect a server from the provider that filters the requested addresses, such as CleanBrowsing or OpenDNS FamilyShield blocking access to YouTube and other entertainment resources.
Instructions for setting:
- π₯οΈ Go to the router's web interface at 192.168.31.1 (or miwifi.com).
- π§ Go to Settings. β Internet β DNS.
- π Replace automatics DNS on: 185.228.168.168 (CleanBrowsing Family Filter) 185.228.169.168 or 208.67.222.123 (OpenDNS FamilyShield) 208.67.220.123
- πΎ Save settings and restart the router.
| DNS-server | Addresses | Blocking YouTube? | Additionally. |
|---|---|---|---|
| CleanBrowsing Family | 185.228.168.168, 185.228.169.168 | Yes. | Blocks porn, social networks, gambling |
| OpenDNS FamilyShield | 208.67.222.123, 208.67.220.123 | Yes. | Requires registration for fine-tuning |
| AdGuard DNS Family | 94.140.14.15, 94.140.15.16 | Yes. | Filtering advertising and trackers |
| Yandex.DNS Family | 77.88.8.7, 77.88.8.3 | No. | Blocks only adult content |
β οΈ Note: If the device manually prescribed alternatives DNS (For example, 8.8.8.8 or 1.1.1.1, the lock will not work. To avoid this, turn off the option to change the lock. DNS on the gadgets themselves (on Android this is done through Settings) β Network β Private DNS).
3. Blocking by MAC-address (for individual devices)
If you only want to block YouTube on a particular device (such as a childβs phone), use filtering by MAC-This method is independent of the address. DNS It works even when connected through VPN, Because the limit is imposed at the router level.
How to set up:
- Find out. MAC-Target Device Address: On Android: Settings β The phone. β General information β MAC-Wi-Fi address. On iPhone: Settings β Wi-Fi β (i) next to the network. On Windows: run ipconfig on the command line /all Find the physical address line.
Settings β Wireless mode β MAC filter
Add in. MAC-Address to the blacklist and keep it.
YouTube
π‘
If the device connects via both Wi-Fi and cable, blacklist both. MAC-addresses (for wireless and wired interfaces).
πΉ The Pros of the Method: It Works Even With VPN, It doesn't depend on the protocol (HTTP/HTTPS).
πΈ Cons: if MAC-The address will change (for example, after a phone reset), the rule will cease to apply. MAC (MAC-spoofing).
4. Blocking through the domain blacklist (for advanced)
To block YouTube completely on all devices on the network, you can manually add service domains to the routerβs blacklist, which requires regular updates to the list, as Google constantly changes addresses to circumvent restrictions.
The current list of domains to block (2026):
youtube.com
*.youtube.com
*.googlevideo.com
*.ytimg.com
*.youtu.be
*.ggpht.com
*.googleapis.com
*.gstatic.com
*.2mdn.net
*.doubleclick.netHow to add to the blacklist:
- Go to the router's web interface (192.168.31.1).
- Go to Settings β Security β Blacklist (or URL Filtering depending on the model).
- Insert a list of domains (one per line).
- Set a tick to turn on filtering and save.
Why Domain Blocking May Not Work?
Important: After updating the router firmware, the blacklist settings may reset. Always back up the configuration via Settings β Backup.
5. Blocking through the firewall (iptables)
For users with Padavan or OpenWRT firmware on Xiaomi routers, extended traffic control via iptables is available.This method allows you to block YouTube at the packet level, including bypassing via VPN.
Example of a rule for blocking:
iptables -A FORWARD -p tcp -m string --string "youtube" --algo bm -j DROP
iptables -A FORWARD -p tcp -m string --string "googlevideo" --algo bm -j DROP
iptables -A FORWARD -p udp -m string --string "youtube" --algo bm -j DROP
iptables -A FORWARD -p udp -m string --string "googlevideo" --algo bm -j DROPTo apply the rules automatically when restarting:
- Connect to the router via SSH (use PuTTY or Termux).
- Open /etc/firewall.user file with the command: vi /etc/firewall.user
- Add rules to the end of the file and save (:wq in vi).
- Make the file executable: chmod +x /etc/firewall.user
π‘
The rules of iptables block traffic at the core level of the router, so they work even if YouTube opens through Tor or a proxy. However, this method requires knowledge of Linux and can slow down the network with a lot of rules.
6. Alternative methods (if nothing helps)
If YouTube is still available after all the manipulations, try these methods:
- π Shutdown IPv6: In the router settings (Settings) β Internet shutdown IPv6. Some YouTube domains resolve only through IPv6, and their lock-in IPv4 level is not working.
- π‘οΈ Pi-hole installation: Deploy a Pi-hole server on a Raspberry Pi or other device on the network that will filter everything. DNS-This is the most reliable solution for blocking ads and unwanted sites.
- π΅ Hardware firewall: Connect a dedicated device between the router and the provider (e.g., Ubiquiti) USG), sensing HTTPS-traffic.
- π Router reset: If settings fly off after the update, complete the reset (Settings) β Additionally. β Reset) and set the lock again.
β οΈ Blocking YouTube at the router level does not protect against access via mobile Internet (3G/4G/5G). If the goal is to limit your child, consider parental controls on the device itself (e.g. Google Family Link for Android or iPhone Screen Time).