smartdns icon indicating copy to clipboard operation
smartdns copied to clipboard

[Feature Request] 允许设置address规则的TTL

Open uid36216 opened this issue 3 years ago • 5 comments

需求应用场景 本文讨论的配置项是: smartdns: address /doubleclick.net/127.0.0.1 dnsmasq: address=/doubleclick.net/127.0.0.1

应用场景谈不上,只是用于调试。 dnsmasq有配置项local-ttl=1,默认值为0。 smartdns固定address规则的TTL=600,不受rr-ttl-reply-max的影响。

建议的方案 添加一个选项以设置address规则的TTL。 或者让rr-ttl-reply-max=1对address规则生效。

设备信息

  1. 设备信息(CPU,厂家)

  2. 固件信息

uid36216 avatar Aug 04 '22 16:08 uid36216

那个参数?

pymumu avatar Aug 05 '22 14:08 pymumu

address /doubleclick.net/127.0.0.1

ghost avatar Aug 06 '22 07:08 ghost

没看到TTL在哪里设置

pymumu avatar Aug 06 '22 08:08 pymumu

dnsmasq的参数是local-ttl=1

ghost avatar Aug 06 '22 08:08 ghost

配置

address /doubleclick.net/127.0.0.1
rr-ttl-reply-max 1
[RT-N56U_B1 /home/root]# dig qq.com @127.0.0.1 -p 6053

; <<>> DiG 9.18.1 <<>> qq.com @127.0.0.1 -p 6053
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34510
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;qq.com.				IN	A

;; ANSWER SECTION:
qq.com.			1	IN	A	183.3.226.35
qq.com.			1	IN	A	61.129.7.47
qq.com.			1	IN	A	123.151.137.18

;; Query time: 4 msec
;; SERVER: 127.0.0.1#6053(127.0.0.1) (UDP)
;; WHEN: Sun Aug 07 04:40:50 UTC 2022
;; MSG SIZE  rcvd: 83

[RT-N56U_B1 /home/root]# dig doubleclick.net @127.0.0.1 -p 6053

; <<>> DiG 9.18.1 <<>> doubleclick.net @127.0.0.1 -p 6053
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22633
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;doubleclick.net.		IN	A

;; ANSWER SECTION:
doubleclick.net.	600	IN	A	127.0.0.1

;; Query time: 4 msec
;; SERVER: 127.0.0.1#6053(127.0.0.1) (UDP)
;; WHEN: Sun Aug 07 04:41:07 UTC 2022
;; MSG SIZE  rcvd: 49

[RT-N56U_B1 /home/root]# 

ghost avatar Aug 07 '22 04:08 ghost

最新代码支持local-ttl设置。

pymumu avatar Aug 15 '22 13:08 pymumu