mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-09-29 18:37:58 +03:00
TUN inbound: Add autoSystemDNS on Linux (to TUN's gateway) (#6773)
https://github.com/XTLS/Xray-core/issues/6454#issuecomment-4931311976 https://github.com/XTLS/Xray-core/pull/6773#issuecomment-5755516423 https://github.com/XTLS/Xray-core/pull/6807#issuecomment-5807844210
This commit is contained in:
@@ -165,6 +165,16 @@ func (t *Handler) Start() error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Platform-specific system DNS takeover, where the platform implements it.
|
||||
// Non-fatal: a failure leaves DNS management with the OS.
|
||||
if c, ok := tunInterface.(interface {
|
||||
ConfigureSystemDNS(context.Context, string) error
|
||||
}); ok {
|
||||
if err := c.ConfigureSystemDNS(t.ctx, t.tag); err != nil {
|
||||
errors.LogInfoInner(t.ctx, err, "[tun] system DNS not configured")
|
||||
}
|
||||
}
|
||||
|
||||
t.stack = tunStack
|
||||
t.tun = tunInterface
|
||||
|
||||
|
||||
Reference in New Issue
Block a user