Broken hostnames when run through docker #716

Open
opened 2025-11-20 05:16:24 -05:00 by saavagebueno · 5 comments
Owner

Originally created by @Blake-Ballew on GitHub (Mar 16, 2024).

I find that when I connect a peer to my network through netbird in a docker container, I cannot connect to other peers with their hostnames; only their IP addresses. All peers with netbird installed directly to the system work as expected. I am self hosting the netbird server.

Steps to reproduce the behavior:

  1. docker-compose up -d the following docker-compose.yaml:
version: '3.4'
services:
  netbird:
    image: netbirdio/netbird:latest
    restart: always
    environment:
      - NB_MANAGEMENT_URL=<Management URL>
      - NB_SETUP_KEY=<Setup Key>
    volumes:
      - netbird-client:/etc/netbird
    network_mode: "host"
    cap_add:
      - NET_ADMIN
    privileged: true
volumes:
  netbird-client:
    external: true
  1. Ping the IP of a peer to ensure the network is running.
  2. Ping the hostname of a peer with and without netbird.selfhosted.

Expected behavior is being able to successfully ping another peer with the hostname when running netbird in a docker container.

I am using netbird selfhosted.

Netbird version v0.26.3

Originally created by @Blake-Ballew on GitHub (Mar 16, 2024). I find that when I connect a peer to my network through netbird in a docker container, I cannot connect to other peers with their hostnames; only their IP addresses. All peers with netbird installed directly to the system work as expected. I am self hosting the netbird server. Steps to reproduce the behavior: 1. docker-compose up -d the following docker-compose.yaml: ``` version: '3.4' services: netbird: image: netbirdio/netbird:latest restart: always environment: - NB_MANAGEMENT_URL=<Management URL> - NB_SETUP_KEY=<Setup Key> volumes: - netbird-client:/etc/netbird network_mode: "host" cap_add: - NET_ADMIN privileged: true volumes: netbird-client: external: true ``` 2. Ping the IP of a peer to ensure the network is running. 3. Ping the hostname of a peer with and without netbird.selfhosted. Expected behavior is being able to successfully ping another peer with the hostname when running netbird in a docker container. I am using netbird selfhosted. Netbird version v0.26.3
saavagebueno added the clientquestion labels 2025-11-20 05:16:24 -05:00
Author
Owner

@braginini commented on GitHub (Mar 17, 2024):

Hey @Blake-Ballew
What do you have in your DNS configuration in the NetBird management dashboard?

@braginini commented on GitHub (Mar 17, 2024): Hey @Blake-Ballew What do you have in your DNS configuration in the NetBird management dashboard?
Author
Owner

@Blake-Ballew commented on GitHub (Mar 17, 2024):

Nothing configured at all. I'm still using the default netbird.selfhosted.

@Blake-Ballew commented on GitHub (Mar 17, 2024): Nothing configured at all. I'm still using the default netbird.selfhosted.
Author
Owner

@braginini commented on GitHub (Mar 17, 2024):

Nothing configured at all. I'm still using the default netbird.selfhosted.

That might be the issue. Docker needs some default DNS configuration. You need to set a default DNS in NetBird to make DNS work in Docker: https://app.netbird.io/dns/nameservers

You can try with Cloudflare, for instance. Optionally, you could also add a group to this DNS configuration, e.g., docker, and assign it to your docker containers. This way this config will apply only to your docker containers.

@braginini commented on GitHub (Mar 17, 2024): > Nothing configured at all. I'm still using the default netbird.selfhosted. That might be the issue. Docker needs some default DNS configuration. You need to set a default DNS in NetBird to make DNS work in Docker: https://app.netbird.io/dns/nameservers You can try with Cloudflare, for instance. Optionally, you could also add a group to this DNS configuration, e.g., `docker`, and assign it to your docker containers. This way this config will apply only to your docker containers.
Author
Owner

@nazarewk commented on GitHub (Apr 18, 2025):

@Blake-Ballew was you problem resolved? Can we close this issue?

@nazarewk commented on GitHub (Apr 18, 2025): @Blake-Ballew was you problem resolved? Can we close this issue?
Author
Owner

@Blake-Ballew commented on GitHub (Apr 18, 2025):

I ended up just installing netbird outside of docker, so this issue is no longer a concern.

@Blake-Ballew commented on GitHub (Apr 18, 2025): I ended up just installing netbird outside of docker, so this issue is no longer a concern.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#716