Skip to content

Instantly share code, notes, and snippets.

@gaboesquivel
Forked from eloypnd/dnsmasq_setup_osx.md
Created January 5, 2017 19:49
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 gaboesquivel/384d9720378dcf999ce19c50e100768f to your computer and use it in GitHub Desktop.
Save gaboesquivel/384d9720378dcf999ce19c50e100768f to your computer and use it in GitHub Desktop.
wildcard DNS record on OS X in localhost development with dnsmasq

wildcard DNS in localhost development

$ brew install dnsmasq
   ...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
  • edit /usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
  • start dnsmasq
$ sudo brew services start dnsmasq
  • any time we change dnsmasq.conf we have to re-start dnsmasq:
$ sudo launchctl stop homebrew.mxcl.dnsmasq
$ sudo launchctl start homebrew.mxcl.dnsmasq
  • For OS X to resolve requests from *.local to localhost we need to add a resolver:
$ sudo mkdir /etc/resolver
$ sudo touch /etc/resolver/local
  • edit /etc/resolver/local
nameserver 127.0.0.1
  • re-start the computer to enable the resolver

=== REFERENCES

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment