Unbound DNS and Network Wide Ad Blocking!
Overview
This article covers the advantages of using OPNsense with Unbound DNS and Blocklists for network-wide ad blocking, offering a faster and more streamlined experience than Pi-Hole.
Benefits
Using Unbound DNS with ad blocking offers several advantages over Cloudflare DNS:
-
Enhanced privacy: Unbound removes the need for third-party DNS services, preventing data collection and sale by providers like Cloudflare.
-
Recursive resolution: Unbound performs DNS queries starting from root servers, improving privacy through qname minimisation, revealing less about browsing habits.
-
Local control: Running Unbound locally gives you full control without reliance on external DNS infrastructure.
-
Improved caching: Efficient caching and pre-fetching speed up DNS resolution.
-
Reduced tracking: Eliminates tracking opportunities from third-party DNS providers.
-
DNSSEC validation: Protects from DNS spoofing and cache poisoning.
-
Compatibility with ad blocking: Integrates easily with solutions such as Pi-hole.
Check Out Our Video on This Topic
Guide to Setup Unbound DNS + Ad Blocking
- Log in to your OPNsense machine, navigate to Services > Unbound DNS > General.
- Check Enable Unbound and click Apply.
- Go to Services > Unbound DNS > Blocklist.
- Enable blocklists, choose blocklist type (e.g., Steven Blacklist).
- Click Apply.
- Change DNS settings in two places to assign your OPNsense IP as DNS resolver:
- Services > ISC DHCPv4 > LAN
- System > Settings > General
Getting User Stats for Unbound
- Navigate to Reporting > Unbound DNS.
- Click Go to the reporting configuration.
- Enable local gather of Statistics.
Clearing DNS Records on Windows
Flush and renew your DNS cache:
ipconfig /flushdns
ipconfig /renew
Ad Blocking Test
Perform an adblocking test at AdminForge.
Example result: 41% block rate with a single blocklist; adding more will increase effectiveness.
Note
Remember, adding many blocklists may interfere with your browsing experience or block access to desired sites.
Verify Blocking in Unbound Reports
Go to Reporting > Unbound DNS > Details tab to confirm blocks are happening, indicating correct setup.