How to Update an A Record in Cloudflare
An A record tells the internet which server your domain or subdomain lives on. When you move your website to a new hosting account, change servers, or point a subdomain to a different service, you need to update the A record so visitors reach the right place.
If your domain uses Cloudflare’s nameservers, your DNS is managed in the Cloudflare dashboard, not in cPanel. Changes made in cPanel’s Zone Editor will have no effect. In this guide, you will learn how to find and update an A record in Cloudflare, what the orange-cloud proxy setting means, and how to check that the change has worked.
What Is an A Record?
An A (Address) record maps a hostname to an IPv4 address. For example, an A record for example.com with the value 203.0.113.10 sends visitors who type example.com to the server at that IP address.
Every A record in Cloudflare has five parts:
- Type – always A for an IPv4 address (an AAAA record is used for IPv6).
- Name – the hostname. @ means the root domain (example.com); www or blog means a subdomain.
- IPv4 address (shown as Content in the records list) – the server’s IP address.
- Proxy status – whether traffic passes through Cloudflare (orange cloud) or goes straight to your server (grey cloud).
- TTL – how long resolvers may cache the record before asking again.
Before You Start
- Make sure the domain is Active in Cloudflare. If its status is Pending, the nameservers at your registrar have not been switched to Cloudflare yet, and record changes will not be used.
- Have the new IP address ready. In cPanel, you can find it in the General Information panel on the right-hand side of the dashboard, listed as Shared IP Address or Dedicated IP Address. Your hosting provider’s welcome email usually includes it too.
- Note down the current IP address before you change it, so you can switch back quickly if something goes wrong.
- If you are moving to a new server, finish copying your files, databases and email to the new account first. Updating the A record is the final step of a migration, not the first.
How to Update an A Record in Cloudflare
Step 1: Log in to Cloudflare
Go to dash.cloudflare.com and sign in with your Cloudflare email and password. If you manage more than one account, choose the account that contains your domain.
Step 2: Select your domain
On the account home page, click the domain whose DNS you want to change.
Step 3: Open the DNS records
In the left-hand menu, click DNS and then Records. You will see a table listing every DNS record for the domain: A, AAAA, CNAME, MX, TXT and others.
Step 4: Find the A record
Look for rows where the Type column shows A. Cloudflare displays the root record with your full domain name (for example, example.com) rather than @. If the list is long, type the name in the search box above the table, or filter by record type.
Check whether www is also an A record. On many domains, www is a CNAME that points to the root domain and follows it automatically. If www is a separate A record, you will need to update it as well.

Step 5: Click Edit
Click Edit at the right end of the A record’s row. The row expands to show the record’s editable fields.
Step 6: Enter the new IP address
Replace the value in the IPv4 address field with your new server’s IP address. Copy and paste it if possible: one wrong digit sends visitors to someone else’s server, or to nowhere.

Step 7: Choose the proxy status
Leave Proxy status as it was unless you have a reason to change it:
- Proxied (orange cloud) – visitors connect to Cloudflare, which forwards the request to your server. Your real server IP is hidden, and Cloudflare’s caching, SSL and security features apply. This is the usual choice for websites.
- DNS only (grey cloud) – the record returns your server’s real IP address and Cloudflare does not handle the traffic. Use this for hostnames that are not websites, such as mail, ftp or cpanel.

Step 8: Set the TTL
When a record is proxied, the TTL is fixed at Auto. For DNS-only records, Auto (5 minutes) is a good choice. You can pick a longer value for records that rarely change.
Step 9: Save the record
Click Save. The records table now shows the new IP address in the Content column.

How Long Does the Change Take?
For a proxied record, the change usually takes effect within a minute or two. Visitors’ DNS lookups still return Cloudflare’s IP addresses, which have not changed; only the server Cloudflare forwards to is new.
For a DNS-only record, resolvers keep the old IP until the TTL expires. With TTL set to Auto, most visitors see the new server within about 5 minutes. A few networks may take longer if they cached the record under a longer TTL before your change.
How to Check That the A Record Has Updated
- Open the website in a private or incognito browser window, so you do not see a cached copy.
- From a terminal, run
dig +short example.com A(macOS or Linux) ornslookup example.com(Windows). For a DNS-only record, the new IP should appear. For a proxied record, you will see Cloudflare IP addresses instead. That is normal: confirm the change by loading the site. - Use an online DNS propagation checker to see the result from locations around the world.
- On the new server, create a test file or check the access log to confirm requests are arriving there.
Common Problems and Fixes
Error 521 or 522
Cloudflare could not connect to your server. Check that the new IP address is correct and that the website is set up on the new server. Also check that the server’s firewall is not blocking Cloudflare’s IP ranges.
Error 526 (invalid SSL certificate)
This appears when Cloudflare’s SSL/TLS mode is set to Full (strict) and the new server does not yet have a valid certificate for the domain. Run AutoSSL in cPanel or install a certificate on the new server, and the error will clear.
The site still shows the old server
Clear your browser cache, and purge the Cloudflare cache under Caching → Configuration → Purge Everything. Also check whether there are two A records with the same name. Cloudflare returns both, so some visitors would still reach the old server. Delete the record with the old IP.
Email stopped working after the change
If your MX record points to mail.example.com and that hostname is an A record, make sure it is set to DNS only and points to the server that hosts your email. Cloudflare’s proxy only handles web traffic, so a proxied mail hostname cannot receive email.
The changes have no effect at all
Check the domain’s nameservers at your registrar. If they do not point to the two Cloudflare nameservers shown in your Cloudflare dashboard, DNS is being served from somewhere else, such as your registrar or your hosting provider’s Zone Editor.
Tips for Managing A Records in Cloudflare
- Before a planned server move, set the relevant DNS-only records to a short TTL a day in advance, so the switch spreads quickly.
- Keep the old hosting account active for a few days after the change, in case you need to switch back.
- Turn on two-factor authentication for your Cloudflare account. Anyone who can edit your DNS can redirect your website and email.
- If several people manage the domain, invite them as members with the right role instead of sharing one login.
Frequently Asked Questions
Should I edit the A record in cPanel or in Cloudflare?
Edit it wherever your domain’s nameservers point. If the nameservers are Cloudflare’s (for example, ana.ns.cloudflare.com), only the Cloudflare dashboard matters.
Why does Cloudflare show a different IP from my server?
When a record is proxied, Cloudflare answers DNS queries with its own IP addresses so that traffic passes through its network. Your server’s IP is still saved in the record; it is just not shown publicly.
Can I point the root domain to a hostname instead of an IP?
Yes. Cloudflare supports CNAME flattening, so you can create a CNAME record on the root domain and Cloudflare will resolve it to an IP address automatically. For a normal hosting account, an A record with the server’s IP is simpler.
Can I undo the change?
Yes. Edit the record again, enter the old IP address you noted down, and click Save.
Conclusion
To update an A record in Cloudflare, open your domain, go to DNS → Records, click Edit on the A record, enter the new IPv4 address, and save. Keep website records proxied and mail-related records DNS only, check for duplicate A records, and confirm the change by loading the site and running a DNS lookup.
