Skip to content
Cloudflare Docs

Create subdomain records

Most subdomains serve a specific purpose within the overall context of your website. For example, blog.example.com might be your blog, support.example.com could be your customer help portal, and store.example.com would be your e-commerce site.

Even if you do not require specific subdomains, you might want to set up at least a subdomain record on www. It will usually point to the same content as what you have on the apex domain (example.com) or use a redirect. Having a subdomain DNS record on www helps guarantee that a visitor who types www. in front of your domain address can still find your website or application.

Subdomain records

To host content on a subdomain of your domain, first ensure that your hosting provider can serve content for the given hostname (<subdomain>.example.com).

Then, you would create a corresponding IP address resolution record (A, AAAA, or CNAME), specifying the label for your subdomain (blog, www, or store, for example) as the record Name.

TypeNameIPv4 addressProxy status
Ablog192.0.2.1Proxied
  1. In the Cloudflare dashboard, go to the DNS Records page.

    Go to Records
  2. Select Add record.

  3. Select A, AAAA, or CNAME as the record Type, according to your needs:

    • To point to an IPv4 address, select A, use your subdomain (blog) for the record Name, and insert the IPv4 address in the respective field.
    • To point to an IPv6 address, select AAAA, use your subdomain (blog) for the record Name, and insert the IPv6 address in the respective field.
    • To point to a fully qualified domain name (FQDN) (such as your-site.host.example.com), select CNAME, use your subdomain (blog) for the record Name, and insert the fully qualified domain name in the Target field.
  4. Specify the Proxy status and TTL according to your needs.

  5. Select Save to confirm.

Subdomain redirects

For more guidance on redirecting a subdomain — either to your main domain or another location — refer to Set up subdomain redirects.

SSL/TLS for subdomains

While DNS is what communicates where your website or application can be reached, SSL/TLS is what enables websites and applications to establish connections in a secure way.

If your subdomains are not correctly covered by an SSL/TLS certificate, your visitors will find a warning on their browser stating that your website or application is not secure.

If your main domain is using Cloudflare's Universal SSL certificate, that certificate also covers all first-level subdomains (blog.example.com).

For deeper subdomains (dev.blog.example.com), use a different type of certificate.

Customize subdomain behavior

If you want to customize Cloudflare settings for individual subdomains, your approach will vary depending on your plan.

Enterprise customers can set up custom settings and access for a specific subdomain within Cloudflare with Subdomain support.

All other customers can set up subdomain-specific Configuration Rules or Page Rules to alter Cloudflare settings.

If you want a subdomain's DNS settings managed totally outside of Cloudflare — meaning this subdomain can be managed by individuals without access to your Cloudflare account — refer to Delegating subdomains outside of Cloudflare.