---
title: Create a subdomain · Cloudflare Learning Paths
description: 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.
source_url:
  html: https://kian-pcx-17195.preview.developers.cloudflare.com/learning-paths/get-started/domain-resolution/create-subdomain/index.md
  md: https://kian-pcx-17195.preview.developers.cloudflare.com/learning-paths/get-started/domain-resolution/create-subdomain/
---

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 the `www` subdomain. It will usually point to the same content as what you have on the apex domain (`example.com`) or use a [redirect](https://developers.cloudflare.com/fundamentals/setup/manage-domains/manage-subdomains/#redirect-a-subdomain-to-the-apex-domain). Having a DNS record on the `www` subdomain helps guarantee that a visitor who types `www.` in front of your domain address on their browser can still find your website or application.

## Subdomain records

To create a new subdomain, you would first add the subdomain content at your [host](https://developers.cloudflare.com/fundamentals/setup/manage-domains/#host-your-domain).

Then, you would create a corresponding [IP address resolution record](https://developers.cloudflare.com/dns/manage-dns-records/reference/dns-record-types/#ip-address-resolution) (`A`, `AAAA`, or `CNAME`), specifying the subdomain (`blog`, `www`, or `store`, for example) as the record **Name**.

| Type | Name | IPv4 address | Proxy status |
| - | - | - | - |
| A | `blog` | `192.0.2.1` | Proxied |

* Dashboard

  1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and zone.

  2. Go to **DNS** > **Records** and 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)](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) (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**](https://developers.cloudflare.com/dns/proxy-status/) and [**TTL**](https://developers.cloudflare.com/dns/manage-dns-records/reference/ttl/) according to your needs.

  5. Select **Save** to confirm.

* API

  Use the [Create DNS Record API endpoint](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/create/).

  For field definitions, refer to the [API documentation](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/create/) (visible once you select the record type under the request body specification).

  * To point to an IPv4 address, select **A Record**, use your subdomain (`blog`) for the field `name`, and use the IPv4 address for the field `content`.
  * To point to an IPv6 address, select **AAAA Record**, use your subdomain (`blog`) for the field `name`, and use the IPv6 address for the field `content`.
  * To point to a [fully qualified domain name (FQDN)](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) (such as `your-site.host.example.com`), select **CNAME Record**, use your subdomain (`blog`) for the field `name`, and use the fully qualified domain name for the field `content`.
