tests: resolve through the local dnsmasq cache in CI. - #2528
Merged
Merged
Conversation
u5surf
force-pushed
the
ci-dnsmasq-resolver
branch
from
September 16, 2026 12:01
cb0d1e7 to
1d054f9
Compare
u5surf
force-pushed
the
ci-dnsmasq-resolver
branch
from
September 16, 2026 12:09
1d054f9 to
3b8c8a5
Compare
zhuizhuhaomeng
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the
localhost could not be resolved (3: Host not found)failures int/014-bugs.tTEST 37 andt/058-tcp-socket.tTEST 4, which are red on master today.Root cause
#2499 added the dnsmasq cache but removed
export TEST_NGINX_RESOLVER=8.8.4.4without putting the cache's address in its place. Nothing sets that variable in CI any more, so each test file falls back to its own default:nginx's
resolverdirective therefore queries a public resolver directly and the cache only ever serves the warm-updigs. Public resolvers do not answerlocalhost— RFC 6761 leaves that to the stub resolver — hence "Host not found".Fix
export TEST_NGINX_RESOLVER=127.0.0.1, so queries actually go through the cache.127.0.0.1:53and answer the names the resolver tests need with--host-record, since--no-hostskeeps/etc/hostsout.Port 53 matters:
t/087-udp-socket.tTEST 10 hands$TEST_NGINX_RESOLVERtosetpeername()with port 53, so the resolver has to stay addressable as a bare IP. systemd-resolved's stub listener owns127.0.0.53:53only, and--bind-interfaceskeeps dnsmasq off every other address. The step now fails loudly if dnsmasq is not listening there.TEST 37 and the trailing dot
TEST 37 was added in 5581ded to exercise nginx's resolver against a domain name ending in a dot, so it deserves a name that looks like a real FQDN. It now resolves
trailing-dot.test.— multiple labels plus the trailing dot — served from a--host-recordon the local dnsmasq, instead of the single-labellocalhost.it used before. The answer still comes from a real DNS server, just a local one rather than a third party. This follows from the discussion in #2523.Relationship to #2523
#2523 fixes the same two tests by resolving
127.0.0.1.sslip.ioinstead oflocalhost. That trades a dependency on public DNS answeringlocalhostfor a dependency on a third-party wildcard DNS service being up and reachable from the runners, which is the direction #2499 moved away from. This patch keeps the resolution local instead.The rest of #2523 — the
--- waitand--max-timeadjustments int/024-access/on-abort.t,t/128-duplex-tcp-socket.tandt/189-http2-subreq-error-wakeup.t— addresses different flakes and does not overlap with this change.I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.