wildcard DNS in localhost development
- install dnsmasq
$ brew install dnsmasq ... $ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
- start dnsmasq
$ sudo brew services start dnsmasq
- any time we change
dnsmasq.confwe have to re-start dnsmasq:
$ sudo launchctl stop homebrew.mxcl.dnsmasq $ sudo launchctl start homebrew.mxcl.dnsmasq
- For OS X to resolve requests from
*.localto localhost we need to add a resolver:
$ sudo mkdir /etc/resolver $ sudo touch /etc/resolver/local
- re-start the computer to enable the resolver
- Using Dnsmasq for local development on OS X - Passing Curiosity
- Using Dnsmasq Configure Wildcard DNS Record on Mac | Ri Xu Online
- unix - In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain? - Server Fault
- hostname - Wildcard in /etc/hosts file - Unix & Linux Stack Exchange
- Mac OS Lion - Wildcard subdomain virtual host - Stack Overflow
- How to put wildcard entry into /etc/hosts? - Stack Overflow
@hauleth I recently downgraded to Mojave 10.14.6 (18G103) so I can tell you that it works.
The .localhost is already accepted in the old https://tools.ietf.org/html/rfc2606.
That said the .test is off course a lot shorter.