Skip to main content

DNS

NetBird provides private DNS capabilities that allow you to:
  • Resolve private domain names within your network
  • Use custom nameservers for specific domains
  • Implement split DNS configurations
  • Control DNS resolution per peer group

DNS Architecture

NetBird’s DNS system consists of two main components:

1. Nameserver Groups

Nameserver groups define DNS servers and the domains they handle. Each group specifies:
  • List of DNS nameservers
  • Domains to match
  • Peer groups that should use this DNS configuration
  • Whether the nameserver group is primary or domain-specific

2. DNS Settings

Account-level DNS settings control:
  • Which peer groups have DNS management disabled
  • Global DNS behavior

Nameserver Groups

A nameserver group contains DNS server configuration and distribution rules:

Nameserver Configuration

Each nameserver specifies:
Currently supported:
  • UDP nameservers: Standard DNS over UDP
Format: udp://1.1.1.1:53
NetBird validates that each nameserver group has between 1 and 3 nameservers. This limit ensures reliable DNS resolution without overwhelming client configurations.

Primary vs. Domain-Specific Nameservers

Primary Nameservers

Primary nameservers handle all DNS queries that don’t match domain-specific rules:
Characteristics:
  • Acts as the default/fallback resolver
  • Cannot have domains specified
  • Cannot have search domains enabled
  • Handles all queries not matched by domain-specific groups

Domain-Specific Nameservers

Domain-specific nameservers handle queries for particular domains:
Characteristics:
  • Handles only specified domains
  • Must have at least one domain
  • Can be added to search domains list
  • Takes precedence over primary nameservers for matched domains
Search domains are automatically appended to incomplete hostnames. For example:With search domain company.com:
  • Query: server1 → Resolves as server1.company.com
  • Query: server1.company.com → Resolves as-is
This simplifies accessing internal resources by allowing short names.In NetBird:
Peers in the distribution groups can use server1 instead of server1.company.com.

Creating Nameserver Groups

DNS Configuration Examples

Basic Primary DNS

Internal Domain DNS

Split DNS Configuration

Development Environment DNS

DNS Settings

Account-level DNS settings provide additional control:

Disabled Management Groups

Peers in disabled management groups don’t receive DNS configuration from NetBird:
Use cases:
  • Exclude specific peers from NetBird DNS management
  • Allow peers to use their own DNS configuration
  • Prevent DNS conflicts on certain devices
When you add a group to disabled management groups, peers in that group immediately stop receiving DNS updates from NetBird. They will revert to their system’s default DNS configuration.

DNS Resolution Flow

When a NetBird peer needs to resolve a domain name:

DNS Validation

NetBird validates nameserver groups when creating or updating:
Validation rules:
  1. Primary XOR Domains: Must be primary OR have domains, not both
  2. Nameserver count: Must have 1-3 nameservers
  3. Name uniqueness: Names must be unique within the account
  4. Name length: 1-40 characters
  5. Domain format: Domains must be valid DNS names
  6. No wildcards: Wildcard domains (*.example.com) are not allowed for nameservers
  7. Group existence: All referenced groups must exist
  8. Search domains: Cannot enable search domains for primary nameservers

Domain Validation

Domains are validated to ensure:
  • Valid DNS syntax
  • No wildcard prefixes
  • Proper punycode for international domains
  • Optional trailing dot (FQDN format) is allowed
Examples:
  • ✅ "example.com"
  • ✅ "api.service.local"
  • ✅ "example.com." (FQDN with trailing dot)
  • ✅ "münchen.de" (converted to punycode)
  • ❌ "*.example.com" (wildcards not allowed)

DNS Updates and Peer Impact

Changes to nameserver groups and DNS settings trigger peer updates intelligently:
Peer updates occur only when:
  • The nameserver group is enabled (or becomes enabled)
  • Distribution groups contain peers or resources
  • DNS settings changes affect groups with peers
This optimization minimizes unnecessary network updates.

DNS Event Logging

All DNS operations are logged for audit purposes: Nameserver group events:
  • NameserverGroupCreated: New nameserver group created
  • NameserverGroupUpdated: Nameserver group modified
  • NameserverGroupDeleted: Nameserver group removed
DNS settings events:
  • GroupAddedToDisabledManagementGroups: Group excluded from DNS management
  • GroupRemovedFromDisabledManagementGroups: Group included in DNS management
Event metadata:

DNS Best Practices

Name nameserver groups based on their purpose:✅ Good:
  • "Corporate Internal DNS"
  • "AWS VPC Resolver"
  • "Public Cloudflare DNS"
❌ Bad:
  • "DNS1"
  • "Nameservers"
  • "Test"
Separate internal and external DNS resolution:
This improves security and performance.
Configure 2-3 nameservers for redundancy:
If one fails, clients automatically fail over to the next.
Only distribute DNS configurations to peers that need them:
This reduces configuration size and improves performance.
Only enable search domains when beneficial:✅ Enable for:
  • Internal company domains
  • Development environments
  • Private networks
❌ Avoid for:
  • Public domains
  • Third-party services
  • Primary nameservers
Incorrect search domain configuration can cause DNS resolution issues.
Before deploying DNS changes widely:
  1. Create a test nameserver group
  2. Distribute to a small test group
  3. Verify resolution works correctly
  4. Expand to production groups
This prevents widespread DNS outages.

Common DNS Patterns

Corporate Split DNS

Multi-Cloud DNS

Environment-Based DNS

Troubleshooting DNS

Check:
  1. Is the nameserver group enabled?
  2. Is the peer in the distribution group?
  3. Is the peer’s group in disabled management groups?
  4. Are the nameserver IPs reachable from the peer?
  5. Is the domain correctly specified?
Verify with:
Ensure:
  1. Domain-specific nameserver groups are not marked as primary
  2. Domains are correctly specified without wildcards
  3. Distribution groups include the affected peers
  4. Primary nameserver exists for non-matched queries
Domain matching is exact - api.company.com won’t match nameserver group with domain company.com. You need to specify the full domain or use a broader match.
Possible causes:
  1. Peer is offline - it will receive updates when it reconnects
  2. Group membership is incorrect - verify peer is in distribution group
  3. DNS management is disabled for peer’s group
  4. Changes haven’t propagated yet - wait a few seconds
Force peer update:

API Reference

Key DNS management functions: