-
-
Save lancehudson/db66a64f72845667784a 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 | |
brew install dnsmasq | |
cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf | |
sudo cp -fv /usr/local/opt/dnsmasq/*.plist /Library/LaunchDaemons | |
sudo chown root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
echo -n "nameserver 127.0.0.1" | sudo tee /etc/resolver/dev | |
echo -n "nameserver 127.0.0.1" | sudo tee /etc/resolver/test | |
echo -n "nameserver 127.0.0.1" | sudo tee /etc/resolver/docker | |
echo "address=/dev/127.0.0.1" | sudo tee -a /usr/local/etc/dnsmasq.conf | |
echo "address=/test/127.0.0.1" | sudo tee -a /usr/local/etc/dnsmasq.conf | |
echo "address=/docker/192.168.59.103" | sudo tee -a /usr/local/etc/dnsmasq.conf | |
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
sudo kill -9 $(pgrep dnsmasq) | |
sleep 1 | |
dig +short @localhost domain.dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment