Skip to content

Instantly share code, notes, and snippets.

@ianwremmel
Created January 21, 2014 02:37
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 ianwremmel/8533517 to your computer and use it in GitHub Desktop.
Save ianwremmel/8533517 to your computer and use it in GitHub Desktop.
Setup all hosts on the `dev` TLD to point at `127.0.0.1`.
#!/bin/bash
brew install dnsmasq
# Configure automatic startup
sudo cp -fv /usr/local/opt/dnsmasq/*.plist /Library/LaunchDaemons
sudo mkdir /etc/resolver
echo "nameserver 127.0.0.1" | sudo tee -a /etc/resolver/dev
echo "address=/.dev/127.0.0.1" > /usr/local/etc/dnsmasq.conf
pbcopy < /usr/local/opt/dnsmasq/dnsmasq.conf.example
pbpaste >> /usr/local/etc/dnsmasq.conf
# Start now
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment