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

lxc 下 /etc/resolv.conf 的bug #1586

Closed
happy42779 opened this issue Dec 8, 2023 · 4 comments
Closed

lxc 下 /etc/resolv.conf 的bug #1586

happy42779 opened this issue Dec 8, 2023 · 4 comments

Comments

@happy42779
Copy link

问题现象
简要描述问题出现的现象

运行环境

  1. 固件型号
    pve 8.1.3
    lxc debian-11-standard_11.3-0

  2. 运营商

  3. smartdns来源以及版本

smartdns 33+dfsg-2.1

  1. 涉及的配置(注意去除个人相关信息)
bind [::]:53

cache-size 8192

# enable persist cache when restart
cache-persist yes
cache-file /tmp/smartdns.cache
prefetch-domain yes

speed-check-mode none
dualstack-ip-selection no

log-file /var/log/smartdns.log
log-size 128k
log-level error

audit-enable no

nameserver 223.5.5.5 -group domestic
nameserver 1.1.1.1 -group overseas -exclude-default-group
nameserver 8.8.8.8 -group overseas -exclude-default-group

domain-set -name gfw -file /etc/smartdns/gfw.conf
domain-set -name custom -file /etc/smartdns/custom.conf
nameserver /domain-set:gfw/overseas
nameserver /domain-set:custom/overseas

重现步骤

  1. 上游DNS配置。

  2. 访问的域名。

任意

信息收集

  1. 将/var/log/smrtdns.log日志作为附件上传(注意去除个人相关信息)。

  2. 如进程异常,请将coredump功能开启,上传coredump信息文件,同时上传配套的smartdns进程文件。
    在自定义界面,开启设置->自定义设置->生成coredump配置,重现问题后提交coredump文件
    coredump文件在/tmp目录下

  3. log

root@smartdns:~# tail /var/log/smartdns.log 
[2023-12-07 17:35:26,670][ERROR][       smartdns.c:275 ] load dns from resolv failed.
[2023-12-07 17:35:28,922][ERROR][       smartdns.c:275 ] load dns from resolv failed.
[2023-12-07 17:35:31,170][ERROR][       smartdns.c:275 ] load dns from resolv failed.
[2023-12-07 17:35:33,422][ERROR][       smartdns.c:275 ] load dns from resolv failed.
[2023-12-07 17:35:35,670][ERROR][       smartdns.c:275 ] load dns from resolv failed.
[2023-12-07 17:35:37,922][ERROR][       smartdns.c:275 ] load dns from resolv failed.
[2023-12-07 17:35:40,170][ERROR][       smartdns.c:275 ] load dns from resolv failed.
[2023-12-07 17:35:42,422][ERROR][       smartdns.c:275 ] load dns from resolv failed.
[2023-12-07 17:35:44,678][ERROR][       smartdns.c:275 ] load dns from resolv failed.
[2023-12-07 17:35:46,922][ERROR][       smartdns.c:275 ] load dns from resolv failed.
  1. /etc/resolv.conf
root@smartdns:~# cat /etc/resolv.conf 
# --- BEGIN PVE ---
#search proxy-gateway
nameserver 127.0.0.1
# --- END PVE ---
  1. 问题描述:
    a. 如果 /etc/resolv.conf 里面指定nameserver 127.0.0.1 并启动smartdns后会导致cpu,内存,磁盘全部满载。必须强制停止lxc
    b. 如果/etc/resolv.conf 里面删除nameserver 127.0.0.1 即没有任何实质配置, smartdns启动会报错,错误信息如上方log所示。
@PikuZheng
Copy link
Contributor

感觉运行时没有加载到配置啊,没上游才会去读resolv.conf

@happy42779
Copy link
Author

感觉运行时没有加载到配置啊,没上游才会去读resolv.conf

可是这个配置我在不同的地方都用了呀。没出啥问题。 大佬有什么建议吗?

@PikuZheng
Copy link
Contributor

直接运行smartdns -f -x -c /配置文件路径.conf 看报什么错

@happy42779
Copy link
Author

直接运行smartdns -f -x -c /配置文件路径.conf 看报什么错

啊,谢谢大佬。找到问题了。有一个关键字用错了 nameserver 223.5.5.5 应该是 server 223.5.5.5 以后可以用这些参数来调试了,之前还觉得怎么没有一些syntax 检查之类的功能。再次感谢!

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

2 participants