小樱 发表于 2022/2/24 04:36

腾讯云doh服务器未支持edns_client_subnet字段,导致dns解析错误变成电信ip

腾讯云doh服务器未支持edns_client_subnet字段,导致dns解析错误变成电信ip

1.12.12.12这个很明显就不支持,错误响应为电信ip
请求
https://1.12.12.12/dns-query?ct=application/dns-json&name=www.baidu.com.&type=A&edns_client_subnet=0.0.0.0

输出
{"Status":0,"TC":false,"RD":true,"RA":true,"AD":false,"CD":false,"Question":[{"name":"www.baidu.com.","type":1}],"Answer":[{"name":"www.baidu.com.","type":5,"TTL":995,"data":"www.a.shifen.com."},{"name":"www.a.shifen.com.","type":1,"TTL":95,"data":"180.101.49.11"},{"name":"www.a.shifen.com.","type":1,"TTL":95,"data":"180.101.49.12"}]}

请求0.0.0.0的情况,应当直接返回用户ip,而不是也响应0.0.0.0,错误响应为电信ip

请求
https://dns.pub/dns-query?ct=application/dns-json&name=www.baidu.com.&type=A&edns_client_subnet=0.0.0.0

输出

{"Status":0,"TC":false,"RD":true,"RA":true,"AD":false,"CD":false,"Question":[{"name":"www.baidu.com.","type":1}],"Answer":[{"name":"www.baidu.com.","type":5,"TTL":1200,"Expires":"Wed, 23 Feb 2022 20:51:59 UTC","data":"www.a.shifen.com."},{"name":"www.a.shifen.com.","type":1,"TTL":300,"Expires":"Wed, 23 Feb 2022 20:36:59 UTC","data":"180.101.49.11"},{"name":"www.a.shifen.com.","type":1,"TTL":300,"Expires":"Wed, 23 Feb 2022 20:36:59 UTC","data":"180.101.49.12"}],"edns_client_subnet":"0.0.0.0/24"}

阿里那边则完美支持,正确响应了移动运营商的CDN节点ip地址
请求
https://223.5.5.5/resolve?ct=application/dns-json&name=www.baidu.com.&type=A&edns_client_subnet=0.0.0.0

输出
{"Status":0,"TC":false,"RD":true,"RA":true,"AD":false,"CD":false,"Question":{"name":"www.baidu.com.","type":1},"Answer":[{"name":"www.baidu.com.","TTL":133,"type":5,"data":"www.a.shifen.com."},{"name":"www.a.shifen.com.","TTL":133,"type":1,"data":"183.232.231.174"},{"name":"www.a.shifen.com.","TTL":133,"type":1,"data":"183.232.231.172"}],"edns_client_subnet":"117.181.66.2/32"}
页: [1]
查看完整版本: 腾讯云doh服务器未支持edns_client_subnet字段,导致dns解析错误变成电信ip