Private Google Access (PGA) allows VM instances that do not have external IP addresses to reach Google APIs and services using Googleβs internal network instead of the public internet. For Databricks, enabling PGA ensures cluster nodes can access Cloud Storage, Artifact Registry (pkg.dev), and other Google services privately.

| Benefit | Description |
|---|---|
| Private Network Traffic | Keeps dataplane traffic on Googleβs internal network, reducing public egress costs and attack surface |
| Security Integration | Works seamlessly with Private DNS and VPC Service Controls (restricted.googleapis.com) for tighter egress controls |
| No Public IPs Required | Allows controlled access for runtime image downloads and storage access without external IPs on cluster nodes |
| Compliance Ready | Helps meet regulatory requirements by keeping all Google API traffic within private networks |
restricted.googleapis.comFor Databricks on GCP with Private Google Access, the recommended best practice is to use restricted.googleapis.com instead of private.googleapis.com.
restricted.googleapis.com is Recommended| Aspect | Benefit |
|---|---|
| Enhanced Security | Provides an additional layer of security by limiting access to VPC Service Controls supported APIs only |
| Data Exfiltration Prevention | Reduces risk of data exfiltration by enforcing security perimeters around resources |
| Compliance | Aligns with stricter security and compliance requirements for regulated industries |
| Explicit Allow-listing | Forces explicit configuration of allowed services, following principle of least privilege |
| VPC SC Integration | Required when using VPC Service Controls for Databricks workspaces |
# Enable PGA on the subnet used by Databricks clusters
gcloud compute networks subnets update SUBNET_NAME \
--region=REGION \
--enable-private-ip-google-access
restricted.googleapis.comRequired DNS Configuration:
| Domain | Purpose | Record Type | Target IP Range |
|---|---|---|---|
restricted.googleapis.com |
Main endpoint for VPC SC supported services | A | 199.36.153.4/30 |
*.googleapis.com |
CNAME alias to restricted endpoint | CNAME | restricted.googleapis.com |
*.pkg.dev |
Databricks runtime image repository | A | 199.36.153.4/30 |
Allow egress to restricted.googleapis.com IP range:
gcloud compute firewall-rules create allow-restricted-googleapis \
--direction=EGRESS \
--network=VPC_NAME \
--action=ALLOW \
--rules=tcp:443 \
--destination-ranges=199.36.153.4/30 \
--priority=1000
Add route for restricted.googleapis.com:
gcloud compute routes create restricted-googleapis-route \
--network=VPC_NAME \
--destination-range=199.36.153.4/30 \
--next-hop-gateway=default-internet-gateway
Enable PGA on all subnets that will host Databricks clusters:
# For each subnet
for SUBNET in subnet-1 subnet-2 subnet-3; do
gcloud compute networks subnets update $SUBNET \
--region=us-central1 \
--enable-private-ip-google-access
done
For restricted.googleapis.com:
# Create private DNS zone
gcloud dns managed-zones create restricted-googleapis \
--dns-name=googleapis.com. \
--description="Private DNS zone for restricted Google APIs" \
--visibility=private \
--networks=VPC_NAME
# Add A record for restricted.googleapis.com
gcloud dns record-sets create restricted.googleapis.com. \
--zone=restricted-googleapis \
--type=A \
--ttl=300 \
--rrdatas=199.36.153.8,199.36.153.9,199.36.153.10,199.36.153.11
# Add CNAME record for *.googleapis.com
gcloud dns record-sets create '*.googleapis.com.' \
--zone=restricted-googleapis \
--type=CNAME \
--ttl=300 \
--rrdatas=restricted.googleapis.com.
For Databricks Artifact Registry (*.pkg.dev):
# Create private DNS zone for pkg.dev
gcloud dns managed-zones create pkg-dev \
--dns-name=pkg.dev. \
--description="Private DNS zone for Databricks runtime images" \
--visibility=private \
--networks=VPC_NAME
# Add A record for *.pkg.dev
gcloud dns record-sets create '*.pkg.dev.' \
--zone=pkg-dev \
--type=A \
--ttl=300 \
--rrdatas=199.36.153.8,199.36.153.9,199.36.153.10,199.36.153.11
Required Egress Rules:
| Rule Name | Direction | Priority | Action | Protocol/Port | Destination | Purpose |
|---|---|---|---|---|---|---|
allow-restricted-googleapis |
EGRESS | 1000 | ALLOW | tcp:443 | 199.36.153.4/30 | Access to restricted Google APIs |
allow-dns |
EGRESS | 1000 | ALLOW | udp:53, tcp:53 | 0.0.0.0/0 | DNS resolution |
allow-ntp |
EGRESS | 1000 | ALLOW | udp:123 | 0.0.0.0/0 | Time synchronization |
# Allow restricted.googleapis.com
gcloud compute firewall-rules create allow-restricted-googleapis \
--direction=EGRESS \
--network=VPC_NAME \
--action=ALLOW \
--rules=tcp:443 \
--destination-ranges=199.36.153.4/30 \
--priority=1000
# Allow DNS
gcloud compute firewall-rules create allow-dns \
--direction=EGRESS \
--network=VPC_NAME \
--action=ALLOW \
--rules=udp:53,tcp:53 \
--destination-ranges=0.0.0.0/0 \
--priority=1000
# Allow NTP
gcloud compute firewall-rules create allow-ntp \
--direction=EGRESS \
--network=VPC_NAME \
--action=ALLOW \
--rules=udp:123 \
--destination-ranges=0.0.0.0/0 \
--priority=1000
# Route for restricted.googleapis.com IP range
gcloud compute routes create restricted-googleapis-route \
--network=VPC_NAME \
--destination-range=199.36.153.4/30 \
--next-hop-gateway=default-internet-gateway \
--priority=1000
private.googleapis.com vs restricted.googleapis.com| Feature | private.googleapis.com |
restricted.googleapis.com β |
|---|---|---|
| Primary Use Case | General secure access to Google APIs within VPC | Strict security and compliance requirements |
| Scope of Access | Broader access to all Google APIs and services | Limited to VPC Service Controls supported APIs only |
| Configuration | Requires Private Google Access + DNS setup | Requires PGA + DNS + VPC Service Controls perimeter |
| Security Level | Good - traffic stays within private network | Excellent - enforces security perimeters and explicit allow-lists |
| Compliance | Suitable for general security requirements | Designed for regulated industries (HIPAA, PCI-DSS, etc.) |
| IP Range | 199.36.153.8/30 | 199.36.153.4/30 |
| Data Exfiltration Risk | Lower (private network) | Lowest (security perimeters + limited API access) |
| Recommended for Databricks | β Not recommended | β Recommended |
restricted.googleapis.com (Recommended) When:private.googleapis.com Only When:restricted.googleapis.com (Recommended)sequenceDiagram
participant Cluster as Databricks Cluster<br/>(No External IP)
participant DNS as Private DNS Zone
participant VIP as Restricted VIP<br/>199.36.153.4/30
participant API as Google APIs<br/>(VPC SC Protected)
Cluster->>DNS: Query: storage.googleapis.com
DNS-->>Cluster: CNAME: restricted.googleapis.com<br/>A: 199.36.153.8
Cluster->>VIP: HTTPS Request to 199.36.153.8
VIP->>API: Forward to Google API (within perimeter)
API-->>VIP: Response
VIP-->>Cluster: Response
Note over Cluster,API: All traffic stays on Google's internal network<br/>VPC SC enforces security perimeter
private.googleapis.com (Not Recommended)sequenceDiagram
participant Cluster as Databricks Cluster<br/>(No External IP)
participant DNS as Private DNS Zone
participant VIP as Private VIP<br/>199.36.153.8/30
participant API as Google APIs<br/>(No Perimeter)
Cluster->>DNS: Query: storage.googleapis.com
DNS-->>Cluster: CNAME: private.googleapis.com<br/>A: 199.36.153.8
Cluster->>VIP: HTTPS Request to 199.36.153.8
VIP->>API: Forward to any Google API
API-->>VIP: Response
VIP-->>Cluster: Response
Note over Cluster,API: No security perimeter enforcement<br/>Broader API access
Before launching Databricks clusters:
restricted.googleapis.com and *.pkg.devFrom a VM without external IP in the same VPC:
# Test restricted.googleapis.com resolution
dig restricted.googleapis.com
# Expected output: Should resolve to 199.36.153.8-11
# restricted.googleapis.com. 300 IN A 199.36.153.8
# restricted.googleapis.com. 300 IN A 199.36.153.9
# restricted.googleapis.com. 300 IN A 199.36.153.10
# restricted.googleapis.com. 300 IN A 199.36.153.11
# Test *.googleapis.com CNAME
dig storage.googleapis.com
# Expected output: Should CNAME to restricted.googleapis.com
# storage.googleapis.com. 300 IN CNAME restricted.googleapis.com.
# restricted.googleapis.com. 300 IN A 199.36.153.8
# Test pkg.dev resolution
dig us-central1-docker.pkg.dev
# Expected output: Should resolve to restricted VIP
# us-central1-docker.pkg.dev. 300 IN A 199.36.153.8
# Test Cloud Storage access via restricted endpoint
curl -I https://storage.googleapis.com
# Expected output:
# HTTP/2 200
# content-type: text/html; charset=UTF-8
# (Connection successful via restricted endpoint)
# Test Artifact Registry access
curl -I https://us-central1-docker.pkg.dev
# Expected output: HTTP/2 200 or appropriate auth response
# This should fail if PGA is working correctly
curl -I https://www.google.com
# Expected output: Connection timeout or failure
# (Confirms no public internet access)
# Test Cloud Storage access
dbutils.fs.ls("gs://your-bucket/")
# Test package installation (uses pkg.dev)
%pip install pandas
| Issue | Symptom | Solution |
|---|---|---|
| DNS not resolving | nslookup fails for googleapis.com |
Verify private DNS zones are associated with correct VPC network |
| Connection timeouts | Cluster launch fails with timeout errors | Check firewall rules allow egress to 199.36.153.4/30 on tcp:443 |
| Route not found | DNS resolves but connection fails | Verify VPC route exists for 199.36.153.4/30 destination |
| VPC SC violations | Cluster fails with VPC SC error | Ensure perimeter includes all required projects and service accounts |
| pkg.dev access fails | Runtime image download fails | Verify DNS zone for *.pkg.dev resolves to restricted VIP |
| Permission denied | 403 errors when accessing storage | Check IAM permissions and VPC SC ingress/egress rules |
# Check if PGA is enabled on subnet
gcloud compute networks subnets describe SUBNET_NAME \
--region=REGION \
--format="value(privateIpGoogleAccess)"
# List DNS zones
gcloud dns managed-zones list
# Check DNS records
gcloud dns record-sets list --zone=restricted-googleapis
# Verify firewall rules
gcloud compute firewall-rules list --filter="network:VPC_NAME AND direction:EGRESS"
# Check VPC routes
gcloud compute routes list --filter="network:VPC_NAME AND destRange:199.36.153.4/30"
# Test from compute instance
gcloud compute ssh INSTANCE_NAME --command="dig restricted.googleapis.com"
| Step | Task | Status |
|---|---|---|
| 1 | Enable Private Google Access on all Databricks subnets | β |
| 2 | Create private DNS zone for googleapis.com |
β |
| 3 | Add A records for restricted.googleapis.com β 199.36.153.8-11 |
β |
| 4 | Add CNAME for *.googleapis.com β restricted.googleapis.com |
β |
| 5 | Create private DNS zone for pkg.dev |
β |
| 6 | Add A records for *.pkg.dev β 199.36.153.8-11 |
β |
| 7 | Create firewall rule allowing egress to 199.36.153.4/30:443 | β |
| 8 | Create firewall rules for DNS (53) and NTP (123) | β |
| 9 | Create VPC route for 199.36.153.4/30 | β |
| 10 | Configure VPC Service Controls perimeter | β |
| 11 | Test DNS resolution from test VM | β |
| 12 | Test HTTPS connectivity to googleapis.com | β |
| 13 | Launch test Databricks cluster | β |
| 14 | Verify cluster can access Cloud Storage | β |
| 15 | Verify cluster can download runtime images | β |
restricted.googleapis.com for Databricks production workspacesβ Recommended Configuration for Databricks on GCP:
restricted.googleapis.com instead of private.googleapis.comThis configuration provides the highest level of security while maintaining full Databricks functionality.