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

Log file #7

Open
jacky441 opened this issue Apr 12, 2023 · 6 comments
Open

Log file #7

jacky441 opened this issue Apr 12, 2023 · 6 comments

Comments

@jacky441
Copy link

请问怎么设置能自动保存/记录 所有解析的域名 最后使用的是什么dns服务器 国内或者国外的 dns 解析的?

@jacky441
Copy link
Author

我尝试添加了自定义 脚本 估计是因为 脚本只支持 ash?
custom:

  • "cd /etc/cleardns/ && pkill -9 overture && overture -c overture.json -v > overture.log 2>&1 &"

但是好像没成功

@dnomd343
Copy link
Owner

可以在运行启动时加入 --debug 选项,或者添加 DEBUG=TRUE 来进入 debug 模式,使 overture 输出 debug 级别日志,输出的内容将会打印在 stdout 中,由于 golang 的日志格式和其他进程不同,可以方便地过滤出来。

$ docker run --rm -it dnomd343/cleardns --debug | grep -E '\[[0-9]{4}(-[0-9]{2}){2}'
INFO[2023-04-13 07:52:10] Overture v1.8
INFO[2023-04-13 07:52:10] If you want to use overture safe and sound, please read the README.md from project repository: https://github.com/shawn1m/overture
INFO[2023-04-13 07:52:10] Domain file chinalist.txt has been loaded with 72780 records (suffix-tree)
INFO[2023-04-13 07:52:10] Domain file gfwlist.txt has been loaded with 6573 records (suffix-tree)
INFO[2023-04-13 07:52:10] IP network file china-ip.txt has been loaded with 8429 records
WARN[2023-04-13 07:52:10] No element has been loaded from IP network file: /dev/null
INFO[2023-04-13 07:52:10] Minimum TTL is disabled
INFO[2023-04-13 07:52:10] Cache is disabled
INFO[2023-04-13 07:52:10] Hosts file has been loaded successfully
DEBU[2023-04-13 07:52:10] Init resolver for Domestic succeed
DEBU[2023-04-13 07:52:10] Init resolver for Foreign succeed
INFO[2023-04-13 07:52:10] Overture is listening on :5353
DEBU[2023-04-13 07:52:10] Question from 127.0.0.1: ;adguardteam.github.io.      IN       A
DEBU[2023-04-13 07:52:10] Domain Primary match fail
DEBU[2023-04-13 07:52:10] Matched                                       DNS=Alternative domain=adguardteam.github.io question=adguardteam.github.io
DEBU[2023-04-13 07:52:10] Finally use Alternative DNS
DEBU[2023-04-13 07:52:10] Question from 127.0.0.1: ;adguardteam.github.io.      IN       AAAA
DEBU[2023-04-13 07:52:10] Use  as original ednsClientSubnetIP
DEBU[2023-04-13 07:52:10] Use  as ednsClientSubnetIP
DEBU[2023-04-13 07:52:10] Domain Primary match fail
DEBU[2023-04-13 07:52:10] Matched                                       DNS=Alternative domain=adguardteam.github.io question=adguardteam.github.io
DEBU[2023-04-13 07:52:10] Finally use Alternative DNS
DEBU[2023-04-13 07:52:10] Use  as original ednsClientSubnetIP
DEBU[2023-04-13 07:52:10] Use  as ednsClientSubnetIP
DEBU[2023-04-13 07:52:10] Creating new connection to 127.0.0.1:6053
DEBU[2023-04-13 07:52:10] Creating new connection to 127.0.0.1:6053
DEBU[2023-04-13 07:52:11] Answer from Foreign: adguardteam.github.io.   583     IN      A       185.199.111.153
DEBU[2023-04-13 07:52:11] Answer from Foreign: adguardteam.github.io.   583     IN      A       185.199.108.153
DEBU[2023-04-13 07:52:11] Answer from Foreign: adguardteam.github.io.   583     IN      A       185.199.110.153
DEBU[2023-04-13 07:52:11] Answer from Foreign: adguardteam.github.io.   583     IN      A       185.199.109.153
DEBU[2023-04-13 07:52:11] Answer from Foreign: adguardteam.github.io.   3340    IN      AAAA    2606:50c0:8000::153
DEBU[2023-04-13 07:52:11] Answer from Foreign: adguardteam.github.io.   3340    IN      AAAA    2606:50c0:8001::153
DEBU[2023-04-13 07:52:11] Answer from Foreign: adguardteam.github.io.   3340    IN      AAAA    2606:50c0:8002::153
DEBU[2023-04-13 07:52:11] Answer from Foreign: adguardteam.github.io.   3340    IN      AAAA    2606:50c0:8003::153

@dnomd343
Copy link
Owner

我尝试添加了自定义 脚本 估计是因为 脚本只支持 ash? custom:

  • "cd /etc/cleardns/ && pkill -9 overture && overture -c overture.json -v > overture.log 2>&1 &"

但是好像没成功

这个不是 ash 的问题,custom 会在启动前执行,但这个时候 overture 还没被引导,这里先启动会导致端口冲突,但这时候是正常运行的。然后在子进程引导完成后,会触发一次自动更新,更新完成后 overture 会被重启,这个时候带有 log 输出的 overture 会被杀掉,重新替换成 cleardns 引导的进程。

@jacky441
Copy link
Author

因为我的docker是在爱快里面运行的
所以访问stdout 日志很不方便

能否考虑添加 自定义 log 文件?

@dnomd343
Copy link
Owner

可以的,后续版本会加上。

@jacky441
Copy link
Author

jacky441 commented Apr 13, 2023 via email

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