[GH-ISSUE #3214] Question: Any possible way to get rDNS / PTR records for netbird clients? #6943

Closed
opened 2026-08-05 01:10:50 -04:00 by saavagebueno · 1 comment
Owner

Originally created by @timoschirmer on GitHub (Jan 19, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/3214

As far as I know, there is currently no way to get rDNS resolved for netbird IPs.
If there is, please point me in the right direction.

Use Case:
When playing around with and especially troubleshooting HA routes, I often use mtr / traceroute to get the current active route. While I can use the web interface to decipher which IP corresponds to which host, it would be way easier if the node name shows up right away.
I'm sure there are many more use cases where this could be helpful.

I would love to hear your opinion on this.

Originally created by @timoschirmer on GitHub (Jan 19, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/3214 As far as I know, there is currently no way to get rDNS resolved for netbird IPs. If there is, please point me in the right direction. Use Case: When playing around with and especially troubleshooting HA routes, I often use mtr / traceroute to get the current active route. While I can use the web interface to decipher which IP corresponds to which host, it would be way easier if the node name shows up right away. I'm sure there are many more use cases where this could be helpful. I would love to hear your opinion on this.
saavagebueno added the clientdns labels 2026-08-05 01:10:51 -04:00
Author
Owner

@the-project-group commented on GitHub (Jan 20, 2025):

@timoschirmer I worked around this for a similar use case by getting a IP <> host.selfhosted mapping via API.

I export the information into a CSV file which I later use in a Graylog lookup table to do reverse lookups:

"ip","netbird-hostname"
"100.116.186.120","hostname.selfhosted"

Image

Image

get-peers.py

import requests
import json
import csv

url = "https://netbird.domain.com:33073/api/peers"

headers = {
  'Accept': 'application/json',
  'Authorization': 'Token MY-SECRET-API-TOKEN'
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    peers = json.loads(response.text)

    # Open a CSV file for writing
    with open('peers.csv', mode='w', newline='') as file:
        writer = csv.writer(file, quoting=csv.QUOTE_ALL)
        # Write the header
        writer.writerow(["ip", "netbird-hostname"])

        for peer in peers:
            ip = peer.get('ip', 'N/A')
            dns_label = peer.get('dns_label', 'N/A')
            print(f"ip: {ip}, dns_label: {dns_label}")
            # Write the row to the CSV file
            writer.writerow([ip, dns_label])
else:
    print(f"Failed to retrieve peers: {response.status_code}")
<!-- gh-comment-id:2601766878 --> @the-project-group commented on GitHub (Jan 20, 2025): @timoschirmer I worked around this for a similar use case by getting a IP <> host.selfhosted mapping via API. I export the information into a CSV file which I later use in a [Graylog](https://graylog.org/) lookup table to do reverse lookups: ``` "ip","netbird-hostname" "100.116.186.120","hostname.selfhosted" ``` ![Image](https://github.com/user-attachments/assets/d72e22c4-9c4a-456c-8866-905d939f5658) ![Image](https://github.com/user-attachments/assets/e385dd12-d68f-491d-814c-e9b2d389abdc) get-peers.py ``` import requests import json import csv url = "https://netbird.domain.com:33073/api/peers" headers = { 'Accept': 'application/json', 'Authorization': 'Token MY-SECRET-API-TOKEN' } response = requests.get(url, headers=headers) if response.status_code == 200: peers = json.loads(response.text) # Open a CSV file for writing with open('peers.csv', mode='w', newline='') as file: writer = csv.writer(file, quoting=csv.QUOTE_ALL) # Write the header writer.writerow(["ip", "netbird-hostname"]) for peer in peers: ip = peer.get('ip', 'N/A') dns_label = peer.get('dns_label', 'N/A') print(f"ip: {ip}, dns_label: {dns_label}") # Write the row to the CSV file writer.writerow([ip, dns_label]) else: print(f"Failed to retrieve peers: {response.status_code}") ```
Sign in to join this conversation.
No Label client dns
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#6943