问题原文
原帖链接 · shoorlyne · CC BY-SA 4.0
I am trying to use dig, the bash command in Ubuntu 18.04LTS, to fetch all the txt records from a domain called zhihu.com, and it gives me inconsistent results.
The command I use is:
dig @8.8.8.8 SOA +short -t txt zhihu.com
This result looks good to me:
root@mx:/var/www/html/server# dig @8.8.8.8 SOA +short -t txt zhihu.com
;; Warning, extra type option
"m5g7qjk31l5d1hkq6m3zvcf6lg2f0h16"
"google-site-verification=q42VyLbU7bjRv5xb2279AX9jJ3Vuxp-e4XG_f1EQRGk"
"v=spf1 include:_spf.google.com include:cust-spf.edmsphere.com -all"
However, the next second I excute it, I get:
root@mx:/var/www/html/server# dig @8.8.8.8 SOA +short -t txt zhihu.com
;; Warning, extra type option
e4094fc1d98c915a.ksyunad.com.
And the e4094fc1d98c915a.ksyunad.com thing turns out to be a CNAME record value on zhihu.com in the DNS.
What's going on here?
已采纳解答
原帖链接 · Piotr P. Karwasz · CC BY-SA 4.0
Firstly you are asking for both the SOA and TXT record. The TXT query is sent and a warning is issued.
The main problem is that the domain zhihu.com is misconfigured:
- since it is a delegated domain, it needs
SOAandNSrecords, - the existence of a
CNAMErecord is not compatible with almost all other records (except DNSSEC)
Therefore you have an inconsistent behaviour: each DNS resolver can resolve that incompatibility as he wants. 8.8.8.8 is an anycast address: each time you connect with a potentially different server.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
