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

Termux 中读取了 /etc/resolv.conf #187

Closed
Pony-CW opened this issue Aug 17, 2024 · 11 comments
Closed

Termux 中读取了 /etc/resolv.conf #187

Pony-CW opened this issue Aug 17, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@Pony-CW
Copy link
Contributor

Pony-CW commented Aug 17, 2024

Termux 由于是独立的环境,能否通过系统检测,把文件位置从/etc/resolv.conf修改为/data/data/com.termux/files/usr/etc/resolv.conf
ResizedImage_2024-08-17_17-24-03_1088.jpg

@URenko
Copy link
Owner

URenko commented Aug 17, 2024

理论上应该不涉及读取 /etc/resolv.conf.

你的 config.toml 中的 [DNS][hosts] 节是如何的

@Pony-CW
Copy link
Contributor Author

Pony-CW commented Aug 17, 2024

理论上应该不涉及读取 /etc/resolv.conf.

你的 config.toml 中的 [DNS][hosts] 节是如何的

...
[DNS]
nameserver = [
  "https://1.1.1.1/dns-query"
]
...
[hosts]
"1.1.1.1" = "1.1.1.1"
...

🤣

@URenko
Copy link
Owner

URenko commented Aug 17, 2024

试着临时性地安装 https://github.com/URenko/dnspython 以查看调用栈

另外因为是 5.125 秒后失败,1.1.1.1 实际上无法连接的可能性较高

@jonm58
Copy link

jonm58 commented Aug 17, 2024

如果你在国内不使用tz或者其他方法的情况,能使用1.1.1.1 DoH你真NB!
我这边的1.1.1.1是华为防火墙的login页面

@Pony-CW
Copy link
Contributor Author

Pony-CW commented Aug 17, 2024

试着临时性地安装 https://github.com/URenko/dnspython 以查看调用栈

我滴乖乖这是我安装的姿势不对吗?

这个复制的日志…手动消除空格……

░▒▓   …/lib/python3.11/site-packages   20:27 
❯ rm -rf dns/ dnspython-2.7.0.dev0.dist-info/

░▒▓   ~   20:27 
❯ pipx inject -vf accesser git+https://github.com/URenko/dnspython.git
pipx >(setup:1083): pipx version is 1.6.0
pipx >(setup:1084): Default python interpreter is '/data/data/com.termux/files/usr/bin/python3.11'
pipx >(run_pipx_command:218): Virtual Environment location is /data/data/com.termux/files/home/.local/share/pipx/venvs/accesser
pipx >(inject:135): Injecting packages: ['git+https://github.com/URenko/dnspython.git']
pipx >(run_subprocess:175): running <checking pip's availability>
pipx >(needs_upgrade:83): Time since last upgrade of shared libs, in seconds: 190343. Upgrade will be run by pipx if greater than 2592000.
pipx >(run_subprocess:175): running <checking pip's availability>
pipx >(_parsed_package_to_package_or_url:139): cleaned package spec: git+https://github.com/URenko/dnspython.git
pipx >(create_venv:162): Creating virtual environment
creating virtual environment...
pipx >(run_subprocess:175): running /data/data/com.termux/files/home/.local/share/pipx/venvs/accesser/bin/python -m venv --without-pip /data/data/com.termux/files/usr/tmp/tmp4bdig6i1
pipx >(run_subprocess:175): running <checking pip's availability>
pipx >(run_subprocess:175): running /data/data/com.termux/files/usr/tmp/tmp4bdig6i1/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:175): running /data/data/com.termux/files/home/.local/share/pipx/shared/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:175): running /data/data/com.termux/files/usr/tmp/tmp4bdig6i1/bin/python --version
determining package name from 'git+https://github.com/URenko/dnspython.git'...
pipx >(run_subprocess:175): running /data/data/com.termux/files/usr/tmp/tmp4bdig6i1/bin/python -m pip list --format=json
pipx >(run_subprocess:175): running /data/data/com.termux/files/usr/tmp/tmp4bdig6i1/bin/python -m pip --no-input install --no-dependencies git+https://github.com/URenko/dnspython.git
pipx >(run_subprocess:175): running /data/data/com.termux/files/usr/tmp/tmp4bdig6i1/bin/python -m pip list --format=json
pipx >(install_package_no_deps:333): Determined package name: dnspython
pipx >(package_name_from_spec:390): Package name determined in 9.8s
pipx >(_parsed_package_to_package_or_url:139): cleaned package spec: git+https://github.com/URenko/dnspython.git
pipx >(install_package:245): Installing dnspython from spec 'git+https://github.com/URenko/dnspython.git'
installing dnspython from spec 'git+https://github.com/URenko/dnspython.git'...
pipx >(run_subprocess:175): running /data/data/com.termux/files/home/.local/share/pipx/venvs/accesser/bin/python -m pip --no-input install git+https://github.com/URenko/dnspython.git
pipx >(run_subprocess:175): running <fetch_info_in_venv commands>
pipx >(get_venv_metadata_for_package:349): get_venv_metadata_for_package: 97ms
pipx >(_parsed_package_to_package_or_url:139): cleaned package spec: git+https://github.com/URenko/dnspython.git
  injected package dnspython into venv accesser
done! ✨ 🌟 ✨

然后……
ResizedImage_2024-08-17_20-32-32_9177.jpg

从原仓库安装的就没这一堆报错,这是我改回 Clash-Meta 开放的本地 DNS 端口时的状况

[DNS]
nameserver = [
  "127.0.0.1:1053"
]

另外因为是 5.125 秒后失败,1.1.1.1 实际上无法连接的可能性较高

tls://1.1.1.1没啥问题

@jonm58
Copy link

jonm58 commented Aug 17, 2024

tls://1.1.1.1没啥问题

DoT和DoH用的不是同样的端口
DoH使用与其他HTTPS流量相同的TCP端口,即端口443
DoT为端口853

@URenko
Copy link
Owner

URenko commented Aug 17, 2024

安装的姿势没问题
修改了,你可以重新安装。

预计调用栈输出比较多,你可以从最开始这种输出的地方截图。

@Pony-CW
Copy link
Contributor Author

Pony-CW commented Aug 17, 2024

预计调用栈输出比较多,你可以从最开始这种输出的地方截图。

真的…多……多到我整个行数缓存都被刷没了
ResizedImage_2024-08-17_21-15-00_7724.jpg

@Pony-CW
Copy link
Contributor Author

Pony-CW commented Aug 17, 2024

哦我再补充一下,https://223.5.5.5/dns-query也是暴毙

逐渐意识到这问题有点太小了,termux用户简直可以忽略不计,可修可不修吧,可别苦恼了开发者😂

@URenko
Copy link
Owner

URenko commented Aug 17, 2024

应该是上游 dnspython 的 bug,试着再次安装 https://github.com/URenko/dnspython (现在这是一个修复而非测试)。

[hosts]
"1.1.1.1" = "1.1.1.1"

在这一情况下仍是需要的

如果没问题我就推到上游去

@Pony-CW
Copy link
Contributor Author

Pony-CW commented Aug 17, 2024

应该是上游 dnspython 的 bug,试着再次安装 https://github.com/URenko/dnspython (现在这是一个修复而非测试)。

[hosts]
"1.1.1.1" = "1.1.1.1"

在这一情况下仍是需要的

如果没问题我就推到上游去

确实可以了
ResizedImage_2024-08-17_22-59-59_1568.jpg

https://223.5.5.5/dns-query也一样受[hosts]影响,加上后也没问题了

@URenko URenko added the bug Something isn't working label Aug 17, 2024
@URenko URenko closed this as completed in 8bbba48 Oct 6, 2024
URenko added a commit that referenced this issue Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants