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:- UDP nameservers: Standard DNS over UDP
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:- 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:- 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
What are search domains?
What are search domains?
Search domains are automatically appended to incomplete hostnames. For example:With search domain Peers in the distribution groups can use
company.com:- Query:
server1→ Resolves asserver1.company.com - Query:
server1.company.com→ Resolves as-is
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:- Exclude specific peers from NetBird DNS management
- Allow peers to use their own DNS configuration
- Prevent DNS conflicts on certain devices
DNS Resolution Flow
When a NetBird peer needs to resolve a domain name:Query: api.internal.company.com
Nameserver Group: "Internal DNS"
Domains: ["internal.company.com"]
→ Match found, use 10.0.0.53
DNS Validation
NetBird validates nameserver groups when creating or updating:- Primary XOR Domains: Must be primary OR have domains, not both
- Nameserver count: Must have 1-3 nameservers
- Name uniqueness: Names must be unique within the account
- Name length: 1-40 characters
- Domain format: Domains must be valid DNS names
- No wildcards: Wildcard domains (*.example.com) are not allowed for nameservers
- Group existence: All referenced groups must exist
- Search domains: Cannot enable search domains for primary nameservers
Domain Validation
- Valid DNS syntax
- No wildcard prefixes
- Proper punycode for international domains
- Optional trailing dot (FQDN format) is allowed
- ✅
"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:- The nameserver group is enabled (or becomes enabled)
- Distribution groups contain peers or resources
- DNS settings changes affect groups with peers
DNS Event Logging
All DNS operations are logged for audit purposes: Nameserver group events:NameserverGroupCreated: New nameserver group createdNameserverGroupUpdated: Nameserver group modifiedNameserverGroupDeleted: Nameserver group removed
GroupAddedToDisabledManagementGroups: Group excluded from DNS managementGroupRemovedFromDisabledManagementGroups: Group included in DNS management
DNS Best Practices
Use Descriptive Names
Use Descriptive Names
Name nameserver groups based on their purpose:✅ Good:
"Corporate Internal DNS""AWS VPC Resolver""Public Cloudflare DNS"
"DNS1""Nameservers""Test"
Implement Split DNS
Implement Split DNS
Separate internal and external DNS resolution:This improves security and performance.
Use Multiple Nameservers
Use Multiple Nameservers
Configure 2-3 nameservers for redundancy:If one fails, clients automatically fail over to the next.
Limit Distribution Groups
Limit Distribution Groups
Only distribute DNS configurations to peers that need them:This reduces configuration size and improves performance.
Enable Search Domains Carefully
Enable Search Domains Carefully
Only enable search domains when beneficial:✅ Enable for:
- Internal company domains
- Development environments
- Private networks
- Public domains
- Third-party services
- Primary nameservers
Test DNS Changes
Test DNS Changes
Before deploying DNS changes widely:
- Create a test nameserver group
- Distribute to a small test group
- Verify resolution works correctly
- Expand to production groups
Common DNS Patterns
Corporate Split DNS
Multi-Cloud DNS
Environment-Based DNS
Troubleshooting DNS
DNS Not Resolving
DNS Not Resolving
Check:
- Is the nameserver group enabled?
- Is the peer in the distribution group?
- Is the peer’s group in disabled management groups?
- Are the nameserver IPs reachable from the peer?
- Is the domain correctly specified?
Split DNS Not Working
Split DNS Not Working
Ensure:
- Domain-specific nameserver groups are not marked as primary
- Domains are correctly specified without wildcards
- Distribution groups include the affected peers
- Primary nameserver exists for non-matched queries
api.company.com won’t match nameserver group with domain company.com. You need to specify the full domain or use a broader match.DNS Changes Not Applied
DNS Changes Not Applied
Possible causes:
- Peer is offline - it will receive updates when it reconnects
- Group membership is incorrect - verify peer is in distribution group
- DNS management is disabled for peer’s group
- Changes haven’t propagated yet - wait a few seconds
API Reference
Key DNS management functions:Related Resources
- Access Control - Overview of security model
- Groups - Organize peers for DNS distribution
- Routes - Network routing configuration
- Policies - Access control rules