Skip to content

Commit

Permalink
Merge pull request #39 from qk4l/master
Browse files Browse the repository at this point in the history
Return NXDOMAIN if DNS name have not found in Netbox
  • Loading branch information
oz123 authored Aug 7, 2023
2 parents 4e397ab + 192f77a commit 81715e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions netbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ func (n *Netbox) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
// return SERVFAIL here without fallthrough
return dnserror(dns.RcodeServerFailure, state, err)
}

if len(answers) == 0 {
if n.Fall.Through(qname) {
return plugin.NextOrFailure(n.Name(), n.Next, ctx, w, r)
} else {
return dnserror(dns.RcodeNameError, state, nil)
}
}

// create DNS response
m := new(dns.Msg)
m.SetReply(r)
Expand Down

0 comments on commit 81715e2

Please sign in to comment.