netbirdio/netbird · warning
failed to validate dns labels: %v
Error message
failed to validate dns labels: %v
What it means
Thin wrapper around domain.ValidateDomains for the --extra-dns-labels flag (validated once in up.go's initialization path). Each label must be a syntactically valid domain; the wrapped error from the shared dns/domain package names the first invalid label. Empty label lists pass through cleanly, so this only fires when at least one label was supplied and one is malformed.
Source
Thrown at client/cmd/up.go:839
parsed = []byte(customDNSAddress)
}
}
return parsed, nil
}
func validateDnsLabels(labels []string) (domain.List, error) {
var (
domains domain.List
err error
)
if len(labels) == 0 {
return domains, nil
}
domains, err = domain.ValidateDomains(labels)
if err != nil {
return nil, fmt.Errorf("failed to validate dns labels: %v", err)
}
return domains, nil
}
func isValidAddrPort(input string) bool {
if input == "" {
return true
}
_, err := netip.ParseAddrPort(input)
return err == nil
}
View on GitHub (pinned to 93e97f4bf1)
Solutions
- Use valid DNS labels: letters, digits, hyphens (not leading/trailing), 1-63 chars per label
- Strip trailing dots from pasted FQDNs
- Remove the flag if the labels are unnecessary
Example fix
# before netbird up --extra-dns-labels "my_app" # after netbird up --extra-dns-labels "my-app"
Defensive patterns
Strategy: validation
Validate before calling
if _, err := domain.ValidateDomains(labels); err != nil {
return fmt.Errorf("fix dns labels before up: %w", err)
} Prevention
- Labels must be legal DNS labels: [a-z0-9-], no leading/trailing hyphen, <=63 chars
- Strip trailing dots and underscores from pasted values
When it happens
Trigger: `netbird up --extra-dns-labels "bad_domain"` (underscore), a label with a leading/trailing dot or hyphen, or a label over 63 characters.
Common situations: Using internal shorthand names that are not legal DNS labels, or trailing dots from copy-pasting FQDNs.
Related errors
- parse custom DNS address: %v
- %s is invalid, it should be formatted as IP:Port string or a
- setup login request: %v
- empty string is not a valid input for %s
- %s is not a valid input for %s. it should be formatted as "S
AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16).
Data as JSON: /api/errors/1d54db21b2faf4f1.
Report an issue: GitHub.