有没有可能自动获取DHCP派发下来的DNS地址 #213
laggardkernel
started this conversation in
Ideas
Replies: 3 comments 15 replies
-
有可能。看 clash 的 commit 它是做了一个 dhcp 客户端然后去拉服务端的数据。工作量有点大..... 我有个懒人的想法: 让 mosdns 运行后去运行一个 bash 脚本去获取 dns 服务器地址。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
功能有了。现在配置文件里可以加 所以可以自己写一个脚本 get_dhcp_dns.sh ,获取 IP,然后配置写成 tag: 'forward_dhcp'
type: fast_forward
args:
upstream:
- addr: ${{ ./get_dhcp_dns.sh }}
timeout: 3 |
Beta Was this translation helpful? Give feedback.
8 replies
-
@IrineSistiana 有点问题。我的配置中使用了 vim foldmarker |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
目前对于
.lan
域名,需要转发给路由器下发的DNS,以支持解析到局域网内其他设备。有没有可能自定识别出上游DHCP下发的DNS地址?现在我只能写死这种地址,根据不同网络还要去更改它。目前我知道 NetworkManager 会将DHCP DNS信息存盘
Clash 好像也实现了这种功能 https://github.com/Dreamacro/clash/pull/1509
提供部分相关配置说明一下我要做什么
Beta Was this translation helpful? Give feedback.
All reactions