[GH-ISSUE #5499] Support rewrite rules in Netbird DNS #11595

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

Originally created by @renne on GitHub (Mar 4, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5499

Is your feature request related to a problem? Please describe.
Many SoHo routers use one fixed local domain like fritz.box which cannot be changed. As they assign IP-addresses dynamically via DHCPv4/6 it does not make any sense to set static A/AAAA or CNAMES records in Netbird Custom Domain zones. It is not possible to merge the hostnames assigned by the router into Netbird custom or peer domains.

Describe the solution you'd like
Implement support for rewrite rules pushed to Netbird agents and evaluated before the forwarder routing decision. CoreDNS Corefile example:

# Custom domains local DNS records
example.com {
   view type {
     expr type() in ['A', 'AAAA']
   }

   # Do not rewrite these public sub-domains (split-brain DNS)
   rewrite stop name exact "netbird.example.com"
   rewrite stop name exact "vps1.example.com"

   # Rewrite Proxmox Backup Server to Proxmox Virtual Environment
   rewrite stop name exact "pbs.example.com" "pve.fritz.box" answer auto

   ## Rewrite Fritz!Box 7530AX
   rewrite stop name exact "ffm.example.com" "fritz.box" answer auto

   # Rewrite reverse proxy sub-domains
   rewrite stop name regex "^(aio|dms|dms-ai|family|traefik|vault)\.example\.com\.$" "docker.fritz.box" answer auto

   # Rewrite domain apex
   rewrite stop name exact "example.com" "docker.fritz.box" answer auto

   # Rewrite all other sub-domains to LAN hosts
   rewrite stop name suffix "example.com" "fritz.box" answer auto

   # LAN
   forward fritz.box 10.0.0.1

   # Anything else to public forwarder
   forward . 8.8.8.8
}

Describe alternatives you've considered
Running multiple instances of CoreDNS. This needs additional hardware/VMs/containers and complex configuration/synchronization between CoreDNS instances and Netbird.

Additional context
This would also solve https://github.com/netbirdio/netbird/issues/2660 and https://github.com/netbirdio/netbird/issues/817

Originally created by @renne on GitHub (Mar 4, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5499 **Is your feature request related to a problem? Please describe.** Many SoHo routers use one fixed local domain like `fritz.box` which cannot be changed. As they assign IP-addresses dynamically via DHCPv4/6 it does not make any sense to set static A/AAAA or CNAMES records in Netbird Custom Domain zones. It is not possible to merge the hostnames assigned by the router into Netbird custom or peer domains. **Describe the solution you'd like** Implement support for rewrite rules pushed to Netbird agents and evaluated before the forwarder routing decision. CoreDNS Corefile example: ```caddy # Custom domains local DNS records example.com { view type { expr type() in ['A', 'AAAA'] } # Do not rewrite these public sub-domains (split-brain DNS) rewrite stop name exact "netbird.example.com" rewrite stop name exact "vps1.example.com" # Rewrite Proxmox Backup Server to Proxmox Virtual Environment rewrite stop name exact "pbs.example.com" "pve.fritz.box" answer auto ## Rewrite Fritz!Box 7530AX rewrite stop name exact "ffm.example.com" "fritz.box" answer auto # Rewrite reverse proxy sub-domains rewrite stop name regex "^(aio|dms|dms-ai|family|traefik|vault)\.example\.com\.$" "docker.fritz.box" answer auto # Rewrite domain apex rewrite stop name exact "example.com" "docker.fritz.box" answer auto # Rewrite all other sub-domains to LAN hosts rewrite stop name suffix "example.com" "fritz.box" answer auto # LAN forward fritz.box 10.0.0.1 # Anything else to public forwarder forward . 8.8.8.8 } ``` **Describe alternatives you've considered** Running multiple instances of CoreDNS. This needs additional hardware/VMs/containers and complex configuration/synchronization between CoreDNS instances and Netbird. **Additional context** This would also solve https://github.com/netbirdio/netbird/issues/2660 and https://github.com/netbirdio/netbird/issues/817
saavagebueno added the feature-request label 2026-08-05 01:30:07 -04:00
Sign in to join this conversation.
No Label feature-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#11595