# How to Create a CNAME Record for a Subdomain

https://ferkesh.net/uk/baza-znan/stattia/create-cname-record

![Diagram linking Alias name, CNAME target, Target address and Website mapping.](https://ferkesh.net/kb-media/ferkesh-guide-diagrams-batch-02.svg#create-cname-record)

A CNAME points one DNS name to another DNS name. For example, docs.example.com might point to a hostname provided by a documentation platform. Enter the target hostname supplied by the platform. A CNAME target is not an IP address, an HTTPS URL or a path.

## Add the alias in the active zone

Find the authoritative DNS provider. Identify the record owner and target separately. For the example above, create CNAME at docs in the example.com zone and use the platform’s assigned hostname as its value. Preserve any previous record values so you can undo the change. A standard CNAME cannot coexist at the same owner name with normal record data such as A, AAAA or MX. If those records provide a working service, identify their purpose before editing them.

## Check the alias and the application

Look up the CNAME and confirm the target is the one the platform gave you. The platform may also require you to verify control of the hostname and attach it to a site. Open the original alias in a browser once the platform has accepted it. A redirect to another address is a separate application behavior. A DNS alias alone keeps the address bar on the alias entered by the user.

## When a provider asks for an apex alias

A conventional zone apex already needs records such as NS and SOA. Use the published apex method offered by the DNS or application provider, such as a supported flattened alias or an A record. Confirm the method before replacing the zone’s existing records.

An apex hostname has different constraints from a subdomain. Review [CNAME flattening at the domain apex](https://ferkesh.net/knowledgebase/article/cname-flattening-zone-apex) before choosing the record type.

## Related guides

- [DNS Records Explained for Website Owners](https://ferkesh.net/knowledgebase/article/dns-records-explained)
- [How to Set A and AAAA Records Safely](https://ferkesh.net/knowledgebase/article/configure-a-aaaa-records)
- [Nameservers and DNS Delegation Explained](https://ferkesh.net/knowledgebase/article/nameservers-and-delegation)
- [Domains and DNS category](https://ferkesh.net/knowledgebase/category/domains-and-dns)

## Official references

- [Cloudflare DNS record types](https://developers.cloudflare.com/dns/manage-dns-records/reference/dns-record-types/)
- [Cloudflare DNS record troubleshooting](https://developers.cloudflare.com/dns/manage-dns-records/troubleshooting/)

Ferkesh Hosting. Last reviewed November 26, 2026.
