Retry send DNS response without extra section

This commit is contained in:
Daniel 2020-09-25 10:23:59 +02:00
parent 4e14439112
commit 991cebb3d3

View file

@ -53,5 +53,14 @@ func writeDNSResponse(w dns.ResponseWriter, m *dns.Msg) (err error) {
}() }()
err = w.WriteMsg(m) err = w.WriteMsg(m)
if err == nil {
// If we receive an error we might have exceeded the message size with all
// our extra information records. Retry again without the extra section.
m.Extra = nil
noExtraErr := w.WriteMsg(m)
if noExtraErr == nil {
log.Warningf("nameserver: failed to write dns message with extra section: %s", err)
}
}
return return
} }