I have a service running on localhost on MacOS High Sierra.
does not work, but
To get to my setup, I installed dns using homebrew,
brew install dnsmasq
added my configuration to /usr/local/etc/dnsmasq.conf,
and added a resolver file /etc/resolver/test:
I've spent a day trying dig foo.test scutil --dns dscacheutil -q host -a name foo.test and nothing worked.
My eventual issue was not covered anywhere else, so I'm answering it here for someone else.