Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nameserver 规则对私有IPv4地址的PTR记录无效 #1767

Open
edward-p opened this issue Jul 6, 2024 · 0 comments
Open

nameserver 规则对私有IPv4地址的PTR记录无效 #1767

edward-p opened this issue Jul 6, 2024 · 0 comments

Comments

@edward-p
Copy link

edward-p commented Jul 6, 2024

问题现象

结果直接返回SOA,未走上游进行查询

目测应该是这个地方判断了是私有地址,就直接返回SOA了

if (found == 0 && _dns_server_is_private_address(ptr_addr, ptr_addr_len) == 0) {

另外:_dns_server_is_private_address没判断IPv6私有地址,所以私有IPv6的PTR记录是正常的

运行环境

  1. 固件型号 N/A

  2. 运营商 N/A

  3. smartdns来源以及版本 46-1

  4. 涉及的配置(注意去除个人相关信息)

bind [::]:5354
server-https https://1.1.1.1/dns-query
server 192.168.2.1 -group g1 -exclude-default-group
nameserver /bb.aa.in-addr.arpa/group1

重现步骤

  1. 上游DNS配置。 N/A
  2. 访问的域名。
dig PTR dd.cc.bb.aa.in-addr.arpa @127.0.0.1 -p5354

信息收集

  1. 将/var/log/smrtdns.log日志作为附件上传(注意去除个人相关信息)。
[2024-07-06 13:59:09,199][DEBUG][     dns_server.c:7155] recv query packet from 127.0.0.1, len = 66, type = 0
[2024-07-06 13:59:09,199][DEBUG][            dns.c:2160] opt type 10
[2024-07-06 13:59:09,199][DEBUG][     dns_server.c:7171] request qdcount = 1, ancount = 0, nscount = 0, nrcount = 0, len = 66, id = 25506, tc = 0, rd = 1, ra = 0, rcode = 0
[2024-07-06 13:59:09,199][DEBUG][     dns_server.c:7196] query dd.cc.bb.aa.in-addr.arpa from 127.0.0.1, qtype: 12, id: 25506, query-num: 1
[2024-07-06 13:59:09,199][ INFO][     dns_server.c:5264] RULE-MATCH, type: 8, domain: dd.cc.bb.aa.in-addr.arpa, rule: 127.10.in-addr.arpa.
[2024-07-06 13:59:09,199][DEBUG][     dns_server.c:2336] reply dd.cc.bb.aa.in-addr.arpa qtype: 12, rcode: 0, reply: 1
[2024-07-06 13:59:09,199][DEBUG][     dns_server.c:1219] result: dd.cc.bb.aa.in-addr.arpa, qtype: 12, return SOA
[2024-07-06 13:59:09,199][ INFO][     dns_server.c:2391] result: dd.cc.bb.aa.in-addr.arpa, client: 127.0.0.1, qtype: 12, id: 25506, group: g1, time: 0ms
  1. 如进程异常,请将coredump功能开启,上传coredump信息文件,同时上传配套的smartdns进程文件。
    在自定义界面,开启设置->自定义设置->生成coredump配置,重现问题后提交coredump文件
    coredump文件在/tmp目录下
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant