[Help] 经常出现ttl为0的情况,导致网站需要刷新多次
Lxeon opened this issue · 1 comments
Lxeon commented
在提交之前,请确认
- 我已经尝试执行test.sh并搜索过Issue和discussions和文档,但没有找到相关问题。
- 我正在使用最新的docker镜像版本(可以尝试
docker pull sliamb/paopaodns:latest
后重新创建容器)。
test.sh脚本自检日志
localhost:~/docker# docker exec -it paopaodns test.sh
*********************************************************************************
images build time : 2024-08-22 12:29:32 UTC
check for the latest version ,
go to https://github.com/kkkgo/PaoPaoDNS/discussions
-> test start `1724648660`
[INFO] ALL TEST PASS.?
-> test end `1724648662`
*********************************************************************************
debug.sh脚本自检日志
localhost:~/docker# docker exec -it paopaodns debug.sh
### == debug.sh : docker exec -it paopaodns sh ==
-> debug start `1724648682`
[INFO] images build time : 2024-08-22 12:29:32 UTC
[OK]DATA_writeable
[OK]DATA_readable
[INFO] NETWORK
*********************************************************************************
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
371: eth0@if372: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
inet 172.18.0.2/16 brd 172.18.255.255 scope global eth0
default via 172.18.0.1 dev eth0
172.18.0.0/16 dev eth0 scope link src 172.18.0.2
traceroute to 120.53.53.53 (120.53.53.53), 4 hops max, 46 byte packets
1 172.18.0.1 (172.18.0.1) 0.004 ms 0.004 ms 0.004 ms
2 192.168.100.1 (192.168.100.1) 0.132 ms 0.146 ms 0.136 ms
3 172.67.0.1 (172.67.0.1) 2.378 ms 2.528 ms 2.387 ms
4 * * *
PING 223.5.5.5 (223.5.5.5): 56 data bytes
64 bytes from 223.5.5.5: seq=0 ttl=118 time=12.197 ms
--- 223.5.5.5 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 12.197/12.197/12.197 ms
PING 119.29.29.29 (119.29.29.29): 56 data bytes
64 bytes from 119.29.29.29: seq=0 ttl=51 time=19.682 ms
--- 119.29.29.29 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 19.682/19.682/19.682 ms
Server: 223.5.5.5
Address: 223.5.5.5#53
Non-authoritative answer:
www.taobao.com canonical name = www.taobao.com.danuoyi.tbcache.com.
Name: www.taobao.com.danuoyi.tbcache.com
Address: 183.240.215.191
Name: www.taobao.com.danuoyi.tbcache.com
Address: 120.240.64.232
Name: www.taobao.com.danuoyi.tbcache.com
Address: 120.240.64.233
Name: www.taobao.com.danuoyi.tbcache.com
Address: 183.240.215.190
Name: www.taobao.com.danuoyi.tbcache.com
Address: 2409:8c54:2010:601:3::3ee
Name: www.taobao.com.danuoyi.tbcache.com
Address: 2409:8c54:2810:9020:3::3db
Name: www.taobao.com.danuoyi.tbcache.com
Address: 2409:8c54:1801:12:3::3d4
Name: www.taobao.com.danuoyi.tbcache.com
Address: 2409:8c54:2010:601:3::3ef
Name: www.taobao.com.danuoyi.tbcache.com
Address: 2409:8c54:1801:12:3::3d5
Name: www.taobao.com.danuoyi.tbcache.com
Address: 2409:8c54:2810:9020:3::3dc
Server: 119.29.29.29
Address: 119.29.29.29#53
Non-authoritative answer:
www.qq.com canonical name = ins-r23tsuuf.ias.tencent-cloud.net.
Name: ins-r23tsuuf.ias.tencent-cloud.net
Address: 112.53.42.52
Name: ins-r23tsuuf.ias.tencent-cloud.net
Address: 112.53.42.114
Name: ins-r23tsuuf.ias.tencent-cloud.net
Address: 2409:8c54:871:2::34
Name: ins-r23tsuuf.ias.tencent-cloud.net
Address: 2409:8c54:871:1::73
*********************************************************************************
[INFO] ENV
*********************************************************************************
====ENV TEST====
[OK]DATA_writeable-
[OK]DATA_readable-
MEM:50m 100m 200 100mb
prefPC:9
CORES:-1-
POWCORES:-1-
ulimit :-1048576-
FDLIM :-1-
TZ:-Asia/Shanghai-
UPDATE:-daily-
DNS_SERVERNAME:-PaoPaoDNS-
SERVER_IP:-192.168.100.3-
ETHIP:-172.18.0.2-
DNSPORT:-53-
SOCKS5:-no-
CNAUTO:-yes-
IPV6:-only6-
CNFALL:-yes-
CUSTOM_FORWARD:-IP:PORT-
AUTO_FORWARD:-yes-
AUTO_FORWARD_CHECK:-yes-
USE_MARK_DATA:-yes-
RULES_TTL:-0-
CUSTOM_FORWARD_TTL:-0-
SHUFFLE:-no-
EXPIRED_FLUSH:-yes-
CN_TRACKER:-yes-
USE_HOSTS:-yes-
HTTP_FILE:-no-
SAFEMODE:-no-
QUERY_TIME:-2000ms-
ADDINFO:-no-
PLATFORM:-Linux 7e5964dc68f8 6.6.44-0-virt #1-Alpine SMP PREEMPT_DYNAMIC 2024-08-05 06:49:58 x86_64 Linux-
====ENV TEST====
mosdns kkkgo/mosdns:240822.1
total 70M
4.0K drwxrwxrwx 3 0 0 4.0K Aug 26 12:58 .
4.0K drwxr-xr-x 1 0 0 4.0K Aug 26 12:58 ..
248.0K -rwxrwxrwx 1 0 0 247.9K Aug 26 12:58 Country-only-cn-private.mmdb
0 -rwxrwxrwx 1 0 0 0 Aug 15 23:23 custom_cn_mark.txt
4.0K -rwxrwxrwx 1 0 0 233 Aug 26 13:00 custom_env.ini
4.0K -rwxrwxrwx 1 0 0 416 Aug 26 13:02 custom_mod.yaml
4.0K drwxrwxrwx 2 0 0 4.0K Aug 26 13:02 dnscrypt-resolvers
4.0K -rwxrwxrwx 1 0 0 3.0K Aug 26 12:58 dnscrypt.toml
4.0K -rwxrwxrwx 1 0 0 670 Aug 8 11:57 force_dnscrypt_list.txt
4.0K -rwxrwxrwx 1 0 0 370 Aug 8 11:57 force_forward_list.txt
4.0K -rwxrwxrwx 1 0 0 387 Aug 8 11:57 force_recurse_list.txt
1.3M -rwxrwxrwx 1 0 0 1.3M Aug 26 13:00 global_mark.dat
12.0K -rwxrwxrwx 1 0 0 10.0K Aug 26 12:58 mosdns.yaml
8.0K -rwxrwxrwx 1 0 0 5.7K Aug 26 12:58 redis.conf
67.8M -rwxrwxrwx 1 0 0 67.8M Aug 26 11:42 redis_dns_v2.rdb
16.0K -rwxrwxrwx 1 0 0 13.6K Aug 26 13:00 trackerslist.txt
52.0K -rwxrwxrwx 1 0 0 50.9K Aug 26 12:58 unbound.conf
4.0K -rwxrwxrwx 1 0 0 441 Aug 26 13:02 unbound_custom.conf
*********************************************************************************
[INFO] PS
*********************************************************************************
PID USER TIME COMMAND
1 root 0:00 {init.sh} /bin/sh /usr/sbin/init.sh
13 root 0:00 crond
45 root 0:00 redis-server unixsocket:/tmp/redis.sock
152 root 0:00 dnscrypt-proxy -config /data/dnscrypt-resolvers/dnscrypt.toml
164 root 0:00 unbound -c /tmp/unbound_forward.conf -p
177 root 0:00 mosdns start -d /tmp -c /tmp/mosdns.yaml
188 root 0:00 unbound -c /tmp/unbound_raw.conf -p
189 root 0:00 {watch_list.sh} /bin/sh /usr/sbin/watch_list.sh
190 root 0:00 {data_update.sh} /bin/sh /usr/sbin/data_update.sh
195 root 0:00 tail -f /dev/null
226 root 0:00 inotifywait -e modify,delete /etc/unbound/named.cache /data/Country-only-cn-private.mmdb /data/force_recurse_list.txt
576 root 0:00 {data_update.sh} /bin/sh /usr/sbin/data_update.sh
577 root 0:00 mosdns curl https://www.internic.net/domain/named.cache.md5
578 root 0:00 grep -Eo [0-9A-Za-z]{32}
580 root 0:00 head -1
585 root 0:00 {debug.sh} /bin/sh /usr/sbin/debug.sh
607 root 0:00 ps -ef
188 root 0:00 unbound -c /tmp/unbound_raw.conf -p
unbound OK.
164 root 0:00 unbound -c /tmp/unbound_forward.conf -p
unbound_forward OK.
*********************************************************************************
[INFO] TOP
*********************************************************************************
CPU: 0% usr 0% sys 0% nic 100% idle 0% io 0% irq 0% sirq
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
177 1 root S 1211m 61% 1 0% mosdns start -d /tmp -c /tmp/mosdn
152 1 root S 1210m 61% 1 0% dnscrypt-proxy -config /data/dnscr
577 576 root S 1209m 61% 1 0% mosdns curl https://www.internic.n
45 1 root S 125m 6% 0 0% redis-server unixsocket:/tmp/redis
188 1 root S 11984 1% 0 0% unbound -c /tmp/unbound_raw.conf -
164 1 root S 11812 1% 0 0% unbound -c /tmp/unbound_forward.co
189 1 root S 1700 0% 1 0% {watch_list.sh} /bin/sh /usr/sbin/
190 1 root S 1656 0% 1 0% {data_update.sh} /bin/sh /usr/sbin
576 190 root S 1656 0% 0 0% {data_update.sh} /bin/sh /usr/sbin
1 0 root S 1644 0% 0 0% {init.sh} /bin/sh /usr/sbin/init.s
585 0 root S 1640 0% 1 0% {debug.sh} /bin/sh /usr/sbin/debug
614 585 root R 1636 0% 1 0% top -n1
195 1 root S 1628 0% 1 0% tail -f /dev/null
578 576 root S 1624 0% 0 0% grep -Eo [0-9A-Za-z]{32}
615 585 root S 1624 0% 0 0% grep %
580 576 root S 1624 0% 0 0% head -1
226 189 root S 1084 0% 1 0% inotifywait -e modify,delete /etc/
13 1 root S 872 0% 1 0% crond
*********************************************************************************
[INFO] REDIS
*********************************************************************************
used_memory_human:83.51M
used_memory_rss_human:106.86M
used_memory_peak_human:83.54M
total_system_memory_human:1.93G
used_memory_lua_human:31.00K
used_memory_vm_total_human:63.00K
used_memory_scripts_human:181B
maxmemory_human:100.00M
(integer) 28777
*********************************************************************************
[TEST] IP ROUTE
*********************************************************************************
CN IP URL:
120.229.28.254
-
120.229.28.254
--
120.229.28.254
CN RAW-IP URL:
120.229.28.254
------------------
Non-CN IP URL:
43.255.119.6
-
120.229.28.254
--
43.255.119.6
Non-CN RAW-IP URL:
43.255.119.6
-
43.255.119.6
--
43.255.119.6
---
43.255.119.6
------------------
IP INFO:
43.255.119.6
HK,undefined,undefined
ASN38136/Akari Networks
HTTP/1.1
Mozilla/5.0 Gecko/20100101 Firefox/120.0 https://github.com/kkkgo/PaoPaoDNS
Asia/Hong_Kong Time: 8/26/2024, 1:06:51 PM
[INFO] force_recurse_list
domain:whoami.ds.akahelp.net
domain:whoami.03k.org
MOSDNS WHOAMI :
MOSDNS akahelp: "ns" "120.232.21.163"
"ip" "120.232.21.163"
"ecs" "120.229.28.0/24/24"
MOSDNS 03k: 120.232.21.163
UNBOUND WHOAMI:
UNBOUND akahelp: "ip" "120.232.21.163"
"ecs" "120.229.28.0/24/24"
"ns" "120.232.21.163"
UNBOUND 03k: 120.232.21.163
*********************************************************************************
[TEST] HIJACK
*********************************************************************************
;; communications error to 9.8.7.5#53: timed out
;; no servers could be reached
;; communications error to 9.8.7.6#53: timed out
;; no servers could be reached
HIJACK 127.0.0.1 = 112.25.12.178
*********************************************************************************
[TEST] DIG-CN [taobao]
*********************************************************************************
MOSDNS CN:
www.taobao.com.danuoyi.tbcache.com.
183.240.215.190
183.240.215.191
120.240.64.233
120.240.64.232
UNBOUND CN:
www.taobao.com.danuoyi.tbcache.com.
183.240.215.191
120.240.64.233
120.240.64.232
183.240.215.190
[TEST] DIG-NOCN [youtube]
MOSDNS NOCN:
youtube-ui.l.google.com.
64.233.188.93
108.177.97.91
DNSCRYPT-UNBOUND NOCN:
youtube-ui.l.google.com.
64.233.187.91
64.233.187.93
DNSCRYPT NOCN:
youtube-ui.l.google.com.
142.250.197.78
142.250.197.14
DNSCRYPT-SOCKS5 NOCN:
;; communications error to 127.0.0.1#5303: connection refused
;; no servers could be reached
*********************************************************************************
[TEST] DUAL CN [IPv6=YES will have aaaa,taobao]
*********************************************************************************
[TEST] DUAL NOCN [IPv6=YES will block aaaa,youtube]
[TEST] ONLY6 [IPv6=only6 will block aaaa if a ok]
checkipv6.synology.com : ddns-checkipv6.quickconnect.to.
checkipv6.digitalocean.synology.com.
2604:a880:2:d0::4c0:2001
2604:a880:2:d0::17e8:4001
ip6.03k.org : 2606:4700:3037::ac43:c96c
2606:4700:3034::6815:15ef
6.ipw.cn : 2400:8905::f03c:94ff:fe1c:a95e
*********************************************************************************
[info] ALL TEST FINISH.
-> debug end `1724648788`
问题描述和复现步骤
ttl为0,此时得多刷新几次才能进网站
使用了https://github.com/kkkgo/PaoPaoDNS/discussions/131 自定义递归对接服务器”外包“
配置如下:
kkkgo commented
ttl为0和网站需要刷新多次不一定有联系。
ttl为0是乐观缓存,在ttl过期之后,会设置为0继续提供给下一次,同时请求新记录。
对于绝大多数网站来说,解析记录不是变化非常频繁的,记录可以直接用并且秒开。热门网站只要一直保持有访问,记录就会不断刷新(除非上游响应超时,例如*DoT会消耗更多资源和增加延迟,使用公共DoT DNS的提供商可能会对你的请求进行限速。),在这期间DNS解析记录都会有一个过渡期,不会导致无法访问。
如果是更新比较频繁的比如DDNS记录的网站,可以手动使用RULES_TTL功能或者custom_mod自定义,详情可以查阅文档。
如果你完全不想用乐观缓存带来的好处(不想看到ttl为0),那么你可以在unbound_custom定义:
serve-expired: no