Skip to content

Commit

Permalink
Disable IPv6 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Soulou committed May 13, 2019
1 parent 0cbc33f commit 469c97b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ func (h *GODNSHandler) do(Net string, w dns.ResponseWriter, req *dns.Msg) {
Class: dns.ClassINET,
Ttl: settings.Hosts.TTL,
}
for _, ip := range ips {
aaaa := &dns.AAAA{rr_header, ip}
m.Answer = append(m.Answer, aaaa)
if settings.ResolvConfig.IPv6 {
for _, ip := range ips {
aaaa := &dns.AAAA{rr_header, ip}
m.Answer = append(m.Answer, aaaa)
}
}
}

Expand Down
1 change: 1 addition & 0 deletions settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type ResolvSettings struct {
SetEDNS0 bool
ServerListFile string `toml:"server-list-file"`
ResolvFile string `toml:"resolv-file"`
IPv6 bool `toml:"ipv6"`
}

type DNSServerSettings struct {
Expand Down

0 comments on commit 469c97b

Please sign in to comment.