From 5f4e1efdceac83155b723ea1438b7f9a94527d84 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli <6293917+tlimoncelli@users.noreply.github.com> Date: Thu, 2 Oct 2025 06:53:19 -0400 Subject: [PATCH] NS1: Fix NAPTR special case (#3785) --- providers/ns1/records.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/providers/ns1/records.go b/providers/ns1/records.go index 08e35a29b..4536929d2 100644 --- a/providers/ns1/records.go +++ b/providers/ns1/records.go @@ -201,6 +201,14 @@ func convert(zr *dns.ZoneRecord, domain string) ([]*models.RecordConfig, error) if err := rec.SetTargetCAAStrings(xAns[0], xAns[1], xAns[2]); err != nil { return nil, fmt.Errorf("unparsable %s record received from ns1: %w", rtype, err) } + case "NAPTR": + // NB(tlim): This is a stupid hack. NS1 doesn't quote a missing + // parameter properly. Therefore we look for 2 spaces and assume there is + // a missing item. + ans = strings.ReplaceAll(ans, " ", ` "" `) + if err := rec.PopulateFromString(rtype, ans, domain); err != nil { + return nil, fmt.Errorf("unparsable record received from ns1: %w", err) + } case "REDIRECT": // NS1 returns REDIRECTs as records, but there is only one and dummy answer: // "NS1 MANAGED RECORD"