Skip to content

Instantly share code, notes, and snippets.

@Swop
Created November 16, 2013 00:32
Show Gist options
  • Save Swop/7494182 to your computer and use it in GitHub Desktop.
Save Swop/7494182 to your computer and use it in GitHub Desktop.
Simplify Local Development with Dnsmasq on MacOS X (credits: http://blakeembrey.com/articles/local-development-with-dnsmasq/)
# Install homebrew first...
# Then:
brew install dnsmasq
cp /usr/local/Cellar/dnsmasq/X.XX/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
sudo cp /usr/local/Cellar/dnsmasq/X.XX/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
# Edit /usr/local/etc/dnsmasq.conf to add custom TLD (here: *.dev):
echo "address=/dev/127.0.0.1" >> /usr/local/etc/dnsmasq.conf
# Restart dnsmasq
sudo launchctl stop homebrew.mxcl.dnsmasq && sudo launchctl start homebrew.mxcl.dnsmasq
# And don't forget to add the DNS server in your network configuration (System Preferences -> Network -> Advanced -> DNS) to 127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment