SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
18.42k stars 2.21k forks source link

[Feature Request] Support custom port of DNS servers #1989

Open ftiasch opened 1 month ago

ftiasch commented 1 month ago

I have sing-box and smartdns running on my router, where smartdns is used to choose the fastest IP for domestic domains. Since sing-box doesn't support ports other than the default 53 yet, I cannot use smartdns as the upstream server for sing-box.

I think it could be nice to support this.

simplerick-simplefun commented 1 month ago

use iptables/nftables NAT the packet to the desired port? dnat the packet from sing-box to smartdns, and snat the packet back.

yanhao98 commented 1 month ago

支持的吧?

"address": "127.0.0.1:553"
ftiasch commented 1 month ago

支持的吧?

"address": "127.0.0.1:553"

I tried, and it seemed to succeed.

Would it be better to document the usage in https://sing-box.sagernet.org/configuration/dns/server/#address?