tellform/dns_masq_setup_osx.md
2016-11-16 10:48:54 -08:00

1.7 KiB

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=/dev/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 *.dev to localhost we need to add a resolver:
$ sudo mkdir /etc/resolver
$ sudo touch /etc/resolver/dev
  • edit /etc/resolver/dev
nameserver 127.0.0.1
  • re-start the computer to enable the resolver

=== REFERENCES