mokeyish / smartdns-rs

A cross platform local DNS server (Dnsmasq like) written in rust to obtain the fastest website IP for the best Internet experience, supports DoT, DoQ, DoH, DoH3.
GNU General Public License v3.0
520 stars 35 forks source link

守护进程的控制接口 Control API of daemon #327

Open cathay4t opened 2 weeks ago

cathay4t commented 2 weeks ago

请问是否有计划支持守护进程的控制接口,方便外部软件(如NetworkManager)将DHCP获取的DNS 服务器添加到守护进程的配置中。

作为参考:

我可以做个unix file socket 的demo.

Do we have any plan on add control API to the daemon in the seek of allowing external tool(e.g. NetworkManager) appending DNS nameserver retrieved from DHCP to SmartDNS-rs daemon?

As reference:

I may create a demo using unix file socket.

mokeyish commented 2 weeks ago

自动更新 DHCP 的 DNS 服务器是某些场景必要的,但我对这个 NetworkManager 通知的协议不了解(还是任何接口都可以,只是触发刷新?)。

cathay4t commented 2 weeks ago

什么接口都可以。 如你没什么偏好,我就做个demo PR我们再讨论。

mokeyish commented 2 weeks ago

我倾向于使用 unix file socket ,这样可以用 http,不用 https 加密。然后处理代码定义在这里。

https://github.com/mokeyish/smartdns-rs/blob/main/src/api/nameserver.rs

目前是开启了 https 的 DoH 监听,才会启用这些http api 接口。