Skip to content

Instantly share code, notes, and snippets.

@oko
Last active April 20, 2020 02:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save oko/c05420c39efa3204d2b7 to your computer and use it in GitHub Desktop.
Save oko/c05420c39efa3204d2b7 to your computer and use it in GitHub Desktop.
Configure a local dnsmasq server on OS X.
#!/bin/bash
sudo port -v install dnsmasq
sudo port -v load dnsmasq
sudo mkdir /etc/resolver
echo -n "nameserver 127.0.0.1" | sudo tee /etc/resolver/dev
echo "address=/dev/127.0.0.1" | sudo tee -a /opt/local/etc/dnsmasq.conf
echo "address=/test/127.0.0.1" | sudo tee -a /opt/local/etc/dnsmasq.conf
sudo kill -9 $(pgrep dnsmasq)
sleep 1
dig +short @localhost domain.dev
@oko
Copy link
Author

oko commented Feb 12, 2015

curl -L https://gist.githubusercontent.com/oko/c05420c39efa3204d2b7/raw | bash

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