Skip to content

Instantly share code, notes, and snippets.

@scottrobertson
Last active December 16, 2015 09:18
Show Gist options
  • Save scottrobertson/5411765 to your computer and use it in GitHub Desktop.
Save scottrobertson/5411765 to your computer and use it in GitHub Desktop.
Route all "*.dev" domains to 127.0.0.1
#!/bin/sh
brew install dnsmasq
mkdir -pv $(brew --prefix)/etc/
echo 'address=/.dev/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.conf
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
# sudo launchctl unload -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment