Access Claude Web and API in 2026: Clash Rules and DNS for Anthropic Domains (Tested)
Claude sits in a different hostname universe than ChatGPT or Gemini, yet the failure modes look identical in practice: the browser app loads while streaming stalls, the Console spins on account pages, or curl to api.anthropic.com succeeds from one shell and fails from another because DNS, fake-ip, DNS over HTTPS (DoH), and rule order disagree about what each process is doing. Anthropic also moved the Claude Console to platform.claude.com in early 2026 while keeping the first-party API on api.anthropic.com—so a dusty “AI mega-ruleset” that only lists openai.com and googleapis.com will silently miss half of a real Claude session. This guide shows how to use Clash (typically Clash Meta / Mihomo) to build a compact Anthropic rule block for claude.ai, Console, and API traffic, explain how it should coexist with your existing OpenAI and Google rules, and walk a log-first verification loop you can repeat after client, browser, or subscription updates.
Why “one generic AI ruleset” is a poor default in 2026
Community bundles that label themselves “AI traffic” are convenient until they hide three different vendors behind one outbound name, ship stale hostnames after a vendor redirect, or insert a broad REJECT that blocks telemetry your client now requires. Anthropic’s public surfaces span the consumer web app on claude.ai, the developer Console (now primarily platform.claude.com, with console.anthropic.com redirecting for compatibility), documentation on docs.claude.com, corporate pages on anthropic.com, and the HTTPS API at api.anthropic.com. None of those strings are interchangeable with OpenAI’s chat.openai.com or Google’s generativelanguage.googleapis.com.
Clash evaluates rules top to bottom; the first match wins. If you import a remote profile that places a catch-all GEOIP or MATCH line above your personal Anthropic lines, your carefully written DOMAIN entries never run. The fix is not moral outrage at YAML—it is deliberate ordering, named proxy groups you can read in logs, and DNS behavior that lets domain rules fire for the processes you care about. If the policy model is new, read the site’s Clash tutorial first, then return here for an Anthropic-shaped overlay.
How this article fits next to OpenAI, Gemini, and DeepSeek guides
We already published focused walkthroughs for OpenAI / ChatGPT (api.openai.com versus browser chat), Google Gemini (wide Google account and API families), and DeepSeek (web versus api.deepseek.com). Those pages are the right references when your hostnames belong to those vendors. This page targets Anthropic’s own name stack instead, and it emphasizes priority: your Anthropic block should sit where it cannot be shadowed by unrelated AI lines, yet it should not accidentally capture traffic you intended for DIRECT or for another vendor’s group.
Practical coexistence pattern: keep separate outbound groups—for example OpenAI, Gemini, Anthropic—even if they often select the same node. Logs remain legible, and when one vendor degrades you are not guessing which hostname family failed. For ChatGPT-specific YAML ideas, see our OpenAI and ChatGPT rules guide. For Google’s browser-heavy stack, see the Gemini rules and DNS guide. For another vendor’s explicit web-versus-API split, compare the DeepSeek article.
What you are actually routing: consumer app, Console, docs, and API
Vendors rename hosts; treat the list below as a baseline to confirm in your own logs after updates, not as scripture carved in stone.
- Consumer Claude in the browser:
claude.aiand related subdomains the application uses for chat, settings, and assets. - Claude Console (keys, billing, Workbench): as of January 2026, Anthropic documents
console.anthropic.comredirecting toplatform.claude.com; keep both names in rules while redirects and bookmarks coexist. - First-party REST API:
api.anthropic.comfor Messages and related HTTP APIs—verify the exact base URL in current official docs for the product you call. - Documentation:
docs.claude.com(and legacydocs.anthropic.comreferences may still appear in older links). - Help and support:
support.claude.comper public migration notes—again, confirm in your capture if a ticket form fails to load. - Corporate and policy sites:
anthropic.comandwww.anthropic.comfor marketing, careers, and legal pages that sometimes sit in the same login journey as product links.
Static assets, feature flags, error reporting, and third-party embeds can add more names. When the UI “almost works,” resist the urge to paste a ten-thousand-line remote set; reproduce with logging, read the Server Name Indication host your TLS client presents, and extend your list surgically. If you merge personal snippets with provider templates, read our custom rules tutorial so refreshes do not erase you silently.
Streaming, HTTP/2, and long-lived connections
Browser chat keeps connections open while tokens arrive; a one-shot API call from a script may complete in a single round trip. Middleboxes, UDP or QUIC divergence, and aggressive exit shaping can produce “API fine, web sticky” symptoms that look like model outages. When browser and CLI disagree, compare capture mode first: system proxy settings do not always wrap every helper, while TUN mode raises coverage at the cost of complexity. Background on transparent capture lives in the TUN mode deep dive.
IPv6 dual-stack surprises
On networks that prefer AAAA answers, asymmetric IPv4 versus IPv6 handling on the exit can create intermittent failures that correlate with switching Wi-Fi rather than with Anthropic. Note whether log lines show v4 or v6 destinations and whether you need explicit IP-CIDR6 DIRECT lines for local ranges, mirroring what you already do for RFC1918 IPv4 space.
Design outbound groups before you touch rules
Define proxy-groups entries you can aim matchers at. A single Anthropic group is enough when one exit satisfies Console, web, and API. Two groups—Anthropic-Web and Anthropic-API—help when you want different regions, stricter latency for batch jobs, or independent failover while keeping the browser on a stable path.
Use select when you want manual control, url-test or fallback when you want automatic rotation. Nodes must complete TLS to Anthropic endpoints without broken inspection or half-configured IPv6. Scheduling mechanics are vendor-agnostic; the proxy groups guide explains nesting and health checks without tying the story to a single SaaS brand.
Keep Anthropic traffic out of a nameless Proxy bucket whenever you can. The question you want logs to answer is blunt: when Claude failed, did the connection hit the policy named Anthropic? If not, fix capture or ordering before you rotate the fifth node in a list.
Rule precedence when OpenAI and Google lines already exist
Clash does not care that two lines in your file were written on different days. It only cares about position. A common healthy layout is: high-confidence DIRECT exceptions for LAN and loopback, then tight vendor blocks in a consistent order you document, then broader GEOIP or final MATCH behavior.
When multiple vendor blocks appear, avoid duplicating the same hostname under two different groups unless you intend split policy; duplicates invite “last edit wins” confusion after merges. Instead, choose one target group per hostname. If a shared remote ruleset already routes *.google.com broadly, your Gemini-specific refinements may need to sit above that set’s catch-alls—same idea for Anthropic if a provider ships a premature broad matcher that swallows claude.com collateral you did not mean to include.
Domain rules: explicit hosts first, suffixes with care
Prefer DOMAIN for exact hosts you rely on daily: api.anthropic.com, claude.ai, platform.claude.com, console.anthropic.com, docs.claude.com, support.claude.com. Widen to DOMAIN-SUFFIX,anthropic.com or DOMAIN-SUFFIX,claude.com only when logs show repeated misses on siblings and you accept the blast radius—both suffixes cover more than a single product surface.
Developers running scripts without a browser still need the same discipline: your HTTP client resolves api.anthropic.com; if resolution is poisoned or split-horizon, TLS never reaches the outbound you chose. That is DNS-first debugging, not “try another city.”
YAML skeleton: LAN first, then Anthropic hosts
Assume your profile already defines proxies and a group named Anthropic. The fragment is illustrative: merge carefully, verify hostnames in your own logs after vendor changes, and adjust group names to match your file.
# Local and loopback first (tune to your network)
IP-CIDR,192.168.0.0/16,DIRECT
IP-CIDR,10.0.0.0/8,DIRECT
IP-CIDR,172.16.0.0/12,DIRECT
IP-CIDR,127.0.0.0/8,DIRECT
# Anthropic / Claude — confirm in YOUR logs after redirects or new assets
DOMAIN,api.anthropic.com,Anthropic
DOMAIN,claude.ai,Anthropic
DOMAIN,platform.claude.com,Anthropic
DOMAIN,console.anthropic.com,Anthropic
DOMAIN,docs.claude.com,Anthropic
DOMAIN,support.claude.com,Anthropic
DOMAIN,anthropic.com,Anthropic
DOMAIN,www.anthropic.com,Anthropic
# Optional widen only after you see repeated sibling misses:
# DOMAIN-SUFFIX,claude.ai,Anthropic
# DOMAIN-SUFFIX,anthropic.com,Anthropic
# Remaining traffic follows your profile (GEOIP, MATCH, etc.)
# MATCH,Auto
If you split web and API, duplicate lines with different targets—Anthropic-Web for claude.ai, Console, and docs; Anthropic-API for api.anthropic.com—and keep that split consistent everywhere you merge YAML.
RULE-SET workflows and why pinning beats blind auto-update
Teams often move vendor blocks into a RULE-SET or internal Git snippet. The operational challenge is unchanged: ownership, reviewable diffs, and merge order with subscription templates. When a provider refresh reorders rules, rerun your short log check instead of assuming “Anthropic broke overnight.”
Community-maintained AI lists age unevenly: one contributor’s analytics block may reject a hostname your client now needs; a stale IP entry may send traffic across an ocean after the vendor renumbers. For Anthropic, logging first and adding lines beats importing megabytes you cannot explain. If you import remotely, fork, pin the URL, and schedule periodic reviews.
DNS and fake-ip: where “correct rules” still miss
Misconfigured DNS makes split routing feel random. In fake-ip modes, Clash maps queries to synthetic addresses internally; that works beautifully until a browser uses a different encrypted resolver and caches divergent answers. Symptoms include endless spinners, intermittent TLS failures, and “reboot fixed it” ghosts.
Align on purpose. If applications use DNS over HTTPS directly, those queries may bypass the assumptions your DOMAIN rules rely on, because the core observes an IP-forwarded flow without the domain context you expected. Mitigations are pragmatic: route known DoH provider hostnames consistently, steer DoH to a resolver you control, or accept IP-based fallbacks and document the trade-off. The objective is consistent name-to-policy mapping across the processes that matter.
When the web UI loads but API calls from a terminal fail—or the reverse—compare which resolver each tool uses. Runtimes and containers frequently ignore OS proxy settings; they may still honor HTTPS_PROXY while performing DNS through libc beforehand. Uniform debugging beats swapping exits blindly.
Captive portals, enterprise filters, and negative caching
Hotels return synthetic DNS answers until you authenticate. Enterprise categories for “AI” domains shift without announcement. If Claude fails on one physical network, test a phone hotspot before you rewrite YAML. When one application insists a name does not exist while another resolves it, flush browser, OS stub, and security-product DNS caches methodically—negative caching after a transient NXDOMAIN can masquerade as a permanent outage until TTLs expire.
SNI, privacy features, and “why my DOMAIN line never matched”
Most tutorials assume visible SNI hostnames. Encrypted Client Hello and related features reduce what a local core can infer. If you see more IP-only flows hitting GEOIP or final MATCH than you expect, either document broader IP policies with explicit risk, adjust client settings for controlled debugging, or route known CDN ranges cautiously. Domain rules encode intent about names; when names disappear from the wire, policy must adapt.
System proxy versus TUN for browsers, terminals, and IDEs
System proxy mode is the gentlest first step on many desktops: browsers pick it up, and GUI clients integrate cleanly. Terminals, language tooling, and Docker often need extra environment variables or a different capture path. TUN mode raises hit rates but can conflict with other VPN products or corporate agents.
Sequence that saves weekends: confirm Clash loaded the profile you think it did; reproduce a minimal Claude action with logs open; if flows never hit the core, escalate capture before you add more domain guesses. Disable competing full-tunnel VPNs during tests—two layers arguing over routes produces “half the internet works” reports that waste hours.
CI, cloud shells, and production egress
Continuous integration rarely runs a Clash sidecar. The conceptual lesson still applies: predictable DNS and egress. If you develop behind Clash but deploy to a locked-down NAT, document the difference so HTTP 401/403 stories are not misread as routing bugs.
API keys, logs, and operational hygiene
Never commit API keys; also avoid pasting them into random web “testers” or leaving verbose logging enabled on shared machines where logs aggregate upstream. Clash logs can include destination hostnames and timing; treat retention like any sensitive artifact—rotate, redact, scope access.
When rate limits appear, exponential backoff remains mandatory. A stable proxy path makes it easier to accidentally hammer api.anthropic.com from a tight loop; classify 429 responses as quota, region, or client bug before you blame the exit.
Mobile clients and split-tunnel semantics
Phones switch radios aggressively; per-app VPN and OS-managed split lists can diverge from laptop YAML. Verify hostnames on the device itself. Background refresh and battery savers can delay reconnects after sleep, which mimics “Claude is down” until you control for power policy.
Verification workflow you can repeat in about a minute
First, confirm the active profile and that personal overrides survived subscription refresh. Second, open logs and run a minimal web test: load claude.ai, send a short prompt, wait for completion or failure. Third, open the Console path you actually use—platform.claude.com or the redirect from console.anthropic.com—and confirm account pages render. Fourth, run a minimal API test from the same machine to api.anthropic.com with a safe key handling practice. Fifth, note which rule matched and which outbound group handled each flow. Only then rotate nodes inside Anthropic if throughput or loss remains suspect.
What to log when something regresses
Record profile version, core flavor, capture mode, three example destination hostnames from the failure window, and network type. Browser “secure DNS” toggles and OS updates are frequent silent variables. Structured notes turn “it broke again” into a solvable diff.
Symptom cookbook: likely causes before you blame the model
- 401/403 on API while the web app works: keys, workspace policy, or billing—verify credentials independent of Clash. If only CLI fails, check terminal proxy and DNS paths versus the browser.
- Console loads but key pages hang: inspect whether
platform.claude.comassets or auth callbacks hit an earlyREJECTor a different group thanclaude.ai. - Chat loads but streaming never starts: compare long-lived connection handling against a short non-streaming request; check UDP/QUIC and MTU before assuming model saturation.
- Failures only on one network: correlate with captive portals, IPv6 preference, or carrier-grade NAT; compare hotspot versus office Ethernet.
- Everything broke after a subscription update: diff merge order—broad
GEOIPor earlyMATCHlines may bypass your Anthropic block. - TLS handshake errors: clock skew, custom roots on security appliances, or an exit presenting captive portal HTML instead of a certificate chain.
Use the list to narrow investigation; logs stay authoritative.
Making overrides survive subscription churn
Remote profiles can replace rules wholesale on refresh. Prefer client features that prepend or append user snippets, or maintain a local merge file you control. After every refresh, rerun the short verification sequence as a smoke test.
Performance tuning without fooling yourself
Thermal throttling, sync storms, and heavy browser extensions can mimic network stalls. Before you add another domain guess, close suspect tabs, disable one extension briefly, and retest. Separate application slowness from path slowness; Clash only addresses the latter directly.
Privacy, terms, and realistic expectations
Routing changes path selection; it does not replace compliance with service terms, workplace policies, or regional regulation. Corporate devices may forbid split tunneling. This article assumes you configure hardware you own or legitimately administer.
Prefer the site’s download page for maintained clients; use upstream GitHub repositories for transparency and issues, not necessarily as the first click for every installer decision.
Putting it together
Reliable Claude, Console, and Anthropic API access with Clash in 2026 is less about secret host lists and more about a tight loop: read names from logs, encode them into focused domain rules aimed at dedicated groups, place those rules where OpenAI and Google blocks cannot shadow them, align DNS with fake-ip and DoH reality, and prove matches before swapping nodes. Compared with global toggles, that approach keeps unrelated traffic on sensible paths, separates web and API failures cleanly, and survives vendor hostname churn if you treat your list as a living document.
When you want a maintained Clash Meta-class client, walk through our Clash tutorial and use our download page as the primary install path—Download Clash for free and experience the difference.