Как остановить непрерывные параллельные локальные DNS-запросы к dnsmasq

Я настроил DNS-сервер, используя dnsmasq, но, похоже, он не работает должным образом. Сетевая задержка составляет до сотен миллисекунд.

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

Затем вскоре я обнаружил, что все будет хорошо с использованием стандартного распознавателя systemd-resolved. Проверив журнал, я получил следующие сообщения:

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

Итак. Как решить эту проблему, которая сводит меня с ума, плз: (

Содержимое dnsmasq.conf здесь:

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

И 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
0
задан 27 July 2019 в 09:07

1 ответ

Разрешенный. Просто добавьте запись bind-interfaces к dnsmasq.conf и запускают два сопоставителя DNS.
И удостоверьтесь, что systemd-разрешенный слушает на 127.0.0.53:53.

[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.1
options timeout:2 attempts:3 rotate single-request-reopen

[netstat -apn | grep 53]

tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      10122/dnsmasq       
tcp        0      0 172.18.129.180:53       0.0.0.0:*               LISTEN      10122/dnsmasq       
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      10066/systemd-resolved 
udp        0      0 127.0.0.1:53            0.0.0.0:*                           10122/dnsmasq       
udp        0      0 172.18.129.180:53       0.0.0.0:*                           10122/dnsmasq       
udp        0      0 127.0.0.53:53           0.0.0.0:*                           10066/systemd-resolved 
unix  3      [ ]         STREAM     CONNECTED     590253   1121/master

[dnsmasq.log]

Jul 28 12:31:57 dnsmasq[10122]: query[A] www.stackexchange.com from 127.0.0.1
Jul 28 12:31:57 dnsmasq[10122]: forwarded www.stackexchange.com to 127.0.0.53
Jul 28 12:31:57 dnsmasq[10122]: reply www.stackexchange.com is <CNAME>
Jul 28 12:31:57 dnsmasq[10122]: reply stackexchange.com is 151.101.129.69
Jul 28 12:31:57 dnsmasq[10122]: reply stackexchange.com is 151.101.193.69
Jul 28 12:31:57 dnsmasq[10122]: reply stackexchange.com is 151.101.65.69
Jul 28 12:31:57 dnsmasq[10122]: reply stackexchange.com is 151.101.1.69

[nslookup www.stackexchange.com]

Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
www.stackexchange.com   canonical name = stackexchange.com.
Name:   stackexchange.com
Address: 151.101.193.69
Name:   stackexchange.com
Address: 151.101.1.69
Name:   stackexchange.com
Address: 151.101.65.69
Name:   stackexchange.com
Address: 151.101.129.69
2
ответ дан 23 October 2019 в 08:50

Другие вопросы по тегам:

Похожие вопросы: