Dnsmasq doesn't register consul agent service dns on local node running the db service

I am setting up consul on-premise server setup I have while I am learning consul.
After giving up months back today I am trying again. This is critical to my server setup.

I have 2 consul server setup and 1 agent named rockpi on which db service is running:

then I have service also registered:

then I updated the /etc/dnsmasq.d/10-consul that contains:

# Enable forward lookup of the 'consul' domain:

and /etc/dnsmasq.conf contains:


then I checked /etc/resolv.conf


and then if I do dig db.service.consul I get Answer Section empty:

# dig  db.service.consul

; <<>> DiG 9.11.3-1ubuntu1.16-Ubuntu <<>> db.service.consul
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 6735
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 65494
;db.service.consul.		IN	A

;; Query time: 10 msec
;; WHEN: Thu Nov 04 21:49:22 GMT 2021
;; MSG SIZE  rcvd: 46

what am I missing and what am I doing wrong ?

So I got this to work

I realized I had a dnsmasq configuration but dnsmasq was not really installed, so I installed dnsmasq then set DNSStubListener=no in /etc/systemd/resolved.conf then in /etc/dhcpcd.conf I set domain_name_servers= in the eth0 interface.

then restarted dhcpcd service, restarted dnsmasq and I got it to work.

to make internet work alongside I had to add dns server ip in dhcpcd config of eth0 interface