net: report a name that does not exist as a not-found lookup error - #73
Open
yohimik wants to merge 1 commit into
Open
net: report a name that does not exist as a not-found lookup error#73yohimik wants to merge 1 commit into
yohimik wants to merge 1 commit into
Conversation
The resolver learns from an NXDOMAIN reply that the name does not exist, but both layers above it lost that fact. dnsLookup replaced the error with a generic "no address found", and the Resolver methods built the DNSError from the message alone. A caller that reads DNSError.IsNotFound, to tell "no such host" from "the resolver did not answer", thus never saw a not-found lookup. Carry the flag out through both layers. dnsLookup reports not-found when the A query and the AAAA query both said so. The Resolver methods copy IsNotFound, IsTimeout and IsTemporary from the DNSError of the netdev, keep it as the unwrap target, and take its description and not its Error(), which repeats the "lookup <host>" prefix.
This was referenced Aug 30, 2026
Author
|
tinygo-org/net main has not moved since this branch was opened. It is still |
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.
net: report a name that does not exist as a not-found lookup error
Repository tinygo-org/net. Branch
upstream-pr/dns-not-found, basemain.What this does
The resolver learns from an NXDOMAIN reply that the name does not exist, but
both layers above it lost that fact.
dnsLookupinnetdev_native.goreplaced the error with a generic "noaddress found".
Resolvermethods inlookup.gobuilt theDNSErrorfrom the messagealone.
A caller that reads
DNSError.IsNotFound, to tell "no such host" from "theresolver did not answer", thus never saw a not-found lookup. A command line
program that must tell a typo in a host name from an offline network cannot do
so.
The change carries the flag out through both layers.
dnsLookupreports not-found when the A query and the AAAA query both saidso.
Resolvermethods copyIsNotFound,IsTimeoutandIsTemporaryfromthe
DNSErrorof the netdev, keep it as the unwrap target, and take itsdescription and not its
Error(), which repeats the "lookup " prefix.Evidence
There is no CI in this repository. Checked by hand on macOS 26.6 arm64 with a
TinyGo build that carries the matching toolchain change. A lookup of a name that
does not exist now returns a
DNSErrorwithIsNotFoundtrue, and a lookupwith no reachable resolver returns one with
IsNotFoundfalse.A downstream product ships binaries built with these changes in a production
release. dispat v1.4.0 is published and is not a prerelease. It carries
dispat-tiny-linux-amd64anddispat-tiny-linux-arm64, built by the forkrelease v0.42.0-net.4 from sha256-pinned tarballs and smoke-executed under
binfmt before upload, beside six binaries from the gc toolchain.
https://github.com/yohimik/dispat/releases/tag/services%2Fdispat%2Fv1.4.0
The acceptance record of that repository is committed at
packages/docs/docs/internals/tinygo.md. It reports the net.2 to net.4acceptance history, an integration suite of 694 rows that passes with 0 failures
and 1 documented skip on darwin, and a size table of 0.58x to 0.63x against the
gc equivalents with TinyGo
-opt=z -no-debugagainstgo build -trimpath -ldflags "-s -w". Those figures come from that document. They are not ameasurement of this branch.
The suite of that repository has rows that read
IsNotFoundto give the userthe right message.
Scope
same.
it stands.
Related
Related pull requests
This change is part of one body of work. Together the changes make programs that use the network and child processes work on hosted linux and macOS. A full CLI was tested end to end with all of them and ships binaries built this way, see dispat v1.4.0 in the evidence section.
In tinygo-org/tinygo
In this repository
A merge order that works. The three bug fixes are independent. tinygo-org/tinygo#5633 goes before tinygo-org/tinygo#5635. HTTPS on linux needs only tinygo-org/tinygo#5633 and tinygo-org/tinygo#5635. Full darwin support also needs tinygo-org/tinygo#5636, the net changes and a new src/net submodule pin.