Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[16.0] Interleave DNS servers across interfaces inside resolv.conf to mitigate resolver limit issues#5385

Merged
eriknordmark merged 1 commit into
lf-edge:16.0from
milan-zededa:16.0-resolv-conf-interleave-nameservers
Nov 12, 2025
Merged

[16.0] Interleave DNS servers across interfaces inside resolv.conf to mitigate resolver limit issues#5385
eriknordmark merged 1 commit into
lf-edge:16.0from
milan-zededa:16.0-resolv-conf-interleave-nameservers

Conversation

@milan-zededa

Copy link
Copy Markdown
Contributor

Description

Backport of #5357

How to test and validate this PR

  1. Prepare the environment
  • Onboard an EVE device with at least two management interfaces.
  • Ensure that:
    • The first interface has three or more DNS servers configured (via DHCP or static IP configuration).
    • The second interface has one or more DNS servers configured, distinct from those on the first interface.
  1. Deploy and verify
  • Let the device complete onboarding and network configuration.
  • Check the port status for both management interfaces for any reported errors:
    • On the controller side, inspect published ZInfoDevice message (port info is under systemAdapter)
    • Alternatively, SSH into the device and review /run/nim/DeviceNetworkStatus/global.json, looking at the LastError field for each interface.
  1. Expected result
  • Both management interfaces should report no errors.
  • In particular, you should not see any no DNS server available messages.
  • This confirms that DNS servers from multiple interfaces are being correctly interleaved (round-robin merged) in /etc/resolv.conf.

Changelog notes

Interleave DNS servers across interfaces in resolv.conf to mitigate resolver 3-entry limit issues.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR
  • I've added a reference link to the original PR
  • PR's title follows the template
  • I've checked the boxes above, or I've provided a good reason why I didn't check them.

…te resolver limit issues

The Go (and also system) resolver only use up to 3 nameservers from resolv.conf.
Previously, we wrote all nameservers for one interface before moving to the
next, which could result in a single interface with 3 DNS entries consuming
the entire limit. This caused other interfaces to fail DNS lookups with
error 'no DNS server available'.

To mitigate this, change the resolv.conf generation logic to interleave
nameservers across interfaces: first nameserver from each interface, then the
second from each, and so on. For up to 3 mgmt ports, this ensures that each
interface gets at least one usable DNS entry within the resolver's limit.

Duplicate nameservers are still commented out as before. The order of
interfaces is kept deterministic to maintain stable output.

This is a temporary mitigation of the underlying issue; the long-term plan
is to implement our own resolver that can use all configured DNS servers
without this 3-entry limit.

Signed-off-by: Milan Lenco <[email protected]>
(cherry picked from commit 78bf514)

@eriknordmark eriknordmark 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.

LGTM

@eriknordmark eriknordmark merged commit c7a39d2 into lf-edge:16.0 Nov 12, 2025
42 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants