How to Use Cloudflare With Your Domain and Hosting
CloudflareDNSCDNSSLWeb HostingVPSSecurity

How to Use Cloudflare With Your Domain and Hosting

WWebhost Link Editorial
2026-06-13
10 min read

A practical Cloudflare setup checklist for DNS, SSL, caching, and security across shared hosting, WordPress, VPS, and migrations.

Cloudflare can sit between your domain, your hosting, and your visitors to handle DNS, caching, TLS, and basic traffic filtering. That sounds simple until you add real-world details: a shared host with cPanel, a VPS running Nginx, a WordPress site with page caching, custom email records, a staging subdomain, or an API endpoint that should never be cached. This guide gives you a reusable checklist for setting up Cloudflare with a domain and hosting account without guessing. Use it before first setup, after a migration, and any time you change hosting, DNS, SSL, or performance rules.

Overview

What Cloudflare does depends on how you use it. At minimum, it can act as your DNS provider. In a more complete setup, it can also proxy web traffic, issue edge certificates, cache static assets, add security rules, and help reduce load on your origin server.

For most website owners and developers, the practical setup has five moving parts:

  • Domain delegation: your registrar points the domain to Cloudflare nameservers.
  • DNS records: Cloudflare stores the A, AAAA, CNAME, MX, TXT, and related records for your domain.
  • Proxy status: some records are proxied through Cloudflare, others should stay DNS-only.
  • SSL/TLS mode: Cloudflare connects visitors to its edge, then connects Cloudflare to your origin using the mode you choose.
  • Caching and rules: you decide what should be cached, protected, bypassed, or redirected.

The biggest mistake is treating Cloudflare as a magic speed button. It is useful, but only when DNS, origin configuration, HTTPS, redirects, and app behavior all line up. If your host is misconfigured or your application sends the wrong headers, Cloudflare will not fix the root cause by itself.

Before you start, gather these items:

  • Access to your domain registrar
  • Access to your hosting control panel, VPS, or server config
  • A current list of DNS records, especially email-related records
  • Your origin server IP address or target hostname
  • A backup of your site and a quick rollback plan

If you still need the domain-to-hosting basics, see How to Connect a Domain to Web Hosting: Step-by-Step for Any Provider. If you are building from zero, How to Start a Website: Domain, Hosting, WordPress, and Launch Checklist is a good companion.

Checklist by scenario

This section is designed to be reused. Pick the scenario closest to your setup, then work through the checklist in order.

Scenario 1: Standard website on shared hosting or managed WordPress hosting

This is the most common use case: one main site, a registrar, and a host that already serves the site correctly.

  1. Confirm the site works before adding Cloudflare. Visit the site directly on your host, check HTTP and HTTPS, and confirm the origin is healthy first.
  2. Export or copy your current DNS records. Pay special attention to MX, SPF, DKIM, DMARC, verification TXT records, and any subdomains in active use.
  3. Add the domain to Cloudflare. During setup, Cloudflare usually scans existing records. Treat the scan as a starting point, not a final truth.
  4. Compare every imported record against your live DNS. Missing email records are a common cause of avoidable disruption.
  5. Proxy only the web records you want routed through Cloudflare. Your root domain and www are often proxied. Mail-related records should usually remain DNS-only.
  6. Update your registrar nameservers to the ones assigned by Cloudflare. Keep old DNS records available until propagation finishes.
  7. Choose an SSL/TLS mode that matches your origin. If your host already supports HTTPS properly, use the mode that preserves an encrypted connection between Cloudflare and the origin. Avoid using a weaker mode as a permanent setup.
  8. Check HTTPS, redirects, and canonical behavior. Test http://domain.com, https://domain.com, http://www.domain.com, and https://www.domain.com. Pick one preferred version and make sure redirects are consistent.
  9. Enable basic performance features conservatively. Start with automatic compression and sensible static asset caching. Avoid aggressive page caching until you confirm site behavior.
  10. Test login, forms, checkout, search, and account pages. Dynamic pages often need cache bypass rules.

If your site runs WordPress, pair this setup with WordPress Speed Optimization Checklist for Shared and Managed Hosting and WordPress Security Checklist: Backups, Firewalls, Updates, and Hardening.

Scenario 2: VPS or cloud server with Nginx, Apache, or a custom stack

Developer-managed hosting adds more control and more chances for mismatch between the edge and the origin.

  1. Verify your origin listens correctly on ports you intend to use. Confirm the web server responds on HTTP and HTTPS before introducing Cloudflare.
  2. Install and validate an origin certificate strategy. That may be a standard public certificate on the server or another trusted approach appropriate for your stack. The key point is that the origin should support HTTPS cleanly.
  3. Set the correct SSL/TLS mode in Cloudflare. This must match what your origin can actually handle.
  4. Preserve real visitor IPs in your web server logs. Otherwise every request may appear to come from Cloudflare, which makes debugging and rate limiting harder.
  5. Review firewall rules. Make sure Cloudflare can reach your origin while still keeping unnecessary exposure low.
  6. Check application awareness of HTTPS. Reverse-proxy setups often need trusted proxy headers so the app knows the original request used HTTPS.
  7. Separate static and dynamic caching logic. Cache assets like images, CSS, and JavaScript first. Only cache HTML when you have explicit rules and a clear reason.
  8. Exclude admin, API, webhook, preview, and authenticated routes from caching. These paths often break first when caching is too broad.
  9. Watch server logs after cutover. Redirect loops, 403 errors, mixed content, and origin timeouts are easier to catch early.

If you are evaluating server options before setup, Best VPS Hosting for Developers: SSH, Snapshots, Scaling, and Value can help frame the hosting side of the decision.

Scenario 3: Domain with email, third-party services, and multiple subdomains

This scenario is where careful DNS management matters most.

  1. Inventory all records before changing nameservers. Include site verification, support tools, email delivery providers, marketing platforms, and any custom app endpoints.
  2. Leave MX records DNS-only. Email routing records generally should not be proxied.
  3. Review SPF, DKIM, and DMARC TXT records carefully. Even a small typo can affect deliverability.
  4. Decide which subdomains should be proxied. Public websites often benefit from proxying. Mail, FTP-style hostnames, and some service endpoints usually should not.
  5. Check wildcard records with care. A wildcard can accidentally send unexpected traffic through Cloudflare or to the wrong origin.
  6. Test mail flow after nameserver changes. Send and receive test messages, then verify web traffic separately.

For a deeper email-specific walkthrough, read How to Set Up Professional Email for Your Domain.

Scenario 4: Migration to a new host while keeping Cloudflare in front

Cloudflare can make migrations cleaner, but only if you coordinate DNS, cache, and SSL deliberately.

  1. Lower DNS TTL in advance if your workflow allows it. This can make later changes feel less sticky.
  2. Build and test the new host before switching traffic. Confirm app behavior, HTTPS, database connectivity, and file paths.
  3. Update the relevant DNS record in Cloudflare to the new origin. Keep a note of the old value in case rollback is needed.
  4. Purge cache after cutover. This helps avoid stale assets or stale HTML being served from edge cache.
  5. Retest redirects, canonical tags, forms, login, media, and admin paths.
  6. Watch for mixed content or wrong-origin references. These often appear after migrations where internal URLs were not fully updated.

For a fuller migration plan, see How to Migrate a Website to a New Host Without Losing SEO.

What to double-check

If you only have a few minutes before or after setup, check these items. They catch a large share of practical problems.

DNS records

  • The root domain points to the correct origin IP or hostname.
  • www points where you expect.
  • MX records are present and not proxied.
  • SPF, DKIM, and DMARC records are intact.
  • Any verification TXT records still exist.
  • Subdomains for staging, API, blog, shop, or support are intentional, not accidental leftovers.

Proxy status

  • Public website records that should use Cloudflare are proxied.
  • Mail and service records that should not use the proxy remain DNS-only.
  • You are not proxying a hostname that expects direct origin access unless you have confirmed compatibility.

SSL and HTTPS

  • The origin has a valid HTTPS configuration appropriate to your chosen mode.
  • There is no redirect loop between HTTP and HTTPS.
  • Your application recognizes the original request scheme correctly behind the proxy.
  • Mixed content warnings are resolved.

Caching behavior

  • Static assets cache correctly.
  • Admin, cart, account, checkout, preview, and API routes bypass cache when needed.
  • Logged-in users do not see cached pages meant for anonymous visitors.
  • Cache purges are part of your deployment or content update workflow when appropriate.

Origin readiness

  • Your host firewall and web server allow Cloudflare traffic cleanly.
  • Server logs preserve usable client IP information.
  • Rate limits or bot rules do not block legitimate traffic unexpectedly.
  • The origin still functions directly for emergency debugging, even if normal traffic goes through Cloudflare.

If you are also managing origin SSL on the server, How to Install an SSL Certificate and Force HTTPS on Your Site is worth reviewing.

Common mistakes

Most Cloudflare problems are not obscure. They usually come from one of a handful of setup errors.

1. Copying DNS incompletely

Cloudflare's record scan may miss something, especially if your DNS is complex. Always compare imported records with the current live zone. Email problems after nameserver changes are often traceable to an omitted TXT or MX record.

2. Using the wrong SSL mode

If the origin does not support HTTPS correctly, one mode may appear to work while weakening the setup or causing redirect loops. Match Cloudflare's SSL behavior to your actual server configuration, not to what seems easiest in the moment.

3. Proxying everything

Not every hostname should sit behind the proxy. Web traffic is a good candidate. Mail and certain service endpoints generally are not. Treat proxy status as a per-record decision.

4. Caching dynamic pages too early

It is tempting to turn on aggressive caching to chase performance gains. Start with static assets. Then add page rules or cache rules only after you map which paths are truly safe to cache.

5. Ignoring application behavior behind a reverse proxy

Many apps need to trust proxy headers to generate secure URLs, detect client IPs, and avoid redirect issues. This matters on VPS and custom stacks in particular.

6. Forgetting email during a web-focused change

DNS changes affect more than the website. If the domain also handles email, test that separately after the cutover. Web success does not guarantee mail success.

7. Not purging cache after important changes

After a migration, redesign, asset update, or HTTPS fix, stale content at the edge can make debugging confusing. Purge deliberately when the change warrants it.

8. Treating Cloudflare as a replacement for origin security

Cloudflare can reduce exposure and help filter traffic, but you still need server updates, backups, least-privilege access, and app-level hardening. For WordPress, keep a separate security checklist in use alongside edge protection.

If you also manage the hosting layer directly, cPanel vs Plesk: Which Hosting Control Panel Is Better? may help when you need to locate DNS, SSL, redirects, cron jobs, or logging settings at the server side.

When to revisit

Cloudflare setup is not a one-time task. Revisit it whenever the underlying inputs change. A short review now can prevent downtime, stale caches, or email issues later.

Review your setup in these moments:

  • Before moving to a new host or VPS so you can plan DNS changes, SSL continuity, and cache purges.
  • Before traffic spikes or seasonal campaigns to verify caching, origin capacity, redirects, and security rules.
  • After changing your app stack such as moving from Apache to Nginx, adding a CDN-aware plugin, or changing your deployment workflow.
  • After adding ecommerce, membership, or login-heavy features because dynamic routes usually need cache bypass rules.
  • After changing email providers so you can confirm MX and TXT records remain correct.
  • After SSL or redirect changes to catch loops, mixed content, or header mismatches.
  • After a migration or staging-to-production launch to verify the origin IP, DNS records, and cache state.

Use this practical maintenance checklist:

  1. Export or document your current DNS zone.
  2. Confirm root, www, and key subdomains point to the intended origin.
  3. Retest HTTPS and preferred-domain redirects.
  4. Check mail flow and TXT-based authentication records.
  5. Review which records are proxied and which are DNS-only.
  6. Audit cache bypass behavior for admin, API, cart, and account paths.
  7. Verify origin logs, firewall rules, and client IP handling still make sense.
  8. Purge cache if you changed origins, assets, or major templates.
  9. Document what changed so the next review is faster.

If you are deciding between simpler managed hosting and a more hands-on server, compare the operational overhead honestly. Cloudflare works with either model, but the right fit depends on how much of the stack you want to manage yourself. For WordPress-first projects, Best WordPress Hosting for Beginners: What Actually Matters can help clarify that tradeoff.

The simplest way to use Cloudflare well is to think in layers: registrar, DNS, proxy, SSL, cache, application, and origin. Change one layer at a time, test each layer directly, and keep a record of what should be proxied, cached, or bypassed. That approach is slower than clicking every optimization switch at once, but it is far more reliable.

Related Topics

#Cloudflare#DNS#CDN#SSL#Web Hosting#VPS#Security
W

Webhost Link Editorial

Senior SEO Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.

2026-06-13T14:54:12.500Z