Skip to content

Cloudflare error 523: origin is unreachable — DNS and routing causes

Cloudflare error 523 means the edge has no network path to your origin: the DNS record points at a private or stale IP, or the route to the origin network is gone. Here is how to find which and fix it.

Cloudflare error 523 means the edge could not find a network path to your origin at all — not refused, not timed out at the host, but unroutable. In practice that almost always means the DNS record in Cloudflare contains an IP that cannot be reached from the public internet: a private address like 192.168.1.10, a stale IP from a decommissioned server, or a CNAME chain whose target no longer resolves. Open DNS → Records in the dashboard and sanity-check the record content first; that is where most 523s live.

What’s happening

For a proxied hostname, Cloudflare’s edge resolves your DNS record internally and tries to route packets to that IP. A 523 is generated when routing itself fails — the Cloudflare status code documentation describes it as the origin being unreachable at the network level. Compare the sibling errors: a 521 means the origin answered with a refusal, a 522 means the host exists but stayed silent. A 523 means the packets had nowhere to go.

Two families of cause produce that. The first is bad record content: an RFC1918 private address (10.x.x.x, 172.16-31.x.x, 192.168.x.x) that is only meaningful inside your LAN, a typo’d IP, an old IP kept after a migration, or a CNAME pointing at a hostname that no longer exists. The second is genuine routing failure: the origin’s network stopped being announced (provider outage, BGP withdrawal, a decommissioned subnet), so even a correct IP has no path. The first family is your fix; the second is your provider’s. This error behaves identically on all Cloudflare plans — no plan setting is involved. The general DNS mechanics are covered in Cloudflare’s DNS documentation.

What to check first

  • Read the actual record content in DNS → Records. Is the IP public? Is it the server you think it is? A surprising number of 523s end right here.
  • If the record is a CNAME, does the target still resolve? Hosting platforms retire endpoint hostnames.
  • Did you migrate recently? Old-IP-after-migration is the classic trigger.
  • Can anyone reach the origin IP directly? If the IP is dead from every network, the problem is below DNS.
  • Provider status page — if the origin’s data centre is having a network incident, the 523 will clear when they fix their routing, and nothing on your side is wrong.

How to verify

Public DNS shows Cloudflare edge IPs for proxied names, so take the origin IP from the dashboard record content, then test the path from outside:

# What the world resolves (proxied names return Cloudflare edge IPs - expected)
dig +short example.com

# If your record is a CNAME to a hosting endpoint, does the target still resolve?
dig +short origin.hosting-provider.example

# Is the origin IP publicly routable, and where does the path stop?
ping -c 4 203.0.113.10
mtr -rwzbc 20 203.0.113.10

# Does anything answer on the web ports?
curl -sv --max-time 15 --resolve example.com:443:203.0.113.10 https://example.com/ -o /dev/null

Interpretation: if the record content is 192.168.x.x or 10.x.x.x, you have found the bug — no external test needed. If mtr dies inside your provider’s network from multiple vantage points, the subnet is not being routed and that is a provider ticket. If mtr reaches the host and curl works, the record content Cloudflare has must differ from the IP you just tested — re-read the dashboard, including AAAA records, which are checked separately and often forgotten.

The fix

  1. Private IP in the record — replace the RFC1918 address with the origin’s public IP. This happens when a record is copied from an internal DNS zone, or when someone pastes the LAN address of a NATed server. If the server has no public IP at all, a proxied record can never reach it directly — put a Cloudflare Tunnel or a routable frontend in front instead.
  2. Stale IP after a migration or re-IP — update the A/AAAA content to the current server address. Check every record for the zone, not just the apex: www, api, and staging names frequently keep the old IP for months.
  3. Dead CNAME target — the record points at a platform hostname that the provider retired. Get the current endpoint from the provider’s panel and update the record.
  4. AAAA record pointing somewhere wrong — the A record is correct but an old AAAA drags the edge toward an unreachable IPv6 address. Fix or remove the AAAA; do not leave a v6 record you do not actually serve.
  5. Origin network not announced — correct IP, dead path, confirmed by mtr from several networks. Open a ticket with the host, attach the traces, and if this recurs, treat it as a signal to reconsider the provider. While it lasts, nothing in the Cloudflare dashboard will help.

When this fix is wrong

If the origin IP pings fine from multiple external networks and the record content matches it exactly, editing DNS records is the wrong tree to bark up — intermittent 523s with a healthy path usually accompany a provider-side routing flap or an edge-side incident, and the right move is evidence collection (timestamps, Ray IDs, mtr runs) rather than configuration churn.

Common mistakes

  • Fixing the A record but forgetting the AAAA, then chasing a “random” 523 that only IPv6-capable paths trigger.
  • Testing ping example.com and concluding things about the origin — for a proxied name you are pinging Cloudflare’s edge, not your server. The DNS-only vs proxied distinction trips people here constantly.
  • Pasting an internal load balancer or container IP into a public zone because it worked from inside the office network.
  • Assuming a 523 is temporary and waiting it out when the record content has been wrong since a migration two weeks ago.

Prevention

  • Make “update every Cloudflare record to the new IP” an explicit, verified step in any migration runbook — and list all records for the zone, not the ones you remember.
  • Keep a note of which records are CNAMEs to provider endpoints, and subscribe to that provider’s deprecation notices.
  • Monitor the origin IP directly with an external probe so a routing loss alarms on its own, separately from the website check.
  • Review the zone quarterly for records pointing at servers that no longer exist — stale records are latent 523s. A clean zone structure (see Cloudflare DNS zone setup) makes those audits fast.
  • Prefer Tunnel or stable anycast frontends for origins whose IPs churn.

A 523 is nearly always a five-minute fix once you actually read the record content instead of assuming it. If the error keeps coming back, the problem usually sits between Cloudflare and the origin — Stack Harbor operates that whole path under Managed Cloud Ops, and you can book an infrastructure review.