analyzer: strip resolver address from DNS lookup error messages
Some checks are pending
continuous-integration/drone/push Build is running

Wrap user-facing lookup errors through a new formatDNSError helper that
clears net.DNSError.Server so the " on <addr>" suffix no longer leaks the
upstream resolver (e.g. "on 127.0.0.11:53") to end users.

Closes: https://framagit.org/happyDomain/happydeliver/-/work_items/2
This commit is contained in:
nemunaire 2026-06-03 23:06:10 +09:00
commit 7953dfc3ed
6 changed files with 18 additions and 5 deletions

View file

@ -39,7 +39,7 @@ func (d *DNSAnalyzer) checkMXRecords(domain string) *[]model.MXRecord {
return &[]model.MXRecord{
{
Valid: false,
Error: utils.PtrTo(fmt.Sprintf("Failed to lookup MX records: %v", err)),
Error: utils.PtrTo(fmt.Sprintf("Failed to lookup MX records: %s", formatDNSError(err))),
},
}
}