[GH-ISSUE #3996] validateDomain() is too strict #8421

Open
opened 2026-08-05 01:17:53 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @zvpunry on GitHub (Jun 17, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/3996

The domainPattern regex in management/server/nameserver.go is too strict, it doesn't allow labels that are completely valid according to rfc1035. As an example, it forbids labels like "x", "x1, "x--x" as tld and possibly some more.

The validateDomain() function must allow rfc1035 labels. The easiest fix is to remove the regex and just depend on dns.IsDomainName() which is not very strict.

If some additional validation is needed, it must allow rfc1035 labels. But maybe even rfc1035 is too strict: See https://www.rfc-editor.org/rfc/rfc2181#section-11

Originally created by @zvpunry on GitHub (Jun 17, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/3996 The domainPattern regex in management/server/nameserver.go is too strict, it doesn't allow labels that are completely valid according to rfc1035. As an example, it forbids labels like "x", "x1, "x--x" as tld and possibly some more. The validateDomain() function must allow rfc1035 labels. The easiest fix is to remove the regex and just depend on dns.IsDomainName() which is not very strict. If some additional validation is needed, it must allow rfc1035 labels. But maybe even rfc1035 is too strict: See https://www.rfc-editor.org/rfc/rfc2181#section-11
saavagebueno added the feature-requestdns labels 2026-08-05 01:17:53 -04:00
Sign in to join this conversation.
No Label dns feature-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#8421