DNS record types

Last updated Oct 15, 2026 This page provides information about some of the different types of DNS records that you can manage on Cloudflare. For guidance on how to add, edit, or delete DNS records, refer to Manage DNS records.

Note

Each DNS record has a maximum wire format size of 4,096 bytes. Wire format refers to how a record is encoded when transmitted over the DNS protocol (RFC 1035 ↗︎).

If you have multiple records with the same name and type, their combined content length must not exceed 8,192 characters.


IP address resolution

At least one IP address resolution record is required for each domain on Cloudflare. These records are the only ones you can proxy through Cloudflare.

A and AAAA

A and AAAA records ↗︎ map a domain name to one or multiple IPv4 or IPv6 address(es).

These records include the following fields:

  • Name: A subdomain or the zone apex ( @).
  • The name must be composed of labels of 63 characters or less ( label1.label2.label3), where the fully qualified domain name ( label1.label2.label3.example.com) does not exceed 253 characters.
  • DNS labels can contain any octet (byte value). However, for compatibility with hostnames and TLS certificates, it is recommended to use only letters, digits, and hyphens (LDH rule). This is not a DNS protocol requirement, meaning DNS will work even if you do not follow these conventions.
  • There is no requirement to start with a letter or end with a letter or digit.
  • Underscores are valid in DNS and commonly used for service records.

  • IPv4/IPv6 address: Your origin server address (cannot be a Cloudflare IP ↗︎)

Note

Cloudflare uses the canonical notation ↗︎ to store DNS records. This means that an AAAA record with content fe80::0:0:1 is stored and returned as fe80::1, for example.

Alternative notations of IPv4 addresses (1.1 for 1.0.0.1, for example) are not supported for A records.

  • TTL: Time to live, which controls how long DNS resolvers should cache a response before revalidating it.
  • If the Proxy Status is Proxied, this value defaults to Auto, which is 300 seconds.
  • If the Proxy Status is DNS Only, you can customize the value.
  • Proxy status: For more details, refer to Proxied DNS records.
  • Private network routing: Some Enterprise customers also have access to private network routing. For A and AAAA records, this feature allows you to proxy HTTP/HTTPS traffic from public hostnames to origins in your private network.

Example API call

When creating A or AAAA records using the API:

  • The content of the records is an IP address (IPv4 for A or IPv6 for AAAA).
  • The proxied field affects the record's proxy status.

For field definitions, refer to the API documentation (visible once you select the record type under the request body specification).

<details>

<summary>

Required API token permissions

</summary>

At least one of the following <a href="https://developers.cloudflare.com/fundamentals/api/reference/permissions/">token permissions</a> is required:

  • <code>DNS Write</code>

</details>

Create DNS Recordbash

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" \
    --request POST \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    --json '{
        "type": "A",
        "name": "www.example.com",
        "content": "192.0.2.1",
        "ttl": 3600,
        "proxied": false
    }'

Responsejson

{
    "result": {
        "id": "<ID>",
        "zone_id": "<ZONE_ID>",
        "zone_name": "example.com",
        "name": "www.example.com",
        "type": "A",
        "content": "192.0.2.1",
        "proxiable": true,
        "proxied": false,
        "ttl": 1,
        "locked": false,
        "meta": {
            "source": "primary"
        },
        "comment": null,
        "tags": [],
        "created_on": "2023-01-17T20:37:05.368097Z",
        "modified_on": "2023-01-17T20:37:05.368097Z"
    },
    "success": true,
    "errors": [],
    "messages": []
}

CNAME

CNAME records ↗︎ map a domain name to another (canonical) domain name. They can be used to resolve other record types present on the target domain name.

These records include the following fields:

  • Name: A subdomain or the zone apex ( @).
  • The name must be composed of labels of 63 characters or less ( label1.label2.label3), where the fully qualified domain name ( label1.label2.label3.example.com) does not exceed 253 characters.
  • DNS labels can contain any octet (byte value). However, for compatibility with hostnames and TLS certificates, it is recommended to use only letters, digits, and hyphens (LDH rule). This is not a DNS protocol requirement, meaning DNS will work even if you do not follow these conventions.
  • There is no requirement to start with a letter or end with a letter or digit.
  • Underscores are valid in DNS and commonly used for service records.

- Target: The hostname where traffic should be directed (example.com). - TTL: Time to live, which controls how long DNS resolvers should cache a response before revalidating it.

  • If the Proxy Status is Proxied, this value defaults to Auto, which is 300 seconds. - If the Proxy Status is DNS Only, you can customize the value. - Proxy status: For more details, refer to Proxied DNS records.

Proxied CNAME records

Observe the following aspects, especially before changing a CNAME record from proxied to DNS-only or vice versa:

  • If a hostname is meant to proxy traffic, you can use CNAME records to point to other CNAME records ( www.example2.com --> www.example1.com --> www.example.com), but the final record must point to a hostname with a valid IP address (and therefore a valid A or AAAA record). Also, queries for other record types on the same name are not supported.

<details>

<summary>

Example

</summary>

DNS management for example.com:

Type Name Content Proxy status
CNAME abc <code>target.external.test</code> Proxied

DNS management for external.test:

Type Name Content
A target <code>192.0.2.1</code>
TXT target <code>"some TXT content"</code>

In this example, a query for TXT in <code>abc.example.com</code> will not return the TXT content in the target zone.

</details>

  • Cloudflare uses a process called CNAME flattening to deliver better performance. This process supports a few features and can interact with different setups that depend on CNAME records. Refer to the CNAME flattening section to learn more about this.
  • If you encounter a CNAME record that you cannot proxy — usually associated with another CDN provider — a proxied version of that record will cause connectivity errors. Cloudflare is purposely preventing that record from being proxied to protect you from a misconfiguration. Refer to proxying limitations for details.

Note

Specific CNAME record values with traffic proxied through Cloudflare will enable O2O routing for the Shopify SaaS provider. Refer to the Shopify provider guide for more information.

Example API call

When creating CNAME records using the API:

For field definitions, refer to the API documentation (visible once you select the record type under the request body specification).

<details>

<summary>

Required API token permissions

</summary>

At least one of the following <a href="https://developers.cloudflare.com/fundamentals/api/reference/permissions/">token permissions</a> is required:

  • <code>DNS Write</code>

</details>

Create DNS Recordbash

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" \
    --request POST \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    --json '{
        "type": "CNAME",
        "name": "www.example.com",
        "content": "www.another-example.com",
        "ttl": 3600,
        "proxied": false
    }'

Responsejson

{
    "result": {
        "id": "<ID>",
        "zone_id": "<ZONE_ID>",
        "zone_name": "example.com",
        "name": "www.example.com",
        "type": "CNAME",
        "content": "www.another-example.com",
        "proxiable": true,
        "proxied": false,
        "ttl": 1,
        "locked": false,
        "meta": {
            "source": "primary"
        },
        "comment": null,
        "tags": [],
        "created_on": "2023-01-17T20:37:05.368097Z",
        "modified_on": "2023-01-17T20:37:05.368097Z"
    },
    "success": true,
    "errors": [],
    "messages": []
}

Email authentication

These records are recommended regardless of whether your domain sends email messages. Creating secure email records ↗︎ can help protect your domain against email spoofing.

If your domain is not used to send email messages, learn more about creating recommended restrictive records ↗︎.

MX

A mail exchange (MX) record is required to deliver email to a mail server.

For field definitions, refer to the API documentation (visible once you select the record type under the request body specification).

DKIM

A DomainKeys Identified Mail (DKIM) record ensures email authenticity by cryptographically signing emails:

SPF

A Sender Policy Framework (SPF) record lists authorized IP addresses and domains that can send email on behalf of your domain.

DMARC

A Domain-based Message Authentication Reporting and Conformance (DMARC) record helps generate aggregate reports about your email traffic and provide clear instructions for how email receivers should treat non-conforming emails.


Specialized records

TXT

A text (TXT) record ↗︎ lets you enter text into the DNS system.

As the content of TXT records consist of one or more text strings delimited by double quotes ("), you might find a validation error if you add inconsistent quotation marks (for example, "this or "these" ones"). For new records, if you save your TXT content without any quotes, Cloudflare will automatically add double quotes. For details, refer to What is a DNS TXT record ↗︎.

At Cloudflare, TXT records are most commonly used to demonstrate domain ownership prior to issuing SSL/TLS certificates for your domain or a Cloudflare for SaaS domain.

You could also use TXT to create email authentication records, but we recommend that you use our Email security Wizard instead.

For field definitions, refer to the API documentation (visible once you select the record type under the request body specification).

CAA

A Certificate Authority Authorization (CAA) record specifies which Certificate Authorities (CAs) are allowed to issue certificates for a domain.

For field definitions, refer to the API documentation (visible once you select the record type under the request body specification).

SRV

A service record (SRV) ↗︎ specifies a host and port for specific services like voice over IP (VOIP), instant messaging, and more.

Example API call

For field definitions, refer to the API documentation (visible once you select the record type under the request body specification).

<details>

<summary>

Required API token permissions

</summary>

At least one of the following <a href="https://developers.cloudflare.com/fundamentals/api/reference/permissions/">token permissions</a> is required: