我遇到了一个奇怪的 DNS 问题。
dnslog.cn
无论我使用哪个公共 DNS,它似乎都指向 127.0.0.1。在 localhost 上托管的任何内容似乎都可以在http://dnslog.cn。在 Windows 和 WSL2 上运行的 Firefox 上的行为相同,即并非特定于 WSL。我在 Windows 11 上,在调试时在 WSL2 上运行了以下命令:
❯ nslookup dnslog.cn
Server: 172.23.176.1
Address: 172.23.176.1#53
Non-authoritative answer:
Name: dnslog.cn
Address: 127.0.0.1
** server can't find dnslog.cn: SERVFAIL
❯ dig dnslog.cn
; <<>> DiG 9.18.12-1-Debian <<>> dnslog.cn
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6112
;; flags: qr rd ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;dnslog.cn. IN A
;; ANSWER SECTION:
dnslog.cn. 0 IN A 127.0.0.1
;; Query time: 29 msec
;; SERVER: 172.23.176.1#53(172.23.176.1) (UDP)
;; WHEN: Sat Mar 18 05:52:42 IST 2023
;; MSG SIZE rcvd: 52
❯ ping dnslog.cn
PING dnslog.cn (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.021 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.013 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.018 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.023 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.026 ms
^C
--- dnslog.cn ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4183ms
rtt min/avg/max/mdev = 0.013/0.020/0.026/0.004 ms
❯ traceroute dnslog.cn
traceroute to dnslog.cn (127.0.0.1), 30 hops max, 60 byte packets
1 localhost (127.0.0.1) 0.075 ms 0.027 ms 0.004 ms
resolv.conf、hosts 或 nsswitch.conf 中似乎没有什么异常。
❯ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.23.176.1
❯ cat /etc/hosts
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateHosts = false
127.0.0.1 localhost
127.0.1.1 MyPCName. MyPCName
192.168.0.103 host.docker.internal
192.168.0.103 gateway.docker.internal
127.0.0.1 kubernetes.docker.internal
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
请注意,此网络上的其他设备可以正常工作。使用 VPN 也可以解决此机器上的问题。
什么原因导致 DNS 服务器仅对特定站点返回 127.0.0.1 dnslog.cn
?
更新:
事实证明,这个问题不是我的设置问题,而是 DNS 服务器(包括 Google DNS)问题。
Cloudflare DNS 运行良好。
我想知道我们可以在哪里报告 DNS 不一致问题。