How to stop continuous concurrent local DNS queries to dnsmasq

I set up a DNS server using dnsmasq, but it seems that it doesn’t work properly. The networking delay is up to hundreds of millisecs.

PING [server] ([server]) 56(84) bytes of data. 64 bytes from [server]: icmp_seq=1 ttl=50 time=583 ms 64 bytes from [server]: icmp_seq=2 ttl=50 time=583 ms 64 bytes from [server]: icmp_seq=3 ttl=50 time=583 ms 64 bytes from [server]: icmp_seq=4 ttl=50 time=583 ms 64 bytes from [server]: icmp_seq=5 ttl=50 time=583 ms 64 bytes from [server]: icmp_seq=6 ttl=50 time=583 ms 64 bytes from [server]: icmp_seq=7 ttl=50 time=583 ms 64 bytes from [server]: icmp_seq=8 ttl=50 time=583 ms 

Then soon I discovered that it’ll turn all right with using the default resolver systemd-resolved. By checking the log, I got the messages here below:

Jul 27 13:32:53 dnsmasq[3780]: query[A] ntp.ubuntu.com from 127.0.0.1 Jul 27 13:32:53 dnsmasq[3780]: forwarded ntp.ubuntu.com to 127.0.0.53 Jul 27 13:32:53 dnsmasq[3780]: query[A] ntp.ubuntu.com from 127.0.0.1 Jul 27 13:32:53 dnsmasq[3780]: forwarded ntp.ubuntu.com to 127.0.0.53 [countless records repeating these above...] Jul 27 13:32:53 dnsmasq[3780]: Maximum number of concurrent DNS queries reached (max: 150) Jul 27 13:32:54 dnsmasq[3780]: query[A] ntp.ubuntu.com from 127.0.0.1 Jul 27 13:32:54 dnsmasq[3780]: forwarded ntp.ubuntu.com to 127.0.0.53 [...] [probably the sigterm was sent here?] Jul 27 13:32:57 dnsmasq[3780]: query[A] ntp.ubuntu.com from 127.0.0.1 Jul 27 13:32:57 dnsmasq[3780]: forwarded ntp.ubuntu.com to 127.0.0.53 Jul 27 13:32:58 dnsmasq[3780]: no servers found in /run/dnsmasq/resolv.conf, will retry Jul 27 13:32:58 dnsmasq[3780]: query[A] ntp.ubuntu.com from 127.0.0.1 Jul 27 13:32:58 dnsmasq[3780]: query[A] ntp.ubuntu.com from 127.0.0.1 Jul 27 13:32:58 dnsmasq[3780]: query[A] ntp.ubuntu.com from 127.0.0.1 Jul 27 13:32:58 dnsmasq[3780]: query[A] ntp.ubuntu.com from 127.0.0.1 Jul 27 13:32:58 dnsmasq[3780]: query[A] ntp.ubuntu.com from 127.0.0.1 Jul 27 13:32:58 dnsmasq[3780]: exiting on receipt of SIGTERM 

So.. How to resolve this problem which makes me crazy, plz 🙁

The content from dnsmasq.conf is here:

strict-order resolv-file=/etc/resolv.conf.dnsmasq listen-address=0.0.0.0 server=/aliyuncs.com/100.100.2.136 server=/aliyuncs.com/100.100.2.138 server=/*.cn/100.100.2.136 server=/*.cn/100.100.2.138  bogus-nxdomain=100.100.2.136 bogus-nxdomain=100.100.2.138  log-queries log-facility=/var/log/dnsmasq/dnsmasq.log log-async=50  #EOF 

And resolv.conf.dnsmasq:

nameserver 100.100.2.136 nameserver 100.100.2.138 nameserver 208.67.222.123 nameserver 208.67.220.123 nameserver 8.8.8.8 nameserver 8.8.4.4 nameserver 1.2.4.8 nameserver 210.2.4.8 nameserver 208.67.222.222 nameserver 208.67.220.220 

resolv.conf:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN # 127.0.0.53 is the systemd-resolved stub resolver. # run "systemd-resolve --status" to see details about the actual nameservers.  nameserver 127.0.0.53 options timeout:2 attempts:3 rotate single-request-reopen