Skip to content

Instantly share code, notes, and snippets.

@arunkumar-patange
Last active October 5, 2017 18:18
Show Gist options
  • Save arunkumar-patange/f94fef0a8a08d352c385c9794a9b915d to your computer and use it in GitHub Desktop.
Save arunkumar-patange/f94fef0a8a08d352c385c9794a9b915d to your computer and use it in GitHub Desktop.
#!/bin/bash
brew install dnsmasq
cp $(brew list dnsmasq | grep /dnsmasq.conf.example$) /usr/local/etc/dnsmasq.conf
sudo cp $(brew list dnsmasq | grep /homebrew.mxcl.dnsmasq.plist$) /Library/LaunchDaemons/
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
echo "address=/<domain>/<ip-address>" >> /usr/local/etc/dnsmasq.conf
sudo launchctl stop homebrew.mxcl.dnsmasq
sudo launchctl start homebrew.mxcl.dnsmasq
sudo mkdir -p /etc/resolver
sudo tee /etc/resolver/<domain> >/dev/null <<EOF
nameserver 127.0.0.1
EOF
@arunkumar-patange
Copy link
Author

arunkumar-patange commented Sep 29, 2017

download and replace <<domain>> for ex,abc.dev and chmod +x dnsmasq-osx.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment