brew install dnsmasq
cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
now this is automatically done by the dnsmasq installation- Replace this in
/usr/local/etc/dnsmasq.conf
file:
address=/test/127.0.0.1
listen-address=127.0.0.1
sudo mkdir -v /etc/resolver
sudo touch /etc/resolver/test