netbirdio / netbird

Connect your devices into a secure WireGuard®-based overlay network with SSO, MFA and granular access controls.
https://netbird.io
BSD 3-Clause "New" or "Revised" License
10.04k stars 441 forks source link

override internal DNS FQDN for netbird clients #2007

Open ez1976 opened 2 months ago

ez1976 commented 2 months ago

Hello. when i install a netbird client on a laptop or a server, it has a default hostname.netbird.local domain that works of course. but since most companies have sub and sub sub domains, the remote user will ping the regular dns fqdn it gets from the local dns and it will resolve to the internal company ip. it would be best if any netbird agent installed , i can change the internal FQDN hostname that netbird queries so if i am connected to netbird any queries to the servers that has netbird agent, will return the netbird IP with the override FQDN.

BUT... if this is implemented keep in mind that most servers are installed using server keys, so it would be best to add a parameter so we can run the command and specify the override fqdn directly with registering it.

for example: netbird up --management-url https://my.netbird.domain:33073 --setup-key 'XXXXXXXX' --fqdn "server.it.internal.domain"

the best way (in my opinion) is to use the internal hosts file which is queried before dns. so the entry should be 100.120.192.26 gitlab-il.it.qwilt.com #netbird manual fqdn

then when the client disconnects, you just remove all entries in the hosts file that has #netbird that way any netbird clients can use the company's internal fqdn of the server but will access it via netbird's IP

eyalz@eyalz-linux-laptop:~$ eyalz@eyalz-linux-laptop:~$ ping gitlab-il.remote.qwilt.com PING gitlab-il.remote.qwilt.com (100.120.192.26) 56(84) bytes of data. 64 bytes from 100.120.192.26 (100.120.192.26): icmp_seq=1 ttl=64 time=98.9 ms 64 bytes from 100.120.192.26 (100.120.192.26): icmp_seq=2 ttl=64 time=98.3 ms ^C --- gitlab-il.remote.qwilt.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms rtt min/avg/max/mdev = 98.281/98.589/98.898/0.308 ms eyalz@eyalz-linux-laptop:~$ ^C eyalz@eyalz-linux-laptop:~$ ping gitlab-il.it.qwilt.com PING gitlab-il.it.qwilt.com (10.9.8.76) 56(84) bytes of data. 64 bytes from 10.9.8.76 (10.9.8.76): icmp_seq=1 ttl=62 time=105 ms 64 bytes from 10.9.8.76 (10.9.8.76): icmp_seq=2 ttl=62 time=106 ms 64 bytes from 10.9.8.76 (10.9.8.76): icmp_seq=3 ttl=62 time=106 ms ^C --- gitlab-il.it.qwilt.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 105.028/105.532/105.974/0.388 ms eyalz@eyalz-linux-laptop:~$

mlsmaycon commented 2 months ago

Thanks for opening this feature request.

We will discuss it internally and share an estimation soon.

ez1976 commented 2 months ago

Cool. Let me know if you want me to give now details or show it live. Because i am pretty sure this is needed by many

On Fri, May 17, 2024, 17:10 Maycon Santos @.***> wrote:

Thanks for opening this feature request.

We will discuss it internally and share an estimation soon.

— Reply to this email directly, view it on GitHub https://github.com/netbirdio/netbird/issues/2007#issuecomment-2117928877, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANTDD3Q4HUIYUJL5OA2WHDZCYTXJAVCNFSM6AAAAABH37I7C2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJXHEZDQOBXG4 . You are receiving this because you authored the thread.Message ID: @.***>