Changing the hosting origin behind an existing Cloudflare proxy

You can move a website to another hosting origin while keeping Cloudflare’s proxied public hostname. Prepare the new origin completely before changing the record’s destination.

Prepare for the change

Migrate files and databases consistently, install a valid origin certificate and test the new server using a hostname-aware method. Coordinate final writes for stores, forms or membership sites so data is not split across two active origins.

01 Change the hosting origin behind an existing Cloudflare proxy

  1. Export the DNS zone and record the existing origin value. Identify all relevant A, AAAA and CNAME records, including www.
  2. Verify the new origin accepts the public hostname and Cloudflare’s connections under the current TLS mode.
  3. Edit the relevant record’s Content value to the confirmed new origin while retaining the intended proxy status. Review any separate Origin Rules or load-balancer configuration that could override it.
  4. Test dynamic pages, login, uploads and transactions through the public domain. Check the new origin’s logs to confirm requests arrive there.
  5. Purge only content that became stale during the migration, monitor errors and keep the old origin available for a controlled rollback until the move is stable.

Confirm the expected result

Cloudflare should serve the new origin’s application and current data. Cached static content may temporarily hide the origin change, so verify a safe uncached request and server logs.

If the change does not work

If only some requests fail, inspect stale AAAA records, hostname mappings, origin certificates and firewall permissions. A DNS change does not synchronise later database writes back to the old server, so rollback requires a data decision as well as restoring the old IP.

Do I need to change registrar nameservers for this move?

Usually not when Cloudflare remains authoritative. You change the origin destination inside the existing zone, while checking any other routing products involved.

  • 0 Users Found This Useful
  • performance, domains-dns
Was this answer helpful?

Related Articles

Connecting a hosted domain to Cloudflare without breaking email

Cloudflare can become the authoritative DNS provider and proxy eligible web traffic while the...

Checking whether Cloudflare is active for a hostname

A domain can use Cloudflare DNS while some hostnames remain DNS-only. CDN caching and most...

Moving DNS away from Cloudflare and removing a zone

Removing a Cloudflare zone is a DNS and service migration task. Prepare the replacement zone...

Understanding Cloudflare CNAME flattening at the zone apex

CNAME flattening lets Cloudflare resolve a CNAME target and return its final address, including...

Exporting a Cloudflare DNS zone before migration

Export the Cloudflare DNS zone before a migration or broad record change. Keep the export with...