Make sure to uncomment the below line from /etc/dnsmasq.conf
conf-dir=/etc/dnsmasq.d
cat /etc/dnsmasq.conf | tail -10
# For debugging purposes, log each DNS query as it passes through
# dnsmasq.
#log-queries
# Log lots of extra information about DHCP transactions.
#log-dhcp
# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
conf-dir=/etc/dnsmasq.d ## uncomment this line
$vi /etc/resolv.conf
nameserver 127.0.0.1 # add this in resolv.conf
https://www.consul.io/docs/guides/forwarding.html
Install dnsmasq on all nodes.
Make sure to uncomment the below line from /etc/dnsmasq.conf conf-dir=/etc/dnsmasq.d