Skip to content

Instantly share code, notes, and snippets.

@com30n
Created September 15, 2020 09:26
Show Gist options
  • Save com30n/bd6da2d38f463eaeaa5b65e4baa71047 to your computer and use it in GitHub Desktop.
Save com30n/bd6da2d38f463eaeaa5b65e4baa71047 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Thanks to https://gist.github.com/soderlind/6a440cd3c8e017444097cf2c89cc301d
# Update your homebrew installation
brew up
# Install cloudflared using homebrew:
brew install cloudflare/cloudflare/cloudflared
mkdir -pv $(brew --prefix)/etc/cloudflared/
# Create /usr/local/etc/cloudflared/config.yaml, with the following content
cat << EOF > $(brew --prefix)/etc/cloudflared/config.yaml
proxy-dns: true
proxy-dns-upstream:
- https://1.1.1.1/dns-query
- https://1.0.0.1/dns-query
port: 5053
EOF
#Activate cloudflared as a service
sudo cloudflared service install
#Test
dig +short @127.0.0.1 github.com AA
#If OK, change DNS on your mac to 127.0.0.1 (System Preferences->Network->Advanced->DNS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment