brew update
brew install dnsmasq
cat >> /usr/local/etc/dnsmasq.conf <<EOF
conf-dir=/usr/local/etc/dnsmasq.d,*.conf
EOF
mkdir -p /usr/local/etc/dnsmasq.d
# config test domain
touch /usr/local/etc/dnsmasq.d/test.conf
cat > /usr/local/etc/dnsmasq.d/test.conf <<EOF
address=/concourse.test/10.244.0.101
address=/minio.test/10.244.0.102
address=/git.test/10.244.0.103
address=/ldap.test/128.0.0.1
address=/.test/127.0.0.1
EOF
# Restart
sudo brew services restart dnsmasq
# Clear cache
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
sudo mkdir /etc/resolver
sudo touch /etc/resolver/test
cat <<EOF | sudo tee /etc/resolver/test
nameserver 127.0.0.1
search_order 1
EOF
$ scutil --dns
resolver #8
domain : test
nameserver[0] : 127.0.0.1
flags : Request A records, Request AAAA records
reach : 0x00030002 (Reachable,Local Address,Directly Reachable Address)
order : 1
$ dig concourse.test
...
;; ANSWER SECTION:
concourse.test. 0 IN A 10.244.0.101
$ dig google.com
...
;; ANSWER SECTION:
google.com. 70 IN A 172.217.194.101
google.com. 70 IN A 172.217.194.138
google.com. 70 IN A 172.217.194.113
google.com. 70 IN A 172.217.194.139
google.com. 70 IN A 172.217.194.100
google.com. 70 IN A 172.217.194.102
Ref: