diff --git a/nameserver/nsutil/nsutil.go b/nameserver/nsutil/nsutil.go index 98ac6971..65674672 100644 --- a/nameserver/nsutil/nsutil.go +++ b/nameserver/nsutil/nsutil.go @@ -2,6 +2,7 @@ package nsutil import ( "context" + "encoding/json" "errors" "fmt" "strings" @@ -45,6 +46,11 @@ func (rf ResponderFunc) ReplyWithDNS(ctx context.Context, request *dns.Msg) *dns return rf(ctx, request) } +// MarshalJSON disables JSON marshaling for ResponderFunc. +func (rf ResponderFunc) MarshalJSON() ([]byte, error) { + return json.Marshal(nil) +} + // BlockIP is a ResponderFunc than replies with either 0.0.0.17 or ::17 for // each A or AAAA question respectively. If there is no A or AAAA question, it // defaults to replying with NXDomain.