Created
September 15, 2020 09:25
-
-
Save com30n/29f0481a6bf7d4efd2fd31062712070f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Tanks to: https://gist.github.com/ogrrd/5831371 | |
# Update your homebrew installation | |
brew up | |
# Install dnsmasq | |
brew install dnsmasq | |
mkdir -pv $(brew --prefix)/etc/ | |
# Copy the default configuration file. | |
cat << EOF > $(brew --prefix)/etc/dnsmasq.conf | |
# cloudflared proxy-dns --upstream https://1.1.1.1/dns-query --upstream https://1.0.0.1/dns-query --port 5053 | |
server=127.0.0.1#5053 | |
no-resolv | |
listen-address=127.0.0.1 | |
# keep nameserver order of resolv.conf | |
strict-order | |
EOF | |
# Copy the daemon configuration file into place. | |
sudo cp $(brew list dnsmasq | grep /homebrew.mxcl.dnsmasq.plist$) /Library/LaunchDaemons/ | |
# Start Dnsmasq automatically. | |
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
# Start Dnsmasq. | |
sudo launchctl start /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment