-
-
Save hakjoon/b3c5f7b60fe5372fee6fb54500958e18 to your computer and use it in GitHub Desktop.
This file contains 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
# bash <(curl -s https://gist.github.com/drye/5387341/raw/ec72cddfe43ec3d39c91a3c118cb68ab14a049f8/enable_dnsmasq_on_osx.sh) | |
# ---------------------- | |
# installing dnsmasq and enable daemon | |
# ---------------------- | |
brew install dnsmasq | |
sudo brew services start dnsmasq | |
# ---------------------- | |
# adding resolver for DOMAIN domain | |
# ie. domain = *.local.example.com | |
# ---------------------- | |
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver | |
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/local.example.com' | |
# ---------------------- | |
# configuring dnsmasq | |
# ---------------------- | |
echo 'address=/.local.example.com/127.0.0.1' >> $(brew --prefix)/etc/dnsmasq.conf | |
# ---------------------- | |
# launching dnsmasq | |
# ---------------------- | |
sudo brew services restart dnsmasq | |
#flush dns | |
sudo killall -HUP mDNSResponder | |
# check | |
ping -c 1 www.google.com | |
ping -c 1 g.local.example.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment