Skip to content

Instantly share code, notes, and snippets.

@groundcat
Last active October 21, 2019 03:39
Show Gist options
  • Select an option

  • Save groundcat/040944a228a3af85bc116c33dea3b767 to your computer and use it in GitHub Desktop.

Select an option

Save groundcat/040944a228a3af85bc116c33dea3b767 to your computer and use it in GitHub Desktop.
DNS over HTTPS for MacOS

Install Cloudflared

Install via Terminal:

curl https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-darwin-amd64.tgz | tar xzC /usr/local/bin

Create and edit /usr/local/etc/cloudflared/config.yml

Foundation for Applied Privacy configuration

proxy-dns: true
proxy-dns-upstream:
 - https://doh.appliedprivacy.net/query

Quad 9 configuration

proxy-dns: true
proxy-dns-upstream:
 - https://9.9.9.9/dns-query

CloudFlare configuration

proxy-dns: true
proxy-dns-upstream:
 - https://1.1.1.1/dns-query
 - https://1.0.0.1/dns-query

Start Service

Enable and start on user login

sudo cloudflared service install

Test if it's running

dig +short @127.0.0.1 cloudflare.com AAAA
2400:cb00:2048:1::c629:d6a2
2400:cb00:2048:1::c629:d7a2

Finally, switch your DNS servers to 127.0.0.1

Install using custom DoH server

May result in error message level=error msg="failed to connect to an HTTPS backend

Need to edit /etc/hosts to add your custom DoH server's IP and domain

Uninstall Cloudflared

sudo cloudflared service uninstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment