Enable DoH on MacOS with cloudflared

Enable DoH on MacOS with cloudflared

quick start DoH on MacOS

Tools

2020.11.18

0 #doh #cloudflare #macos

macOS big sur now supports native DoH and DoT, you can follow this guid to configure on your Mac. If you have a self-hosting DoH/DoT server, you can also enable in your Mac following my blog post: https://frankindev.com/2019/11/26/doh-dot-based-on-adguardhome/.

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
proxy-dns-upstream:
  - 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 @127.0.0.1 github.com

If it’s working, change local DNS to 127.0.0.1 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.

YOU MAY ALSO LIKE

Setup an IKEv2 server with StrongSwan

Tutorials

2020.01.09

Setup an IKEv2 server with StrongSwan

IKEv2, or Internet Key Exchange v2, is a protocol that allows for direct IPSec tunneling between two points. 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.

Hands on IBM Cloud Functions with CLI

Tools

2020.10.20

Hands on IBM Cloud Functions with CLI

IBM Cloud CLI allows complete management of the Cloud Functions system. You can use the Cloud Functions CLI plugin-in to manage your code snippets in actions, create triggers, and rules to enable your actions to respond to events, and bundle actions into packages.

TOC

Buy Me A Coffee