Skip to content

Commit

Permalink
feat(dns): disable DNS cache on macOS (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
igoogolx authored Jan 3, 2025
1 parent 569812a commit a51d018
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/cfg/tun.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/igoogolx/itun2socks/internal/cfg/outbound"
"github.com/igoogolx/itun2socks/internal/cfg/tun"
"github.com/igoogolx/itun2socks/internal/configuration"
"runtime"
)

type Config struct {
Expand All @@ -29,12 +30,16 @@ func NewTun(defaultInterfaceName string) (*Config, error) {
if err != nil {
return nil, err
}
disableDnsCache := rawConfig.Setting.Dns.DisableCache
if runtime.GOOS == "darwin" {
disableDnsCache = true
}
rule, err := distribution.NewTun(
rawConfig.Setting.Dns.Server.Boost,
rawConfig.Setting.Dns.Server.Remote,
rawConfig.Setting.Dns.Server.Local,
defaultInterfaceName,
rawConfig.Setting.Dns.DisableCache,
disableDnsCache,
)

if err != nil {
Expand Down

0 comments on commit a51d018

Please sign in to comment.