Skip to content

openthread_border_router: Fix upstream DNS resolution for Thread devices - #4794

Merged
agners merged 2 commits into
home-assistant:masterfrom
agners:otbr-fix-upstream-dns
Aug 28, 2026
Merged

openthread_border_router: Fix upstream DNS resolution for Thread devices#4794
agners merged 2 commits into
home-assistant:masterfrom
agners:otbr-fix-upstream-dns

Conversation

@agners

@agners agners commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

Fixes upstream DNS resolution (and with it NAT64/DNS64 name resolution) for Thread devices, broken since add-on 2.12.0. Fixes #3947.

Root cause

The 2.12.0 OTBR bump (ff7227eab041fa52) pulled in OpenThread commit d88b63d19 (openthread/openthread#10864), which binds the upstream DNS resolver's UDP sockets to the infrastructure interface via SO_BINDTODEVICE. The add-on runs with host networking, and its /etc/resolv.conf points at the Supervisor DNS (172.30.32.3) — reachable only through the hassio bridge, not through the infra interface (end0/eth0). With the socket bound, the kernel routes the query out the physical interface via the default route, where it goes unanswered. Result: DnssdServer: Upstream query transaction N closed: ResponseTimeout. for every upstream query from a Thread device.

Fix

Set OPENTHREAD_POSIX_CONFIG_UPSTREAM_DNS_BIND_TO_INFRA_NETIF 0 in the project config header, restoring the pre-2.12.0 behavior (queries follow the host routing table and reach the Supervisor DNS on the bridge). A behavioral fix has been proposed upstream in openthread/openthread#13545 (bind only RDNSS-discovered on-link servers, never host-scoped resolv.conf servers); once merged and picked up, this define can be dropped.

Verified on a Home Assistant Yellow: a Thread client resolving example.com via the border router now gets DNS64-synthesized answers again; the query and response are visible on the hassio bridge toward 172.30.32.3.

Wrinkles worth knowing (why this was hard to reproduce)

  • RDNSS masks the bug on recent versions: since OpenThread #11342 (March 2025, in current add-on versions) the resolver also queries RDNSS servers learned from router advertisements on the infra link. Those are on-link and work despite the binding — so on networks whose router advertises RDNSS (check with ot-ctl br rdnsstable), upstream DNS appears healthy even unpatched. IPv4-only networks (no RDNSS) are always affected, which matches the reporters in OTBR: Default DNS not able to resolve IPv4 addresses since 2.12.0 #3947.
  • Testing from the BR console is not valid: ot-ctl dns resolve4 on the border router itself never reached the BR's own DNS-SD server in our testing, independent of this bug (it failed the same way on known-good 2.11.x, see https://github.com/orgs/openthread/discussions/9782). Only queries from an actual Thread device (or a TREL-connected OT CLI node) exercise the fixed path.

🤖 Generated with Claude Code

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Fixed upstream DNS resolution for Thread devices using DNS64.
    • DNS queries can now reach Supervisor DNS correctly in host-networked deployments.
  • Chores

    • Updated the OpenThread Border Router add-on to version 3.1.2.
    • Added release notes documenting the DNS resolution fix.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6087a80a-b640-4c81-b8b1-4c9f4a754113

📥 Commits

Reviewing files that changed from the base of the PR and between 1b94201 and a09ddd9.

📒 Files selected for processing (1)
  • openthread_border_router/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • openthread_border_router/CHANGELOG.md

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The OpenThread Border Router add-on disables upstream DNS socket binding to the infrastructure interface. The add-on version changes to 3.1.2, and the changelog records the DNS resolution fix.

Changes

OpenThread DNS update

Layer / File(s) Summary
Disable upstream DNS interface binding and release 3.1.2
openthread_border_router/openthread-core-ha-config-posix.h, openthread_border_router/config.yaml, openthread_border_router/CHANGELOG.md
The POSIX configuration sets OPENTHREAD_POSIX_CONFIG_UPSTREAM_DNS_BIND_TO_INFRA_NETIF to 0. The add-on version changes to 3.1.2, and the changelog documents the DNS resolution fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to a09dd

The PR restores upstream DNS resolution by changing the resolver interface-binding configuration. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing upstream DNS resolution for Thread devices.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@agners
agners force-pushed the otbr-fix-upstream-dns branch from 1b94201 to 4f92bec Compare August 25, 2026 13:06
Since add-on 2.12.0 (OTBR bump to b041fa52, which pulled in OpenThread
d88b63d19 / openthread/openthread#10864) the upstream DNS resolver
binds its UDP sockets to the infrastructure interface via
SO_BINDTODEVICE. The add-on runs with host networking, and the
nameserver in /etc/resolv.conf is the Supervisor DNS (172.30.32.3),
which is only reachable through the hassio bridge. With the socket
bound, the kernel routes the query out the physical interface via the
default route instead, where it goes unanswered: upstream DNS queries
from Thread devices, and with them NAT64/DNS64 name resolution (device
cloud connectivity, MQTT broker hostnames, ...), time out.

Disable the binding via
OPENTHREAD_POSIX_CONFIG_UPSTREAM_DNS_BIND_TO_INFRA_NETIF in the
project config header so upstream queries follow the host routing
table again, as they did before 2.12.0. A behavioral fix has been
proposed upstream (openthread/openthread#13545); this define can be
dropped once it is merged and picked up.

Notes from debugging, for future reference:

- Networks whose router advertises RDNSS in router advertisements are
  NOT affected on recent add-on versions: since OpenThread #11342
  (March 2025) the resolver also queries RDNSS-discovered servers,
  which are on-link on the infrastructure interface and work despite
  the binding. This masked the regression and made it appear
  environment-dependent. IPv4-only networks (no RDNSS) are always
  affected.
- `ot-ctl dns resolve4` on the border router itself is not a valid
  test for this path: in our testing such queries never reached the
  BR's own DNS-SD server, independent of this bug. Test from an
  actual Thread device (or a TREL-connected OpenThread CLI node).

Fixes home-assistant#3947
@agners
agners force-pushed the otbr-fix-upstream-dns branch from 4f92bec to ddf92e9 Compare August 25, 2026 13:17
@agners
agners requested review from sairon and a balanced review from Copilot August 25, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes Thread-device upstream DNS/DNS64 resolution by allowing DNS queries to follow host routing to Supervisor DNS.

Changes:

  • Disables binding upstream DNS sockets to the infrastructure interface.
  • Bumps the add-on version to 3.1.2.
  • Documents the regression fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
openthread_border_router/openthread-core-ha-config-posix.h Adds the DNS socket binding override.
openthread_border_router/config.yaml Bumps the release version.
openthread_border_router/CHANGELOG.md Adds 3.1.2 release notes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sairon sairon left a comment

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 than the comments that are too chatty to my taste, LGTM!

Comment thread openthread_border_router/CHANGELOG.md Outdated
Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>
@agners
agners merged commit 1941dc2 into home-assistant:master Aug 28, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OTBR: Default DNS not able to resolve IPv4 addresses since 2.12.0

3 participants