"dig pushgateway.prometheus.service.consul" issue

Hi,

I encounter below error while ran “dig pushgateway.prometheus.service.consul”

root@poc ~]# dig pushgateway.prometheus.service.consul

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.7 <<>> pushgateway.prometheus.service.consul
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 59016
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;pushgateway.prometheus.service.consul. IN A

;; AUTHORITY SECTION:
consul. 0 IN SOA ns.consul. hostmaster.consul. 1637646446 3600 600 86400 0

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Nov 23 00:47:26 EST 2021
;; MSG SIZE rcvd: 116

sometime, when I restart dnsmasq, we can find the answer. below please refer to my configuration files for dnsmasq:

[root@poc ~]# cat /etc/hosts
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.21.137 poc
#hopsworks.glassfish.service.consul rpc.namenode.service.consul registry.service.consul broker.kafka.service.consul

[root@poc ~]# cat /etc/resolv.conf

Generated by NetworkManager

nameserver 127.0.0.1
search domain1

[root@poc ~]# cat /srv/dnsmasq/resolv.conf
nameserver 192.168.21.2
nameserver 8.8.8.8
nameserver 192.168.21.137

[root@poc ~]# systemctl status dnsmasq
● dnsmasq.service - DNS caching server.
Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-11-23 00:43:31 EST; 9min ago
Main PID: 85701 (dnsmasq)
Tasks: 1
Memory: 396.0K
CGroup: /system.slice/dnsmasq.service
└─85701 /usr/sbin/dnsmasq -k

Nov 23 00:43:31 poc dnsmasq[85701]: started, version 2.76 cachesize 150
Nov 23 00:43:31 poc dnsmasq[85701]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset… inotify
Nov 23 00:43:31 poc dnsmasq[85701]: using nameserver 127.0.0.1#8600 for domain consul
Nov 23 00:43:31 poc dnsmasq[85701]: reading /srv/dnsmasq/resolv.conf
Nov 23 00:43:31 poc dnsmasq[85701]: using nameserver 127.0.0.1#8600 for domain consul
Nov 23 00:43:31 poc dnsmasq[85701]: using nameserver 192.168.21.2#53
Nov 23 00:43:31 poc dnsmasq[85701]: using nameserver 8.8.8.8#53
Nov 23 00:43:31 poc dnsmasq[85701]: ignoring nameserver 192.168.21.137 - local interface
Nov 23 00:43:31 poc dnsmasq[85701]: read /etc/hosts - 1 addresses
Nov 23 00:43:37 poc dnsmasq[85701]: nameserver 127.0.0.1 refused to do a recursive query
Hint: Some lines were ellipsized, use -l to show in full.

any configuration error in above configs?

Thanks,
-David