-
-
Save nfourtythree/beed22bac1655fc5c2fffe5652911386 to your computer and use it in GitHub Desktop.
Installs and configures dnsmasq on osx (for local resolution of development machines e.g virtualbox). Cudos to Alan Ivey http://www.echoditto.com/blog/never-touch-your-local-etchosts-file-os-x-again
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
# ---------------------- | |
# installing dnsmasq and enable daemon | |
# ---------------------- | |
brew install dnsmasq | |
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons | |
# ---------------------- | |
# adding resolver for dev domain | |
# ---------------------- | |
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver | |
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev' | |
# ---------------------- | |
# configuring dnsmasq | |
# ---------------------- | |
cat >> $(brew --prefix)/etc/dnsmasq.conf <<-EOF | |
address=/.dev/192.168.56.101 | |
EOF | |
# ---------------------- | |
# launching dnsmasq | |
# ---------------------- | |
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
# ---------------------- | |
# restarting dnsmasq command | |
# sudo launchctl stop homebrew.mxcl.dnsmasq | |
# sudo launchctl start homebrew.mxcl.dnsmasq | |
# ---------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment