diff --git a/synthetic.go b/synthetic.go index 3d25b0a..5f0abe4 100644 --- a/synthetic.go +++ b/synthetic.go @@ -96,7 +96,7 @@ func (s synthetic) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Ms } // handle AAAA requests with IPv6 address - if ip.To16() != nil && state.QType() == dns.TypeAAAA { + if ip.To4() == nil && state.QType() == dns.TypeAAAA { log.Debug("Responding to AAAA request for ", state.QName()) m := new(dns.Msg) m.SetReply(r) @@ -118,7 +118,7 @@ func (s synthetic) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Ms } // handle A requests with IPv6 address (respond with empty answer and NOERROR) - if ip.To16() != nil && state.QType() == dns.TypeA { + if ip.To4() == nil && state.QType() == dns.TypeA { log.Debug("Responding to A request for ", state.QName(), " with empty answer") m := new(dns.Msg) m.SetReply(r)