custom-domain: stop publishing an underscore-leading CNAME target - #123
Merged
Conversation
GATEWAY_DOMAIN is published as the custom domain's CNAME target, and the examples used `_.<gateway-domain>`. Android's resolver runs every name in an A/AAAA answer through res_hnok, including the CNAME RDATA, and res_hnok accepts `_` only between two alphanumerics. A label starting with `_` fails, getanswer() drops the chain, and the hostname is unresolvable on Android -- while glibc, which permits `_` anywhere, resolves it fine, so the breakage never shows up in Linux testing. Switch the examples to `gateway.<gateway-domain>`. The label is arbitrary: the gateway zone is a wildcard, the name never travels on the wire, and routing is driven by the client's SNI plus the app-address TXT record. `_.` keeps resolving, so existing deployments are unaffected by this change -- they are simply still broken on Android until they move. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
GATEWAY_DOMAINis published as the custom domain's CNAME target, and the examples used_.<gateway-domain>. That name is unresolvable on Android.Android's resolver runs every name in an A/AAAA answer through
res_hnok, including the CNAME RDATA (getaddrinfo.cpp), andres_hnokaccepts_only between two alphanumerics:A label starting with
_sits in the border position, fails the check, andgetanswer()drops the whole chain — so the hostname does not resolve on Android. glibc permits_at any position and only rejects a leading-, which is why this never shows up in Linux or desktop-browser testing.Note that
_accesswould fail identically; the fix has to avoid a leading underscore, not just the bare_label.Change
Examples now use
gateway.<gateway-domain>. The label is arbitrary: the gateway zone is a wildcard, the name never travels on the wire, and routing is driven by the client's SNI plus the app-address TXT record. Docs and default values only — no script logic changed, sincednsguide.pyanddnsman.pyalready pass the value through verbatim._.keeps resolving, so this breaks no existing deployment — those are simply still broken on Android until they move.Matching docs change: Phala-Network/phala-docs#177
🤖 Generated with Claude Code