solution model high macos linux windows

Google Gemini CLI OAuth: SSRF blocked because Google resolves to fake-ip/private addresses

Fix `google-gemini-cli` login failures where OAuth domains resolve to special-use addresses by verifying DNS on the gateway host and disabling fake-ip/proxy rewriting for Google OAuth hosts.

By CoClaw Team •

Symptoms

  • openclaw models auth login --provider google-gemini-cli --set-default fails before OAuth completes.
  • Logs show:
SsrFBlockedError: Blocked: resolves to private/internal/special-use IP address
  • The blocked URL is often a Google OAuth/token host such as oauth2.googleapis.com.
  • Other tools on the same machine may still seem “online”, which makes this look confusing at first.

Cause

This is usually not a bad Google token or a broken OpenClaw auth profile.

The failure happens earlier:

  1. OpenClaw resolves a public Google OAuth hostname.
  2. Your local DNS/proxy layer rewrites that hostname to a private or special-use address.
  3. OpenClaw’s SSRF guard correctly rejects the request as unsafe.

This often happens when the gateway host uses:

  • Clash or another fake-ip mode,
  • DNS hijacking/proxy DNS,
  • or a network stack that rewrites Google domains away from real public IPs.

Fix

1) Verify what the gateway host resolves for Google OAuth

On the same machine that runs OpenClaw, check the DNS answer first:

getent ahosts oauth2.googleapis.com

or:

dig oauth2.googleapis.com

or on Windows:

nslookup oauth2.googleapis.com

If the result is a private/special-use address instead of a normal public Google IP, continue below.

2) Disable fake-ip / proxy rewriting for Google OAuth hosts

If you use Clash or a similar DNS/proxy stack, move Google OAuth domains to a real-IP / DIRECT / no-fake-ip path.

At minimum, test with:

  • oauth2.googleapis.com
  • accounts.google.com
  • *.googleapis.com

Then rerun the login:

openclaw models auth login --provider google-gemini-cli --set-default

Why this helps: OpenClaw will only proceed when the resolved address looks like a real safe public destination.

3) If you need a temporary fallback, use a non-OAuth provider path first

If you need the environment working immediately, temporarily switch to an API-key-based provider while fixing DNS/proxy rules for google-gemini-cli.

That lets you separate “overall OpenClaw config is healthy” from “Gemini CLI OAuth path is being rewritten locally”.

Verify

  • DNS lookup for oauth2.googleapis.com returns a normal public address on the gateway host.
  • openclaw models auth login --provider google-gemini-cli --set-default completes without SsrFBlockedError.
  • The resulting auth profile is available to the gateway host.

If it still fails, capture:

  • the resolved IPs for oauth2.googleapis.com,
  • whether Clash/fake-ip/TUN/proxy DNS is enabled,
  • and the exact blocked host printed by OpenClaw.

Verification & references

  • Reviewed by:CoClaw Editorial Team
  • Last reviewed:March 14, 2026
  • Verified on: macOS · Linux · Windows
Want to explore more? Browse all solutions or ask in the Community Forum .
Report a problem

Related Resources

OpenClaw: fake-IP / TUN DNS makes public hosts fail SSRF checks
Fix
Fix `Blocked: resolves to private/internal/special-use IP address` when a VPN or proxy rewrites public domains to fake-IP ranges like `198.18.x.x` before OpenClaw applies proxying.
Email OAuth keeps requiring re-auth (tokens disappear or refresh fails)
Fix
Fix repeated email OAuth logins by persisting the OpenClaw state directory, eliminating config/runtime drift, and diagnosing refresh failures from logs.
OAuth token refresh failed (Anthropic Claude subscription)
Fix
Fix expired Anthropic subscription auth by switching to a Claude Code setup-token and pasting it on the gateway host.
Gateway crashes with EBUSY / EACCES / EPERM when `~/.openclaw` is cloud-synced
Fix
Fix gateway crashes caused by putting the live OpenClaw state directory inside iCloud Drive, OneDrive, Dropbox, Google Drive, or similar sync tools that briefly lock session/config files while uploading.
OpenClaw Account Ban & ToS Risk: How to Reduce Provider/Platform Blowups
Guide
A pragmatic risk guide: why some integrations trigger 403/disabled-account events, how to reduce blast radius with separate accounts and least privilege, and how to design workflows that don’t depend on fragile consumer OAuth.
OpenClaw Email (Gmail/IMAP) Setup: OAuth Reliability, Re-Auth Loops, and Safer Alternatives
Guide
Email is powerful and risky. This guide covers how to set up OpenClaw email integrations, why Gmail OAuth often needs re-auth, how to reduce blast radius (separate accounts/scopes), and when to use IMAP/SMTP or a dedicated mailbox provider instead.