Embedded DNS peer subdomain resolution customization #318

Open
opened 2025-11-20 05:09:32 -05:00 by saavagebueno · 4 comments
Owner

Originally created by @CertainLach on GitHub (Apr 18, 2023).

Is your feature request related to a problem? Please describe.
I have some server in my network (Peer FQDN server.netbird.local), which has multiple internal services (I.e nginx with virtual hosts handling);

I would like to customize netbird DNS resolution (Maybe rego can be used here?) to make it possible to override resolutions for host subdomains or at least make it resolve subdomains to the same machine address without using external DNS.

I.e. make it possible for embedded DNS server to return peer IP not only on server.netbird.local DNS request but also on something.server.netbird.local.

Describe alternatives you've considered
My current solution involves starting nsd (authoritative DNS resolver) on the target server (server.netbird.local), where I have only one record:

*.server.local. 3600 IN CNAME server.netbird.local.

and then creating a custom DNS configuration with nameserver IP of the target server and match domains of server.local (Note that I can't reuse server.netbird.local, as netbird.local is already resolved by netbird embedded DNS).

So when I go to sonarr.server.local, the browser connects to server.netbird.local instead.

Additional context
It is not a VPN job to manage DNS records... But wildcard resolution will not cause a maintenance burden, as there is already a DNS server embedded, and it might be useful to many users.

Originally created by @CertainLach on GitHub (Apr 18, 2023). **Is your feature request related to a problem? Please describe.** I have some server in my network (Peer FQDN `server.netbird.local`), which has multiple internal services (I.e nginx with virtual hosts handling); I would like to customize netbird DNS resolution (Maybe rego can be used here?) to make it possible to override resolutions for host subdomains or at least make it resolve subdomains to the same machine address without using external DNS. I.e. make it possible for embedded DNS server to return peer IP not only on `server.netbird.local` DNS request but also on `something.server.netbird.local`. **Describe alternatives you've considered** My current solution involves starting nsd (authoritative DNS resolver) on the target server (`server.netbird.local`), where I have only one record: ``` *.server.local. 3600 IN CNAME server.netbird.local. ``` and then creating a custom DNS configuration with nameserver IP of the target server and match domains of `server.local` (Note that I can't reuse `server.netbird.local`, as `netbird.local` is already resolved by netbird embedded DNS). So when I go to `sonarr.server.local`, the browser connects to `server.netbird.local` instead. **Additional context** It is not a VPN job to manage DNS records... But wildcard resolution will not cause a maintenance burden, as there is already a DNS server embedded, and it might be useful to many users.
saavagebueno added the management-servicenetworkingdns labels 2025-11-20 05:09:32 -05:00
Author
Owner

@magixus commented on GitHub (Feb 6, 2024):

I have asked similar question or kinda here #1436

I found out it's possible to workaround that by going via the following path:

  1. Add a new server for proxy (optional) or use same server as netbird server
  2. Install a client and connect it to your netbird server
  3. Add a reverse proxy that listen to *.YOURFQDN.LTD and redirect to $host (using nginx or caddy)

So for example, if you have test1.vpn.fqdn.ltd => it's gonna connect to proxy which already connected to vpn as client. so you $host would be test1.vpn.fqdn.ltd, Since to proxy is connected to vpn and know that name it will forward you to the right peer.

I have solved this myself in current vpn solution and worked pretty well.

# this is a caddy example:
:80,:443 {
    reverse_proxy {host}    
    # other configuration directives...
}
server {
    listen 80 ; 
    location / {
       proxy $scheme://$host$request_uri;
    }
}
@magixus commented on GitHub (Feb 6, 2024): I have asked similar question or kinda here #1436 I found out it's possible to workaround that by going via the following path: 1. Add a new server for proxy (optional) or use same server as netbird server 2. Install a client and connect it to your netbird server 3. Add a reverse proxy that listen to *.YOURFQDN.LTD and redirect to $host (using nginx or caddy) So for example, if you have test1.vpn.fqdn.ltd => it's gonna connect to proxy which already connected to vpn as client. so you $host would be test1.vpn.fqdn.ltd, Since to proxy is connected to vpn and know that name it will forward you to the right peer. I have solved this myself in current vpn solution and worked pretty well. ```caddy # this is a caddy example: :80,:443 { reverse_proxy {host} # other configuration directives... } ``` ```nginx server { listen 80 ; location / { proxy $scheme://$host$request_uri; } } ```
Author
Owner

@pktiuk commented on GitHub (Feb 4, 2025):

This issue seems to be linked with: https://github.com/netbirdio/netbird/issues/2660 (that one is a bit more general)

@pktiuk commented on GitHub (Feb 4, 2025): This issue seems to be linked with: https://github.com/netbirdio/netbird/issues/2660 (that one is a bit more general)
Author
Owner

@lixmal commented on GitHub (Feb 21, 2025):

Would https://github.com/netbirdio/netbird/pull/3252 suffice for this use case?

@lixmal commented on GitHub (Feb 21, 2025): Would https://github.com/netbirdio/netbird/pull/3252 suffice for this use case?
Author
Owner

@pktiuk commented on GitHub (Feb 23, 2025):

@lixmal
Where can I found this option in the app?

@pktiuk commented on GitHub (Feb 23, 2025): @lixmal Where can I found this option in the app?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#318