Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhargavjoshi/5a29b417533e548e5d280ebcbd413986 to your computer and use it in GitHub Desktop.
Save bhargavjoshi/5a29b417533e548e5d280ebcbd413986 to your computer and use it in GitHub Desktop.
# Install dnsmasq
brew install dnsmasq
# Copy the default configuration file.
cp $(brew list dnsmasq | grep /dnsmasq.conf.example$) /usr/local/etc/dnsmasq.conf
# 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 /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
echo "address=/app/192.168.10.10" >> /usr/local/etc/dnsmasq.conf
#restart dnsmaq
sudo launchctl stop homebrew.mxcl.dnsmasq
sudo launchctl start homebrew.mxcl.dnsmasq
#make osx use dnsmasq
sudo mkdir -p /etc/resolver
sudo tee /etc/resolver/app >/dev/null <<EOF
nameserver 127.0.0.1
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment