This commit is contained in:
+8
-2
@@ -3,6 +3,7 @@ package netboxdns
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"time"
|
||||
|
||||
"github.com/coredns/coredns/plugin"
|
||||
@@ -57,8 +58,13 @@ func (netboxdns *NetboxDNS) ServeDNS(
|
||||
) (int, error) {
|
||||
state := request.Request{W: respWriter, Req: reqMsg}
|
||||
qname := state.QName()
|
||||
reqIP, err := netip.ParseAddr(state.IP())
|
||||
if err != nil {
|
||||
return dns.RcodeServerFailure, err
|
||||
}
|
||||
family := state.Family()
|
||||
qtype := fixQType(state.QType(), family)
|
||||
qtype := state.QType()
|
||||
// qtype := fixQType(state.QType(), family)
|
||||
|
||||
// check if plugin is configured to respond to the requested zone
|
||||
respondingZone := plugin.Zones(netboxdns.zones).Matches(qname)
|
||||
@@ -66,7 +72,7 @@ func (netboxdns *NetboxDNS) ServeDNS(
|
||||
return netboxdns.nextOrFailure(reqContext, respWriter, reqMsg)
|
||||
}
|
||||
|
||||
response, err := netboxdns.lookup(qname, qtype, family)
|
||||
response, err := netboxdns.lookup(qname, reqIP, qtype, family)
|
||||
if err != nil {
|
||||
return dns.RcodeServerFailure, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user