netbirdio/netbird · error

AAAA record is required

Error message

AAAA record is required

What it means

Guard in validateIPv6: an AAAA record entry was supplied with empty content. The zones record validator requires a non-empty string before it attempts net.ParseIP, so this fires only when the record's content field is blank, not when the address is malformed (that produces the 'valid IPv6 address' error instead).

Solutions

  1. Provide the IPv6 address in the content field, e.g. "2001:db8::1".
  2. Require content client-side for all record types.
  3. Skip emitting AAAA records entirely in migration scripts when the source has no IPv6 value.

Example fix

// before
{"name": "api", "type": "AAAA", "content": ""}
// after
{"name": "api", "type": "AAAA", "content": "2001:db8::1"}
Defensive patterns

Strategy: validation

Validate before calling

if api.DNSRecordType(req.Type) == api.DNSRecordTypeAAAA && req.Content == "" {
    return fmt.Errorf("content is required for AAAA records")
}

Try / catch

if err := rec.Validate(); err != nil {
    return respondBadRequest(err)
}

Prevention

When it happens

Trigger: A record body {"type":"AAAA","content":""} or with the content field omitted entirely.

Common situations: Form submits where only the type dropdown was set; clients that omit empty optional-looking fields rather than sending values; migration scripts that skip AAAA values when none exist but still emit the record.

Related errors


AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16). Data as JSON: /api/errors/06d5058f1ffb49dd. Report an issue: GitHub.

Appendix: source

Thrown at management/internals/modules/zones/records/record.go:122

		"zone_id":   zoneID,
		"zone_name": zoneName,
	}
}

func validateIPv4(content string) error {
	if content == "" {
		return errors.New("A record is required") //nolint:staticcheck
	}
	ip := net.ParseIP(content)
	if ip == nil || ip.To4() == nil {
		return errors.New("A record must be a valid IPv4 address") //nolint:staticcheck
	}
	return nil
}

func validateIPv6(content string) error {
	if content == "" {
		return errors.New("AAAA record is required")
	}
	ip := net.ParseIP(content)
	if ip == nil || ip.To4() != nil {
		return errors.New("AAAA record must be a valid IPv6 address")
	}
	return nil
}

View on GitHub (pinned to 93e97f4bf1)