Network privacy is the first line of defense against tracking. The scripts/network_setup.sh script assists in configuring your DNS settings.
Domain Name System (DNS) is the phonebook of the internet. By default, your ISP sees every domain you request.
-
Quad9 (
9.9.9.9)- Focus: Security & Privacy.
- Features: Blocks known malicious domains. Does not log IP addresses.
- Location: Switzerland (GDPR compliant).
-
Mullvad (
194.242.2.2)- Focus: Privacy & Anti-Tracking.
- Features: Blocks ads and trackers (if configured) and logs nothing.
- Ownership: Mullvad VPN.
-
Cloudflare (
1.1.1.1)- Focus: Speed & Privacy.
- Features: Claimed not to sell data, but is a large US corporation.
- Location: USA (Five Eyes).
Standard DNS traffic is unencrypted (plaintext), allowing ISPs and network snoops to see every domain you visit. To secure this, you can use encrypted DNS protocols.
- DNSCrypt: Authenticates and encrypts DNS traffic between your client and the resolver. Prevents MITM, spoofing, and sniffing. Unique protocol, requires dedicated client (dnscrypt-proxy).
- DNS over HTTPS (DoH): Encapsulates DNS queries in HTTPS traffic. Harder to block or distinguish from web traffic. Supported natively by some browsers and OSs.
- DNS over TLS (DoT): Wraps DNS in TLS on a dedicated port (853). Cleaner than DoH but easier to block by firewalls.
We provide an automated installer for dnscrypt-proxy, a powerful local DNS proxy that supports DNSCrypt, DoH, and anonymized DNS relays.
./bin/better-anonymity install dnscryptThis installs dnscrypt-proxy via Homebrew and applies a custom configuration:
- Encrypted: Uses Quad9 (Filter) and Cloudflare.
- Port: Listens on
127.0.0.1:5355. - Servers: You can find more servers at dnscrypt.info/public-servers.
To prevent apps from bypassing your encrypted DNS, you can block standard DNS (port 53) using Packet Filter (pf).
Warning: This may break internet access if dnscrypt-proxy is not running or configured correctly.
Add the following to your pf.conf:
block drop quick on !lo0 proto udp from any to any port = 53
block drop quick on !lo0 proto tcp from any to any port = 53
For more information, see What is a DNS Leak?.
PingBar is a menu bar utility for monitoring DNS latency and controlling dnscrypt-proxy.
./bin/better-anonymity install pingbar- Method: Builds from source (requires
swift). The installer will ask for confirmation before downloading/compiling. - Features:
- Graphical interface for DNSCrypt stats.
- Automatically restores your custom DNS settings after passing a captive portal.
- Launches at login.
Unbound is a validating, recursive, and caching DNS resolver. We configure it to perform full DNSSEC validation.
./bin/better-anonymity install unbound- Method: Installs via Homebrew, creates
_unbounduser, and configures permissions. - Integrity Check: The setup now verifies that the binary,
_unbounduser,_unboundgroup, and configuration file are all present before considering Unbound installed. - Configuration:
- Copies
config/unbound/unbound.conf. - Fetches DNSSEC root anchor.
- Generates control certificates.
- Note: Sets Wi-Fi DNS server to
127.0.0.1.
- Copies
You can run the automated verification tool to confirm your configuration:
./bin/better-anonymity verify-dnsThis tool checks:
- System Resolver: Uses
scutil --dnsto confirm127.0.0.1is the resolver. - Wi-Fi Settings: Uses
networksetupto confirm127.0.0.1is set. - DNSSEC: Runs
digto verify:- Valid Signature:
dig +dnssec icann.org(Should beNOERRORwithadflag). - Invalid Signature:
dig www.dnssec-failed.org(Should beSERVFAIL).
- Valid Signature:
To set your DNS servers for all active network services without using dnscrypt-proxy:
To set your DNS servers for all active network services:
sudo ./scripts/network_setup.sh [provider]
# Example:
sudo ./scripts/network_setup.sh mullvadNote: This script flushes the DNS cache immediately after applying settings.
When connecting to public Wi-Fi (coffee shops, airports), a "Captive Portal" often blocks internet access until you agree to terms. This blocks Tor, DNSCrypt, and other tools.
The Captive Portal Monitor helps you navigate this:
- Monitor: Launches a new terminal window that constantly checks connectivity.
- Detection: Alerts you if a portal is detected or if you are offline.
- Persistence: Keeps checking until you are fully online.
# Launch Monitor in a separate window (Best)
better-anonymity captive monitor
# Run in current terminal
better-anonymity captive run
# Check background status
better-anonymity captive statusTip
You can use the alias stay-connected to quickly launch the monitor in a new window.
You can block known malware, adware, and unwanted domains by referencing a curated /etc/hosts blocklist.
sudo ./bin/better-anonymity update-hostsor select "Update Hosts Blocklist" from the interactive menu.
- Backup: The first time you run this, the script creates a backup of your original hosts file at
/etc/hosts-base. - Restore: On every subsequent run, it restores
/etc/hostsfrom/etc/hosts-baseto ensure a clean state. - Update: It downloads the latest StevenBlack/hosts list to
config/hosts(creating a local cache) and appends it to/etc/hosts.
Future Feature: We plan to add scripts for MAC address randomization. For now, ensure your "Private Wi-Fi Address" feature is enabled in macOS System Settings if available (dependent on OS version).