我有一个小型家庭 LAN,在 Raspberry Pi 上运行 dnsmasq 以提供 DHCP 和 DNS 服务。我有两个运行 xubuntu 19.10 的系统,在这些系统上我看到 5 秒的延迟第一的当我查找本地主机的地址时。随后的查找速度很快,但如果系统闲置很长时间(我还没有完全弄清楚多长时间),我会再次看到 5 秒的延迟。
可以通过在 /etc/resolv.conf 中设置超时选项来更改延迟。
我见过其他人遇到类似的问题,但将 single-request-reopen 或 single-request 选项添加到 /etc/resolv.conf 对我的系统没有帮助。
我已经在其中一个客户端上运行 tcpdump,它显示的内容非常奇怪,第一个/慢速查找显示:-
15:06:46.494698 IP 192.168.1.109.47247 > 192.168.1.4.53: 17387+ [1au] A? esprimo.zbmc.eu. (44)
15:06:46.495458 IP 192.168.1.4.53 > 192.168.1.109.47247: 17387* 1/0/1 A 192.168.1.3 (60)
15:06:46.497254 IP 192.168.1.109.47346 > 192.168.1.4.53: 30260+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.497823 IP 192.168.1.4.53 > 192.168.1.109.47346: 30260 0/0/0 (33)
15:06:46.497905 IP 192.168.1.109.47346 > 192.168.1.4.53: 51192+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.498386 IP 192.168.1.4.53 > 192.168.1.109.47346: 51192 0/0/0 (33)
15:06:46.498452 IP 192.168.1.109.47346 > 192.168.1.4.53: 33447+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.498938 IP 192.168.1.4.53 > 192.168.1.109.47346: 33447 0/0/0 (33)
15:06:46.499005 IP 192.168.1.109.47346 > 192.168.1.4.53: 22508+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.499479 IP 192.168.1.4.53 > 192.168.1.109.47346: 22508 0/0/0 (33)
15:06:46.499543 IP 192.168.1.109.47346 > 192.168.1.4.53: 29909+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.500002 IP 192.168.1.4.53 > 192.168.1.109.47346: 29909 0/0/0 (33)
15:06:46.500065 IP 192.168.1.109.47346 > 192.168.1.4.53: 30282+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.500514 IP 192.168.1.4.53 > 192.168.1.109.47346: 30282 0/0/0 (33)
15:06:46.500577 IP 192.168.1.109.47346 > 192.168.1.4.53: 61787+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.501035 IP 192.168.1.4.53 > 192.168.1.109.47346: 61787 0/0/0 (33)
15:06:46.501098 IP 192.168.1.109.47346 > 192.168.1.4.53: 54396+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.501542 IP 192.168.1.4.53 > 192.168.1.109.47346: 54396 0/0/0 (33)
15:06:46.501604 IP 192.168.1.109.47346 > 192.168.1.4.53: 23954+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.502065 IP 192.168.1.4.53 > 192.168.1.109.47346: 23954 0/0/0 (33)
15:06:46.502129 IP 192.168.1.109.47346 > 192.168.1.4.53: 54304+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.502593 IP 192.168.1.4.53 > 192.168.1.109.47346: 54304 0/0/0 (33)
15:06:46.502658 IP 192.168.1.109.47346 > 192.168.1.4.53: 45756+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.503237 IP 192.168.1.4.53 > 192.168.1.109.47346: 45756 0/0/0 (33)
15:06:46.503301 IP 192.168.1.109.47346 > 192.168.1.4.53: 41800+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.503765 IP 192.168.1.4.53 > 192.168.1.109.47346: 41800 0/0/0 (33)
15:06:46.503829 IP 192.168.1.109.47346 > 192.168.1.4.53: 31311+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.504287 IP 192.168.1.4.53 > 192.168.1.109.47346: 31311 0/0/0 (33)
15:06:46.504350 IP 192.168.1.109.47346 > 192.168.1.4.53: 6714+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.504791 IP 192.168.1.4.53 > 192.168.1.109.47346: 6714 0/0/0 (33)
15:06:46.504853 IP 192.168.1.109.47346 > 192.168.1.4.53: 62324+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.505318 IP 192.168.1.4.53 > 192.168.1.109.47346: 62324 0/0/0 (33)
15:06:46.505381 IP 192.168.1.109.47346 > 192.168.1.4.53: 32434+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.505831 IP 192.168.1.4.53 > 192.168.1.109.47346: 32434 0/0/0 (33)
15:06:46.505894 IP 192.168.1.109.47346 > 192.168.1.4.53: 7912+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.506350 IP 192.168.1.4.53 > 192.168.1.109.47346: 7912 0/0/0 (33)
15:06:46.506413 IP 192.168.1.109.47346 > 192.168.1.4.53: 4391+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.506860 IP 192.168.1.4.53 > 192.168.1.109.47346: 4391 0/0/0 (33)
15:06:46.506924 IP 192.168.1.109.47346 > 192.168.1.4.53: 33948+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.507372 IP 192.168.1.4.53 > 192.168.1.109.47346: 33948 0/0/0 (33)
15:06:46.507435 IP 192.168.1.109.47346 > 192.168.1.4.53: 31485+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.507879 IP 192.168.1.4.53 > 192.168.1.109.47346: 31485 0/0/0 (33)
15:06:46.507942 IP 192.168.1.109.47346 > 192.168.1.4.53: 54625+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.508388 IP 192.168.1.4.53 > 192.168.1.109.47346: 54625 0/0/0 (33)
15:06:46.508451 IP 192.168.1.109.47346 > 192.168.1.4.53: 10602+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.508911 IP 192.168.1.4.53 > 192.168.1.109.47346: 10602 0/0/0 (33)
15:06:46.508973 IP 192.168.1.109.47346 > 192.168.1.4.53: 49099+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.509418 IP 192.168.1.4.53 > 192.168.1.109.47346: 49099 0/0/0 (33)
15:06:46.509480 IP 192.168.1.109.47346 > 192.168.1.4.53: 29655+ [1au] AAAA? esprimo.zbmc.eu. (44)
15:06:46.509937 IP 192.168.1.4.53 > 192.168.1.109.47346: 29655 0/0/0 (33)
15:06:56.498320 IP 192.168.1.109.41148 > 192.168.1.4.53: 17631+ AAAA? esprimo.zbmc.eu. (33)
15:06:56.499140 IP 192.168.1.4.53 > 192.168.1.109.41148: 17631 0/0/0 (33)
15:06:56.500756 IP 192.168.1.109.60324 > 192.168.1.4.53: 52387+ MX? esprimo.zbmc.eu. (33)
15:06:56.501332 IP 192.168.1.4.53 > 192.168.1.109.60324: 52387 0/0/0 (33)
良好/快速的查找显示:-
15:08:15.912561 IP 192.168.1.109.59396 > 192.168.1.4.53: 10912+ A? esprimo.zbmc.eu. (33)
15:08:15.913258 IP 192.168.1.4.53 > 192.168.1.109.59396: 10912* 1/0/0 A 192.168.1.3 (49)
15:08:15.913697 IP 192.168.1.109.50463 > 192.168.1.4.53: 35415+ AAAA? esprimo.zbmc.eu. (33)
15:08:15.914255 IP 192.168.1.4.53 > 192.168.1.109.50463: 35415 0/0/0 (33)
15:08:15.914718 IP 192.168.1.109.44070 > 192.168.1.4.53: 32499+ MX? esprimo.zbmc.eu. (33)
15:08:15.915186 IP 192.168.1.4.53 > 192.168.1.109.44070: 32499 0/0/0 (33)
那么这里发生了什么?看起来好像客户端系统发疯了,反复请求 AAAA 记录,然后放弃超时期限(目前由 /etc/resolv.conf 设置为 10 秒),然后再次请求相同的内容并了解回答。
这似乎确实是一个客户端问题,因为我有其他系统似乎没有这样的行为。