Closed Originalimoc closed 1 month ago
makesure the user running smartdns has full access to the cache file. also confirm that the user pid is the same each time it is run?
not in memory? or partial memory partial on-demand read disk? if so the doc should get an update on the "user nobody" part. Recommend "sudo adduser --system --no-create-home --group smartdns" plus automatically set the ownership before it drops permission to conf defined user
Smartdns reads the cache file when it starts, and periodically writes the cache in memory to the file. Based on your description, I suspect that the user who starts smartdns each time is different, or the file read and write permissions are incorrect.
Well... no Query refused so far, but... Another issue. I set "user smartdns" and "cache-file /var/cache/ smartdns.cache"... Then it makes /var/cache 0750 and owned by smartdns. Don't... Remove this codepath.
0640 by default (I changed it to 0644 for my own use)https://github.com/pymumu/smartdns/blob/84f217dbd19f97e30f24af640ddb4cd21ae1e3ec/src/dns_cache.c#L842
You misunderstood. It somehow made the dir /var/cache its own dir. Not only the file it tries to use.
No. Doesn't work, still returning the status REFUSED DNS result. I always launch smartdns with root and used "user smartdns; cachefile /var/cache/smartdns/smartdns.cache". It is caching negative results somehow.
Well... It's actually returned by upstream dnsmasq but I dig upstream of it no error... Never happened in a few years. Debugging why.
Not smartdns bug. I'll open another issue for that permission problem.
问题现象
nslookup www.bilibili.com 192.168.1.1 Server: router Address: 192.168.1.1
*** routercan't find www.bilibili.com: Query refused
运行环境
固件型号
x86_64 Linux 5.15
运营商
Hybrid upstream
smartdns来源以及版本 Compiled from latest source
涉及的配置(注意去除个人相关信息) bind [::]:53 server 127.0.0.1:5355 prefetch-domain yes serve-expired-prefetch-time 21600 serve-expired yes serve-expired-ttl 259200 serve-expired-reply-ttl 5 dualstack-ip-selection yes dualstack-ip-selection-threshold 15 speed-check-mode ping,tcp:443,tcp:80 user nobody
重现步骤
上游DNS配置。
NA
访问的域名。
NA
信息收集
Does smartdns cache negative response? If so it needs a no-neg-cache option like dnsmasq.