Use pure-Go DNS resolver to fix Private Link/PSC connectivity on macOS#1589
Use pure-Go DNS resolver to fix Private Link/PSC connectivity on macOS#1589DrFaust92 wants to merge 3 commits into
Conversation
|
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. |
|
To answer your questions briefly: (i) macOS DNS resolution in Go has a well-documented history of issues with VPNs and split-horizon DNS (golang/go#12524, hashicorp/terraform#3536, helm/helm#11807). While Go 1.20+ improved things significantly by adding direct libSystem bindings, there are still behavioral differences between the cgo path ( (ii) This affects any macOS user with Private Link/PSC behind a corporate VPN — a very common enterprise setup. The error ( (iii) Typical setup: workspace with IP ACL + Private Link/PSC, macOS + corporate VPN with split-tunnel DNS routing private zones to an internal nameserver. The SDK transport is vanilla This is actively disruptive to local development on macOS without the fix or the |
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>
dc08987 to
1482b36
Compare
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
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