[Bug] All Clients fails to route DNS for exact FQDN match domains (works for parent domains)

**Environment:**

* **NetBird Client Version:** v0.81.3 (Windows GUI/CLI、MacOS、Linux (Debian))

* **NetBird Client OS:** Windows 11、MacOS 27.1 Linux Debian13

* **NetBird Management Version:** v0.81.3

* **Routing Peer OS:** Linux (Debian)

**Describe the bug:**

We have encountered a DNS routing issue specifically on clients when using exact Fully Qualified Domain Names (FQDNs) as Match Domains in the Nameserver configuration.

When the Match Domain is set to a parent domain (e.g., `us.corp.planetart.com`), the Windows client successfully routes the DNS queries through the NetBird tunnel to our internal DNS server (`10.5.1.2`).

However, when we change the Match Domain to an exact hostname (e.g., `cpa-ad-core-03.us.corp.planetart.com`), the Windows client fails to apply the DNS policy. The query bypasses NetBird and fails with `DNS_ERROR_RCODE_NAME_ERROR` (NXDOMAIN) because it hits the local physical network DNS.

**Steps to Reproduce:**

1. In the NetBird Dashboard, create a Nameserver group pointing to an internal DNS (e.g., `10.5.1.2`).

2. Set the **Match Domains** to an exact FQDN: `cpa-ad-core-03.us.corp.planetart.com`.

3. Assign this Nameserver group to the Windows peer’s distribution group.

4. On the Windows client, restart the NetBird service to apply the new DNS config.

5. Run the following command in PowerShell:

`Resolve-DnsName cpa-ad-core-03.us.corp.planetart.com`

6. **Result:** The resolution fails (NXDOMAIN).

7. **Workaround:** Go back to the Dashboard, change the Match Domain to the parent domain `us.corp.planetart.com`, restart NetBird on the Windows client, and run the command again. It resolves successfully.

**Expected behavior:**

The Windows client should generate the correct NRPT rule and route DNS queries for the exact FQDN `cpa-ad-core-03.us.corp.planetart.com` to the configured internal nameserver (`10.5.1.2`), just as it does for the parent domain.

**Troubleshooting done:**

* Checked `netbird status -d`: The client receives the correct DNS nameserver config from the management server.

* Checked `Get-DnsClientNrptPolicy -Effective`: When using the exact FQDN, the NRPT rule is either not applied correctly or is being overridden by the physical adapter’s DNS (`10.4.25.254`). When using the parent domain, the NRPT rule is applied correctly.

* Cleared Windows DNS cache and forcefully restarted the DnsCache service (`Stop-Service -Name “Dnscache” -Force`) to rule out cached stale policies.

* Verified that the Linux Routing Peer can successfully resolve the exact FQDN (proving the internal DNS server `10.5.1.2` and routing path are functioning).

Output of `netbird status -d` on the Windows client:

Nameservers:
[10.5.1.2:53] for [.] is Available
[223.5.5.5:53] for [n.planetart.club] is Available

I am seeing this exact same issue with v0.82.0 and everything was working fine up until about a week ago. I’m not sure if the issue is a windows update exactly where it comes from. I’ve been able to remove all EDR antivirus software and this still occurs. Any assistance would be appreciated!

Thanks for the report, I tested this with the v0.82.0 DNS handler and systemd-resolved in a Debian 13 VM, and both exact-hostname and parent-domain matching worked. That wasn’t a full connected-NetBird test, though, and I haven’t tested Windows or macOS. Windows’ suffix NRPT rules may be involved, but I can’t confirm that yet.

I couldn’t find an open issue for this specific issue. Could you open a GitHub Discussion and link this thread? Please include your client and management versions, Windows build, and any recent updates, along with the nameserver settings, netbird status -d, and Get-DnsClientNrptPolicy -Effective for both the failing exact-hostname setup and the working parent-domain setup.

Please also check whether Resolve-DnsName succeeds when querying NetBird’s local DNS listener directly with -Server <NetBird-local-DNS-IP>, and include a debug bundle captured during the failed lookup, with sensitive details removed.

The status output above shows the internal nameserver handling [.], so please capture fresh output while the exact-hostname configuration is failing. If you’re also seeing this on Linux or macOS, include the lookup commands and results from those clients.

Thanks! Cheers!