Skip to main content
Last checked

Block porn on Linux

Block adult sites on a Linux computer today, then check that it worked.

Free · home network

Set up a free filter on your router

Enter Cloudflare's family addresses on your router, and every device on your home network uses the filter.

Using it anyway? Here are the steps.

  1. Step 1: Sign in to your router

    Open your router's admin page. The address and login are usually printed on the router or in its manual.

  2. Step 2: Find the DNS settings

    Router makers label them differently, often under Internet, WAN or DHCP.

  3. Step 3: Enter the family addresses

    Enter the IPv4 addresses below. If your router has IPv6 DNS settings, enter the IPv6 addresses too. Save, then restart the router if it asks you to.

    1.1.1.1 for FamiliesMalware and adult content
    IPv4 · Primary1.1.1.3
    IPv4 · Secondary1.0.0.3
    IPv6 · Primary2606:4700:4700::1113
    IPv6 · Secondary2606:4700:4700::1003

Check it worked

Free · this computer

Set up a free filter on this computer

Point your active connection at Cloudflare's 1.1.1.1 for Families. These steps follow Ubuntu desktop with GNOME Settings and NetworkManager.

Using it anyway? Here are the steps.

You’ll need
  • An administrator account.
  • Ubuntu desktop with GNOME Settings and NetworkManager. Other desktops label settings differently.
  1. Step 1: Open your connection settings

    Go to: SettingsNetworkyour connectionSettings button

    For Wi-Fi, open Wi-Fi instead of Network.

  2. Step 2: Enter the IPv4 servers

    Go to: IPv4DNS

    Turn off Automatic and enter the IPv4 servers below.

    1.1.1.1 for FamiliesMalware and adult content
    IPv4 DNS1.1.1.3, 1.0.0.3
    IPv6 DNS2606:4700:4700::1113, 2606:4700:4700::1003
  3. Step 3: Enter the IPv6 servers

    Go to: IPv6DNS

    Turn off Automatic, enter the IPv6 servers above, then select Apply.

  4. Step 4: Reconnect

    Turn the connection off and on again so the new servers take effect.

Check it worked

Questions and troubleshooting

Your setup, the command line, new connections, the test address
Not sure what you're running
cat /etc/os-release prints your distribution and version. nmcli general status shows whether NetworkManager is running. Neither changes anything.
You set DNS from the command line
It depends on your network stack, so no single command suits every system. Follow your distribution's NetworkManager or systemd-resolved documentation, with the same addresses.
A new network or a system upgrade
Each saved connection keeps its own DNS settings, so repeat the steps for a new one. After a major upgrade, run resolvectl status again.
Cloudflare's test address still opens
Check the addresses on the connection you are using, reconnect, then reopen the browser.

More device guides

All guides