MCPcopy
hub / github.com/coredns/coredns / nxDomainBackend

Function nxDomainBackend

plugin/cache/cache_test.go:753–765  ·  view source on GitHub ↗
(ttl int)

Source from the content-addressed store, hash-verified

751}
752
753func nxDomainBackend(ttl int) plugin.Handler {
754 return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
755 m := new(dns.Msg)
756 m.SetReply(r)
757 m.Response, m.RecursionAvailable = true, true
758
759 m.Ns = []dns.RR{test.SOA(fmt.Sprintf("example.org. %d IN SOA sns.dns.icann.org. noc.dns.icann.org. 2016082540 7200 3600 1209600 3600", ttl))}
760
761 m.Rcode = dns.RcodeNameError
762 w.WriteMsg(m)
763 return dns.RcodeNameError, nil
764 })
765}
766
767func ttlBackend(ttl int) plugin.Handler {
768 return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {

Calls 3

HandlerFuncFuncType · 0.92
SOAFunction · 0.92
WriteMsgMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…