Skip to content

NEW PROVIDER: Netbird DNS Zone#4170

Open
yzqzss wants to merge 5 commits into
DNSControl:mainfrom
yzqzss:feat/netbird
Open

NEW PROVIDER: Netbird DNS Zone#4170
yzqzss wants to merge 5 commits into
DNSControl:mainfrom
yzqzss:feat/netbird

Conversation

@yzqzss
Copy link
Copy Markdown

@yzqzss yzqzss commented Mar 15, 2026

https://docs.netbird.io/manage/dns/custom-zones
https://docs.netbird.io/api/resources/dns-zones


Integration Test Result:

Netbird does not currently support MX and TXT records, so three tests that rely on TXT/MX failed. Otherwise, all good.

$ go test -profile NETBIRD
Testing Profile="NETBIRD" (TYPE="NETBIRD")
--- FAIL: TestDNSProviders (29.07s)
    --- FAIL: TestDNSProviders/test.internal (28.98s)
        --- FAIL: TestDNSProviders/test.internal/85:IGNORE_main:ignore_label (0.08s)
            helpers_integration_test.go:225: Expected 0 corrections on FIRST run, but found 2.
            helpers_integration_test.go:227: UNEXPECTED #0: + CREATE bar.test.internal A 5.5.5.5 ttl=300
            helpers_integration_test.go:227: UNEXPECTED #1: + CREATE mail.test.internal CNAME ghs.googlehosted.com. ttl=300
        --- FAIL: TestDNSProviders/test.internal/86:IGNORE_apex:apex_label (0.10s)
            helpers_integration_test.go:225: Expected 0 corrections on FIRST run, but found 2.
            helpers_integration_test.go:227: UNEXPECTED #0: + CREATE bar.test.internal A 5.5.5.5 ttl=300
            helpers_integration_test.go:227: UNEXPECTED #1: + CREATE mail.test.internal CNAME ghs.googlehosted.com. ttl=300
        --- FAIL: TestDNSProviders/test.internal/88:IGNORE_wilds:ignore_label=foo.* (0.09s)
            helpers_integration_test.go:225: Expected 0 corrections on FIRST run, but found 2.
            helpers_integration_test.go:227: UNEXPECTED #0: + CREATE bar.bat.test.internal A 5.5.5.5 ttl=300
            helpers_integration_test.go:227: UNEXPECTED #1: + CREATE mail.bat.test.internal CNAME ghs.googlehosted.com. ttl=300
Testing Profile="NETBIRD" (TYPE="NETBIRD")
Testing Profile="NETBIRD" (TYPE="NETBIRD")
Testing Profile="NETBIRD" (TYPE="NETBIRD")
FAIL
exit status 1
FAIL    github.com/StackExchange/dnscontrol/v4/integrationTest  29.161s

@TomOnTime
Copy link
Copy Markdown
Collaborator

Now that the org move is complete, I'm sending a friendly ping to PRs. Please rebase and I'd be glad to re-review. Thank you for your patience!

Comment thread documentation/provider/netbird.md Outdated
Comment thread providers/netbird/api.go
Comment thread providers/netbird/api.go
@yzqzss
Copy link
Copy Markdown
Author

yzqzss commented May 13, 2026

Hi, thank you for your review, DNSContrl is very useful to me.
I'll rebase and address your comments soon.

@cafferata cafferata added the provider-NETBIRD Netbird DNS Zone provider label May 13, 2026
@yzqzss
Copy link
Copy Markdown
Author

yzqzss commented May 13, 2026

ready for review :)

@yzqzss
Copy link
Copy Markdown
Author

yzqzss commented May 13, 2026

Integration test result is the same as before, still failed on those MX/TXT cases.

@TomOnTime
Copy link
Copy Markdown
Collaborator

Hello!

Looking good so far!

Since MX/TXT records are supported, please add this to the tests that fail:

integrationTest/integration_test.go

      not("NETBIRD"),  // MX/TXT records not supported

@yzqzss yzqzss requested a review from cafferata as a code owner May 14, 2026 10:00
Copy link
Copy Markdown
Member

@cafferata cafferata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition! The documentation is well-structured and covers configuration, metadata, usage, and activation clearly. A few smaller points from my review as inline comments.

Optionally: since #4208 landed before this PR, would you be open to implementing RegisterCredsMetadata()? That would make NetBird available in dnscontrol init. The PR has examples for simple providers like BIND and more complex ones like TransIP.

**Note:** If metadata fields are not set, DNSControl will leave them unchanged in NetBird.

## Usage

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note should use GitBook hint syntax per the style guide:

{% hint style="info" %}
**NOTE**: If metadata fields are not set, DNSControl will leave them unchanged in NetBird.
{% endhint %}


**Note:** NetBird does not expose nameservers, so `{no_ns: "true"}` should be set on all domains to suppress the "Skipping registrar" warning.

To configure zone options, use metadata:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note should use GitBook hint syntax per the style guide:

{% hint style="info" %}
**NOTE**: NetBird does not expose nameservers, so `{no_ns: "true"}` should be set on all domains to suppress the "Skipping registrar" warning.
{% endhint %}

```javascript
D("example.com", REG_DNSIMPLE,
{
no_ns: "true",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation in this code block mixes tabs and spaces, resulting in misaligned lines. Suggested fix:

D("example.com", REG_NONE,
    {
        no_ns: "true",
        netbird_enabled: "true",
        netbird_enable_search_domain: "true",
    },
    DnsProvider(DSP_NETBIRD),
    A("test", "1.2.3.4"),
);

Also: the convention for DNS-only providers is REG_NONE (with var REG_NONE = NewRegistrar("none");), not REG_DNSIMPLE. This applies to the first usage example as well.


## Supported Record Types

NetBird API currently supports the following DNS record types:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other provider docs typically document limitations like these in a Caveats section (see e.g. netlify.md). Consider renaming this to "Caveats".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

provider-NETBIRD Netbird DNS Zone provider

Development

Successfully merging this pull request may close these issues.

3 participants