tun2proxy / rust-tun

TUN device creation and handling.
https://docs.rs/tun2/
40 stars 17 forks source link

SetInterfaceDnsSettings was not supported by older version of Windows #84

Closed zonyitoo closed 1 month ago

zonyitoo commented 1 month ago

ref shadowsocks/shadowsocks-rust#1589

The procedure entry point SetInterfaceDnsSettings could not be located in the dynamic link library C:\Users\Administrator\Desktop\shadowsocks-rust-master\target\release\full\sslocal.exe.

It was introduced from https://github.com/tun2proxy/rust-tun/pull/74/files .

zonyitoo commented 1 month ago

This is a special feature provided by crate wintun: https://github.com/nulldotblack/wintun/blob/590481325c91debdd52afc2383d07ec9f5bc1523/src/util.rs#L88-L102 .

wintun.dll supports Windows 7, 8, 10, 11: https://git.zx2c4.com/wintun/about/ .

ssrlive commented 1 month ago

You are right. but it's hard to commit patch to wintun crate, similar to tun crate.

https://learn.microsoft.com/en-us/windows/win32/api/netioapi/nf-netioapi-setinterfacednssettings#requirements

zonyitoo commented 1 month ago

Would you consider making set_dns_servers behind a feature gate? For example, adding a feature = "dns_servers".

ssrlive commented 1 month ago

PR welcome, I will merge it in first time.