Use pure-Go DNS resolver to fix Private Link/PSC connectivity on macOS#1589
Open
DrFaust92 wants to merge 1 commit intodatabricks:mainfrom
Open
Use pure-Go DNS resolver to fix Private Link/PSC connectivity on macOS#1589DrFaust92 wants to merge 1 commit intodatabricks:mainfrom
DrFaust92 wants to merge 1 commit intodatabricks:mainfrom
Conversation
On macOS, the default cgo DNS resolver can bypass split-horizon DNS configurations, causing workspace URLs to resolve to public IPs instead of private endpoints. This leads to confusing "IP blocked by ACL" errors when using Private Link or Private Service Connect. Setting PreferGo: true on the net.Resolver ensures the pure-Go DNS resolver is used, which correctly respects system DNS settings including private DNS zones. This is scoped to the SDK's HTTP client only and falls back to the cgo resolver if the Go resolver fails. Signed-off-by: Ilia Lazebnik <ilia.lazebnik@gmail.com>
Contributor
|
Thanks for the detailed write-up and for digging into this. I have a question about the underlying problem. My naive understanding is that this is a macOS-specific issue where the cgo resolver doesn't honor split-horizon DNS configs (e.g., A few things I'm genuinely uncertain about:
I'm not opposed to the change itself — it's low-risk given the fallback behavior — but I want to make sure we're solving the right problem at the right layer before setting a precedent. |
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.
Summary
PreferGo: trueon thenet.Resolverused by the SDK's default HTTP transport dialerProblem
On macOS, Go's default cgo DNS resolver can bypass split-horizon DNS configurations. When a Databricks workspace is configured with Private Link or Private Service Connect, the workspace URL should resolve to a private IP via a private DNS zone. However, the cgo resolver may resolve to the public IP instead, causing requests to be blocked by IP ACLs with a confusing error:
The workaround today is setting
GODEBUG=netdns=goglobally, but users have no way to know this from the error message alone.Solution
Set
PreferGo: trueon thenet.Resolverin the SDK's default HTTP transport dialer. This:GODEBUG=netdns=godoes, but without requiring a global environment variableTest plan
🤖 Generated with Claude Code