Skip to content

Instantly share code, notes, and snippets.

@billylaing
Last active September 16, 2018 21:39
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 billylaing/4e3df841a5845bbdf803e6dc6352a5b0 to your computer and use it in GitHub Desktop.
Save billylaing/4e3df841a5845bbdf803e6dc6352a5b0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# install dnsmasq
brew install dnsmasq
# add localhost TLD
echo "address=/localhost/127.0.0.1" >> /usr/local/etc/dnsmasq.conf
# add resolver for localhost
sudo mkdir /etc/resolver
sudo touch /etc/resolver/localhost
sudo sh -c 'echo "nameserver 127.0.0.1" >> /etc/resolver/localhost'
# restart dnsmasq (and may have to restart your mac)
sudo brew services start dnsmasq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment