Enable DoH on MacOS with cloudflared

Enable DoH on MacOS with cloudflared

quick start DoH on MacOS



0 #doh #cloudflare #macos

cloudflared is an open source golang DNS over HTTPS (DoH) client developed by Cloudflare, which allow us quick start DoH for MacOS system at present.

Install cloudflared using Homebrew

brew install cloudflare/cloudflare/cloudflared

Create config file

Create a new config file: /usr/local/etc/cloudflared/config.yaml, with the following content:

proxy-dns: true
  - https://dns.flinhong.com/dns-query
  - https://dns.google/dns-query

Multi upstreams are supported. You can find a list of DoH upstream at: https://github.com/curl/curl/wiki/DNS-over-HTTPS.

Activate cloudflared as a service

sudo cloudflared service install

Test and set

dig A @ github.com

If it’s working, change local DNS to on you MacOS (System Preferences > Network > Advanced > DNS).

Restart cloudflared service

If the DNS resolving stopped, restart the cloudflared service with:

sudo cloudflared service uninstall
sudo cloudflared service install

Although cloudflared works, but I found it slows my DNS queries a lot that push me back to the traditional way… Waiting for new release of macOS Big Sur with native support of DoH…

Ads by Google


Frank Lin

Hey, there! This is Frank Lin (@flinhong), one of the 1.4 billion 🇨🇳. This 'inDev. Journal' site holds the exploration of my quirky thoughts and random adventures through life. Hope you enjoy reading and perusing my posts.


Setup an IKEv2 server with StrongSwan



Setup an IKEv2 server with StrongSwan

IKEv2, or Internet Key Exchange v2, is a protocol that allows for direct IPSec tunneling between the server and client. In IKEv2 implementations, IPSec provides encryption for the network traffic. IKEv2 is natively supported on some platforms (OS X 10.11+, iOS 9.1+, and Windows 10) with no additional applications necessary, and it handles client hiccups quite smoothly.