Skip to content

Commit dc08987

Browse files
committed
Use pure-Go DNS resolver to fix Private Link/PSC connectivity on macOS
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>
1 parent dbe0e8a commit dc08987

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

httpclient/api_client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func makeDefaultTransport() *http.Transport {
8282
DialContext: (&net.Dialer{
8383
Timeout: 30 * time.Second,
8484
KeepAlive: 30 * time.Second,
85+
Resolver: &net.Resolver{PreferGo: true},
8586
}).DialContext,
8687
ForceAttemptHTTP2: true,
8788
MaxIdleConns: 100,

0 commit comments

Comments
 (0)