Skip to content

Instantly share code, notes, and snippets.

@hnharejin
Created February 28, 2021 09:47
Show Gist options
  • Save hnharejin/911a06e592bd9ca62860484a00105f61 to your computer and use it in GitHub Desktop.
Save hnharejin/911a06e592bd9ca62860484a00105f61 to your computer and use it in GitHub Desktop.
Install DNSCrypt Proxy

Install&Configure DNSCrypt Proxy

On macOS

There is a easy way to install DNSCrypt Proxy on macOS, make sure you have Homebrew installed.

Step 1. Install dnscrypt-proxy by Homebrew:

brew install dnscrypt-proxy

Step 2. Choose one or more DNS Servers you need on this map. I chosen alidns-doh for myself.

Step 3. Configure and Startup

  1. Edit config file /usr/local/etc/dnscrypt-proxy.toml with your favorite editor
# Backup config file if you need 
sudo cp /usr/local/etc/dnscrypt-proxy.toml /usr/local/etc/dnscrypt-proxy-backup.toml
nvim /usr/local/etc/dnscrypt-proxy.toml
  1. Uncomment or add following content in config file.
# The DNS Servers you chosen
server_names = ['alidns-doh']
# Both IPv4 and IPv6 for me
listen_addresses = ['127.0.0.1:53', '[::1]:53']
  1. Start dnscrypt-proxy immediately and register it to launch at login (or boot).
sudo brew services start dnscrypt-proxy
  1. Change macOS DNS settings
System Preferences > Network > Wi-Fi or Ethernet > Advanced > DNS > + > enter '127.0.0.1' > OK > Apply

Step 4. Testing

nslookup example.com
dig example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment