Before you start
- Finish the relevant device setup in Guardrails.
- Choose one filtering resolver or filtering service. Do not mix random DNS providers.
- Identify who controls admin, root, router, or owner access.
- Take screenshots of current network settings before changing them.
- Test after each change, not only at the end.
Pick a family-safe DNS resolver
DNS filtering is not a complete blocker, but it is a useful layer. Set the same resolver on the router and on portable devices where possible. Once you have chosen, Set up filtered DNS has the actual steps for each platform.
| Provider | Use when | Addresses or hostname | Notes |
|---|---|---|---|
| OpenDNS FamilyShield | You want a simple adult-content DNS filter with no account setup. | 208.67.222.123208.67.220.123 |
Use these FamilyShield addresses, not the regular OpenDNS addresses. Not available in France (including some French territories) or Portugal. |
| CleanBrowsing Family Filter | You want adult-content blocking, SafeSearch enforcement, and mobile Private DNS support. | 185.228.168.168185.228.169.168family-filter-dns.cleanbrowsing.org |
Good for Android Private DNS and router setup. The free tier is rate-limited and unsupported; paid plans add account control. |
| Cloudflare 1.1.1.1 for Families | You want a fast DNS filter for malware plus adult content. | 1.1.1.31.0.0.3 |
Simple network-level layer. Not a full accountability or app-control tool. |
| NextDNS / AdGuard DNS / CleanBrowsing paid | You want dashboards, allowlists, blocklists, schedules, logs, and device profiles. | Use the provider's assigned DNS, DoH, DoT, or configuration profile. | Have the trusted person own the account if this is self-lockout. |
Turn on the anti-circumvention settings
A category filter blocks known adult domains. It does nothing about a site that exists specifically to relay you somewhere else, because that site is not itself in the adult category. If you only turn on the porn category, you have blocked the front door and left the side door open. These settings are the difference between a filter that stops a search result and a filter that stops a workaround.
NextDNS: the settings that matter most
- Open Parental Control and turn on Block Bypass Methods. This covers web proxies, VPN provider domains, Tor gateways, encrypted-DNS endpoints, browsers with a built-in VPN or proxy, and Apple's Private Relay hostnames.
- In the same tab, turn on the Porn category and SafeSearch.
- Open Security and turn on Block Newly Registered Domains. Relay and mirror sites cycle through fresh domains faster than any curated list can track them, so blocking domains under 30 days old catches what the proxy list misses.
- Turn on Block Dynamic DNS Hostnames and Block Parked Domains in the same tab.
- Turn on Block Top-Level Domains and select the high-abuse TLDs you have no reason to visit.
Newly-registered-domain blocking will occasionally catch a legitimate new service. That friction is the point, and the blocked lookup still appears in the log, so the trusted person can approve it deliberately rather than you routing around it.
CleanBrowsing: pick the right filter
- Use the Family Filter (
185.228.168.168/185.228.169.168). CleanBrowsing states it blocks proxy and VPN domains used to bypass filtering, in addition to adult content. - Do not use the Adult Filter (
185.228.168.10) for this purpose. It is the lighter option and explicitly does not block proxies or VPNs.
This distinction is easy to miss because the Adult Filter sounds more targeted. For self-control setups the Family Filter is the stronger choice specifically because of the proxy blocking.
Other providers
- Cloudflare Gateway has an Anonymizer security category ("sites that allow users to surf the Internet anonymously"), plus New Domains and Newly Seen Domains. The plain
1.1.1.3resolver has none of this and no dashboard. - AdGuard DNS has Block newly registered domains, and under Server settings a Block access to iCloud Private Relay toggle and a Firefox canary-domain toggle. A general proxy or anonymizer category could not be confirmed.
- Pi-hole and AdGuard Home depend entirely on the blocklists you add. If you run one of these, add a proxy and VPN blocklist deliberately; the default lists are advertising-focused and will not cover this.
CleanBrowsing's own guidance puts it well: the goal is not perfect prevention, but raising the barrier enough that casual bypassing does not happen. New relay sites appear faster than any list is updated. What these settings buy you is that circumventing the filter becomes slow and deliberate instead of quick and half-accidental, and every attempt shows up in the log if you have a record someone else can see.
iPhone and iPad DNS friction
Manual Wi-Fi DNS is easy and useful, but it only covers that Wi-Fi network. A configuration profile, MDM, or router-level filter is stronger.
Set DNS manually on iPhone or iPad Wi-Fi
- Open Settings -> Wi-Fi.
- Tap the blue i next to the connected network.
- Tap Configure DNS.
- Choose Manual.
- Remove existing servers you do not want used.
- Tap Add Server.
- Enter your chosen resolver, such as
208.67.222.123and208.67.220.123for OpenDNS FamilyShield. - Tap Save.
- Repeat on each Wi-Fi network you use often.
- Test on Wi-Fi, then test on cellular data. Cellular data will not use the Wi-Fi DNS setting.
Use a stronger Apple DNS profile
- Choose a DNS provider that offers an iOS, iPadOS, or macOS profile. Set up filtered DNS has the field-by-field walkthrough, including which generator options are self-defeating.
- Install the provider's DNS profile while the trusted person is present.
- Check Settings -> General -> VPN & Device Management on iPhone or iPad.
- On Mac the equivalent pane is System Settings -> General -> Device Management. Older releases put it under Privacy & Security, and some providers' instructions still say System Preferences -> Profiles, which moved.
- Block account and passcode changes in Screen Time. This adds friction elsewhere, but do not count on it to stop profile removal.
- Use supervised device management or MDM if you need a profile the daily user cannot remove alone.
On an unsupervised iPhone or iPad, a profile you installed yourself can be deleted from that same pane, and can also simply be switched to Automatic without deleting anything. Screen Time prevents neither, and on iPhone the removal-password payload is supervised-only too. Supervision is the only thing that closes this, and Lock the DNS profile covers what that costs. Mac is a different story and needs no supervision — see Mac friction below.
Set DNS manually on Mac
- Open System Settings -> Network.
- Select Wi-Fi or Ethernet.
- Click Details.
- Open DNS.
- Add your chosen DNS servers.
- Remove DNS servers you do not want used.
- Click OK or Done.
- Open Terminal and run
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. - Test Safari and every other installed browser.
Android Private DNS friction
Private DNS can cover both Wi-Fi and mobile data on many Android devices. Menu names vary by manufacturer.
Set a Private DNS hostname
- Open Settings.
- Open Network & internet. On Samsung, check Connections -> More connection settings.
- Tap Private DNS.
- Choose Private DNS provider hostname.
- Enter a family-safe hostname, such as
family-filter-dns.cleanbrowsing.org. - Tap Save.
- Test on Wi-Fi.
- Turn Wi-Fi off and test on mobile data.
- Keep Family Link app-install approval turned on so another DNS or VPN app cannot be casually installed.
Close Android bypasses
- Uninstall extra browsers, VPNs, proxy apps, and alternate app stores.
- Disable developer options if they are on.
- Keep the parent Google Account off the managed phone.
- Block new app installs through Family Link or the Play Store approval flow.
- If the phone is rooted, treat local controls as weak. Move enforcement to the router, DNS account, and trusted person.
Chromebook / ChromeOS friction
On personal Chromebooks, the owner account controls guest browsing and sign-in rules. For high-control environments, use managed ChromeOS policies.
Personal Chromebook hardening
- Finish the Chromebook steps in Guardrails.
- Make sure Guest browsing is off.
- Make sure sign-in is restricted to the approved accounts.
- Use Family Link to set Chrome to Try to block explicit sites or Only allow approved sites.
- Review extensions and remove anything that acts as a proxy, VPN, alternate browser, or remote desktop client.
- Test by restarting the Chromebook and checking the login screen.
Managed ChromeOS path
- Use a managed ChromeOS environment when the personal owner model is not enough.
- In the admin console, restrict guest mode and restrict which accounts can sign in.
- Use URL blocklists or allowlists for Chrome.
- Block unapproved extensions, VPN extensions, proxy extensions, and developer-mode workarounds.
- Have the trusted person or organization own the admin account.
Windows friction
The important Windows split is standard user for daily use, separate administrator for changes, and policy where the edition supports it.
Set family-safe DNS on Windows 11
- Sign in with an administrator account for setup.
- Open Settings -> Network & Internet.
- Open your active Wi-Fi or Ethernet connection.
- Find DNS server assignment and click Edit.
- Choose Manual.
- Turn on IPv4.
- Enter the preferred and alternate DNS servers.
- Save.
- Open Command Prompt and run
ipconfig /flushdns. - Sign into the standard daily account and test.
Add hosts-file blocking
- Sign in as administrator.
- Open Notepad as administrator.
- Open
C:\Windows\System32\drivers\etc\hosts. Change the file picker from text files to all files if you do not see it. - Add one blocked domain per line.
- Save the file.
- Run
ipconfig /flushdns. - Test from the standard daily account.
0.0.0.0 example.com
0.0.0.0 www.example.com
A hosts file is not bypassed by changing DNS servers or by turning on a browser's own encrypted DNS. Chrome and Firefox both consult the hosts file before their secure-DNS lookup, so the most common way people defeat DNS filtering does nothing here. That makes this a genuine enforcement layer rather than a curiosity, and on that specific point it is harder to route around than a filtering resolver.
One quirk: if you edit the file while Firefox is running with encrypted DNS on, the change may not take effect until Firefox restarts.
No wildcards. Each line matches one exact hostname, so blocking a service means listing every subdomain it uses, and one you miss is an open door. Published adult-content lists run to tens of thousands of hostnames (the StevenBlack porn variant alone is about 77,000) and are still incomplete. This is structural and cannot be engineered around; it is the opposite of allowlist mode, which fails closed.
It only covers software that uses the system resolver, so an app with its own DNS stack, or anything connecting straight to an IP address, is unaffected. It cannot block by address, path or port, only by hostname.
Protect the hosts file, and what does not work
The file already sits in a protected system folder, so on a default Windows install a standard user cannot edit it and an administrator can. That means the protection is already in place and there is only one question that matters.
- Make the daily account a standard user and let the trusted person hold the administrator password. That is the control. Everything else on this page is detail.
- Confirm it by signing into the daily account and trying to save a change to the file. It should refuse.
- Check the permissions rather than assuming them, with
icacls C:\Windows\System32\drivers\etc\hostsfrom any prompt.
Editing the file's permissions to remove write access from your own account achieves nothing if you are a standard user, because you never had it. Setting the file read-only achieves nothing either, since that is a label rather than a permission and any elevated editor clears it in one command.
Adding a deny rule against Administrators does block casual editing, but an administrator can take ownership and undo it in two commands, and it can break backup and repair tooling. It is not worth the side effects. The ceiling here is not raisable: a local administrator can always undo this. The only durable version is not holding the administrator password.
Windows Defender will reset the file if you block the wrong domains
This one matters more than anything else on this page, because it fails silently and completely.
Microsoft treats certain hosts-file edits as a threat. Its own description of the behaviour is that when it remediates, it will reset the hosts file to default, removing any existing entries. Not the offending line. All of them. Microsoft also states plainly that the hosts file "is not a supported method of managing network connections to Windows devices".
The trigger is blocking Microsoft's own domains, and the popular ready-made blocklists include them: the widely used unified list contains Microsoft telemetry endpoints along with dozens of entries for other Microsoft properties. So applying one of those lists unmodified is likely to get the whole thing wiped at some point, probably without you noticing.
- Strip Microsoft-owned domains from the list before you apply it. The main list generator takes a whitelist file, and matching is partial, so a single
microsoft.comentry removes that domain and everything under it. Do the same for the other Microsoft properties. - Prefer that over adding an antivirus exclusion for the hosts file. An exclusion works, but it removes protection from exactly the file that credential-stealing malware likes to modify, which is a poor trade for this purpose.
- After any Windows repair, reset, or feature upgrade, check the file is still yours.
Using a ready-made blocklist without wrecking performance
- Use an actively maintained list. Check the last update date before trusting one; abandoned lists are common and useless here.
- Pick the variant that matches what you are blocking rather than the largest available. Bigger is not better when every line is maintenance.
- Apply the Microsoft-domain whitelist from the section above.
- On Windows, use the list generator's compress option, which puts several domains on each line. Large uncompressed files are reported to slow name resolution.
- Do not disable the DNS Client service to work around that, which is advice you will find in older guides. It breaks other things. Compression is the supported fix.
- Schedule the update script rather than doing it by hand, and have it run under an account the daily user does not control.
People spend a lot of energy choosing between hosts files, filtering DNS, browser policy and device management, as though one of them is the strong one. They are more alike than they look: each is undone in a minute or two by whoever holds the relevant credential. A hosts file falls to the administrator password. A DNS profile falls to the same password, or on a phone to nobody at all. Device management falls to whoever holds the supervision identity.
So the mechanism is rarely the deciding factor. Who holds the key is. A modest setup where someone else holds the password beats an elaborate one where you hold everything, every time, and it is worth choosing on that basis rather than on which technique sounds most thorough.
Disable browser secure-DNS bypasses with policy
DNS filters can be bypassed when a browser uses its own DNS-over-HTTPS resolver. Managed browser policy is cleaner than telling the user to leave a setting alone.
- Install Microsoft Edge and Google Chrome policy templates if you use Group Policy.
- Set Edge policy
DnsOverHttpsModetooff. - Set Chrome policy
DnsOverHttpsModetooff. - For Firefox on Windows, set the machine-wide registry keys under
HKLM\SOFTWARE\Policies\Mozilla\Firefox. Apolicies.jsonfile only applies to the one Firefox install it sits beside, so it is bypassed by downloading Firefox again. See Browser policy. - Also use
URLBlocklistandURLAllowlistpolicies if you need browser-level allowlisting. - Close private browsing while you are here: Chrome
IncognitoModeAvailability= 1, EdgeInPrivateModeAvailability= 1, FirefoxPrivateBrowsingModeAvailability= disallowed, plusBrowserGuestModeEnabled= false andBrowserAddPersonEnabled= false so a fresh profile is not a fresh start. - Restart the browser and check its policy page:
edge://policy,chrome://policy, orabout:policies.
{
"policies": {
"DNSOverHTTPS": {
"Enabled": false,
"Locked": true
}
}
}
Use AppLocker or WDAC for stronger app control
- Understand the edition situation, which changed and is widely misreported. AppLocker now enforces on every edition of Windows 11, including Home. That is a hazard rather than a reassurance: Home has no Local Security Policy editor, so a rule that locks you out of something is considerably harder to undo.
- Only attempt this if you are comfortable recovering from a bad rule. Microsoft notes that the service AppLocker depends on cannot have its start type reversed with the usual command-line tool, and recommends taking a system backup before changing it.
- Create rules in audit mode first.
- Block portable browsers, unknown EXE paths, user-writable app folders, VPN clients, proxy tools, and installer folders.
- Allow only required browsers and work apps.
- Switch from audit to enforce only after reviewing logs.
- Keep the policy-changing administrator account outside the daily user's control.
A bad application-control rule can lock you out of legitimate software. Test with a recovery admin account.
Mac friction
Use the Mac as a standard user for daily work. Keep admin credentials and Screen Time recovery away from the person who is trying not to bypass.
Add hosts-file blocking on Mac
- Sign into the admin account.
- Open Terminal.
- Run
sudo nano /etc/hosts. - Add blocked domains mapped to
0.0.0.0. - Save, then run
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. - Lock the file with
sudo chflags uchg /etc/hosts. Setting and clearing that flag both needsudo, so a standard user cannot touch it in either direction. - Use a standard account for daily work, with the trusted person holding the admin password.
- Test from that standard account.
To edit it later, clear the flag first with sudo chflags nouchg /etc/hosts, make the change, then set it again. Note that System Integrity Protection does not protect this file, so the flag and the admin password are doing the work. A customised hosts file survives ordinary macOS updates, but check it again after a major version upgrade.
0.0.0.0 example.com
0.0.0.0 www.example.com
Use profiles, MDM, or browser policy
- Use Screen Time from Guardrails as the base layer.
- Use a DNS configuration profile from your filtering provider for a stronger DNS layer.
- Use MDM if you need to enforce profiles, browser settings, or app restrictions.
- Deploy Chrome, Edge, or Firefox policy files to disable browser DoH and enforce blocklists.
- Keep the MDM admin, local admin, or profile removal path with the trusted person.
Filtered DNS on a Mac, and how to make it stick
A Mac is the easiest device to hold a DNS setting on, which is a pleasant change from everything else on this site. Two reasons: macOS shows a profile-installed DNS configuration as read-only text rather than a switch you can flip, and removing a profile or editing DNS servers both require the administrator password.
- Use a configuration profile from your filtering provider rather than its Mac app. Generate it unsigned if you intend to add removal protection, because a signed profile cannot be edited.
- Have the trusted person install it through System Settings -> General -> Device Management. It has to be done in the interface; the
profilescommand-line tool has not been able to install profiles since macOS 11. - Make the daily account Standard and confirm there is no second admin account with a password you know. On a Mac this is genuinely load-bearing rather than a formality.
- Add a profile removal password so the profile cannot be removed even by someone who reaches the admin prompt. Unlike iPhone, this works on an ordinary Mac with no supervision and no MDM.
- Close the browser gap with browser policy. A standard user can still let Chrome or Firefox resolve names itself and skip the system resolver entirely, and no profile prevents that.
Full detail, including the iPhone side and what to do if you will not supervise, is on Lock the DNS profile.
Linux friction
Linux can be hardened, but only if daily use does not include root or sudo. If the daily user has sudo, they can usually undo the block.
Use a non-sudo daily account
- Create a daily user that is not in
sudo,wheel, or another admin group. - Keep the root or admin password with the trusted person.
- Use the daily user for browsing and normal work.
- Do not leave an unlocked admin shell, SSH key, password manager, or recovery note available to the daily user.
Set DNS with NetworkManager
- Open a terminal as an admin user.
- Run
nmcli connection showand note the active connection name. - Replace
CONNECTION_NAMEbelow with the exact connection name. - Bring the connection back up.
- Test with the daily user.
sudo nmcli connection modify "CONNECTION_NAME" ipv4.dns "185.228.168.168 185.228.169.168" ipv4.ignore-auto-dns yes
sudo nmcli connection up "CONNECTION_NAME"
Use hosts-file blocking and make it harder to edit
- As admin, edit
/etc/hosts. - Add blocked domains mapped to
0.0.0.0. - Set the owner to
root:root. - Set permissions to
0644. - If the filesystem supports it, make the file immutable after you finish.
- Do not give the daily user the root password or sudo access.
sudo nano /etc/hosts
sudo chown root:root /etc/hosts
sudo chmod 0644 /etc/hosts
sudo chattr +i /etc/hosts
Verify the flag took with lsattr /etc/hosts, which should show i. Only root, or a process holding the matching capability, can set or clear it. The flag needs a filesystem that supports it, which covers the ext and btrfs families and XFS but not most network or overlay mounts. Clear it with sudo chattr -i /etc/hosts before editing, and before a distribution upgrade, since it will otherwise block the package manager from updating the file.
Immutable files are a maintenance headache. Record the setup for the trusted person, not for the daily user.
Block direct DNS and DNS-over-TLS with a firewall
Router enforcement is better, but a local firewall can add friction. Adapt this pattern carefully and test on a local machine, not over SSH.
# Example concept only: allow your chosen DNS, reject other DNS and DoT.
# Adapt for nftables, ufw, firewalld, or your router firewall.
# DNS: TCP/UDP 53. DNS-over-TLS: TCP 853. DNS-over-QUIC: UDP 853.
- Allow DNS to your chosen resolver.
- Reject or drop outbound TCP and UDP port
53to other addresses. - Reject outbound TCP and UDP port
853unless you intentionally use DoT or DoQ to your chosen resolver. - Address IPv6 too, or disable IPv6 only if you understand the side effects.
- Test browser DNS, package manager DNS, VPN clients, and reboot behavior.
Deploy browser policy on Linux
- For Chrome, put managed policy JSON under
/etc/opt/chrome/policies/managed/. - For Chromium, check
/etc/chromium/policies/managed/. - For Firefox, use the distribution or enterprise policy path used by your distro.
- Disable DNS-over-HTTPS and use URL blocklists or allowlists.
- Open
chrome://policyorabout:policiesto confirm the policy loaded.
{
"DnsOverHttpsMode": "off",
"URLBlocklist": ["example.com"]
}
Router / gateway friction
The router is the best place to make the whole home network follow one rule. It will not cover mobile data or another Wi-Fi network. On Apple devices, iCloud Private Relay ignores router-assigned DNS entirely: either rely on the on-device encrypted-DNS profile, which Apple says takes precedence, or have the router refuse to resolve mask.icloud.com and mask-h2.icloud.com, Apple's documented signal that makes Private Relay stand down.
Set DNS on the router
- Connect to the home network.
- Open the router admin page. Common addresses are
192.168.0.1,192.168.1.1, and10.0.0.1. - Log in as router admin.
- Find Internet, WAN, DHCP, LAN, or DNS settings.
- Set primary and secondary DNS to the chosen family-safe resolver.
- Set IPv6 DNS too if the router and ISP use IPv6.
- Save and reboot if required.
- Forget and rejoin Wi-Fi on a test device, or renew DHCP.
- Test a blocked site.
Block DNS bypass at the router
- Change the router admin password.
- Give that password to the trusted person if this is self-lockout.
- Block or redirect outbound DNS on TCP and UDP port
53to anything except your chosen resolver. - Block outbound DNS-over-TLS and DNS-over-QUIC on TCP and UDP port
853unless they go to your chosen resolver. - Apply the same rule to IPv6 or clients may bypass over IPv6.
- Apply the rules to guest networks too.
- Disable router features that let clients choose their own DNS if available.
- Test from a normal client, a guest-network client, and a device with a hardcoded DNS server.
DNS-over-HTTPS uses normal HTTPS traffic on port 443, so router DNS rules alone do not reliably catch it. Use browser policy, managed devices, or a filtering service profile for that gap.
Use Pi-hole, AdGuard Home, or NextDNS
- Choose where filtering will live: a local device like Pi-hole or AdGuard Home, or a cloud service like NextDNS.
- Point router DHCP DNS to that filter.
- Set upstream DNS on the filter to your chosen family-safe resolver or the provider's recommended upstream.
- Use blocklists for categories you actually need. Too many lists create breakage and alert fatigue.
- Use an allowlist for important sites that break.
- Have the trusted person own the admin password or provider account.
- Test logs only if you are comfortable with the privacy tradeoff.
Router checklist
- Router admin password is not known to the daily user.
- Primary and secondary DNS are both family-safe.
- IPv6 DNS is handled.
- Guest network is disabled or filtered.
- Outbound DNS to other resolvers is blocked or redirected.
- DoT and DoQ on port 853, TCP and UDP, are blocked or forced to the chosen resolver.
- Mobile data and hotspots are handled separately.
Privacy and logging
Filtering tools can create sensitive logs. DNS dashboards, router logs, accountability apps, parental-control reports, and browser-management tools may reveal searches, domains, app usage, or attempted bypasses.
- Use the least invasive tool that still works.
- Prefer trusted-person control of recovery over constant monitoring when that is enough.
- Decide in advance what the trusted person can see, what they should ignore, and what should trigger a conversation.
- Protect the trusted person’s dashboard with strong authentication.
- Review logging after major setup changes, new DNS providers, new routers, or new accountability tools.
When to move from Friction to Lockout
- You keep changing the settings back.
- You know the admin, root, owner, router, or DNS-dashboard password.
- You can install a new browser, VPN, profile, or app store without approval.
- You can reset the device or account and regain control alone.
Technical references
OpenDNS FamilyShield
FamilyShield router and DNS setup, including the adult-content resolver addresses.
CleanBrowsing filters
Family Filter DNS addresses, Private DNS hostname, DoH, DoT, and SafeSearch behavior.
Cloudflare for Families
Cloudflare's malware and adult-content DNS resolver addresses.
Microsoft Edge DoH policy
Policy control for disabling or managing DNS-over-HTTPS in Edge.
Chrome DoH policy
Managed policy for Chrome DNS-over-HTTPS behavior.
Firefox enterprise policies
Firefox policy templates, including DNS-over-HTTPS and website restrictions.
Pi-hole documentation
Network-wide DNS sinkhole documentation for local filtering.
Apple web content filter payloads
Apple managed-device web content filter payload reference.