Skip to content

Commit

Permalink
Chore: global ipv6 could affect dns ipv6
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Jul 22, 2023
1 parent c7e34bd commit 07ed6e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ type Config struct {

type RawDNS struct {
Enable bool `yaml:"enable"`
IPv6 bool `yaml:"ipv6"`
IPv6 *bool `yaml:"ipv6"`
UseHosts bool `yaml:"use-hosts"`
NameServer []string `yaml:"nameserver"`
Fallback []string `yaml:"fallback"`
Expand Down Expand Up @@ -632,7 +632,7 @@ func parseDNS(rawCfg *RawConfig, hosts *trie.DomainTrie) (*DNS, error) {
dnsCfg := &DNS{
Enable: cfg.Enable,
Listen: cfg.Listen,
IPv6: cfg.IPv6,
IPv6: lo.FromPtrOr(cfg.IPv6, rawCfg.IPv6),
EnhancedMode: cfg.EnhancedMode,
FallbackFilter: FallbackFilter{
IPCIDR: []*net.IPNet{},
Expand Down

0 comments on commit 07ed6e8

Please sign in to comment.