Created
April 6, 2016 16:23
-
-
Save cmpscabral/65b0bd6428c2e2b11a18096a9631375f to your computer and use it in GitHub Desktop.
redirect .dev domains to virtual machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
# Edit file: | |
$ nano /usr/local/etc/dnsmasq.conf | |
# change address to: | |
address=/dev/192.168.200.2 | |
$ sudo mkdir -p /etc/resolver | |
$ sudo tee /etc/resolver/dev >/dev/null <<EOF | |
nameserver 127.0.0.1 | |
EOF | |
# reiniciar o dnsmasq | |
sudo launchctl stop homebrew.mxcl.dnsmasq | |
sudo launchctl start homebrew.mxcl.dnsmasq | |
# testar com ping a um dominio .dev | |
$ ping -c 1 this.is.a.test.dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment