India English
Kenya English
United Kingdom English
South Africa English
Nigeria English
United States English
United States Español
Indonesia English
Bangladesh English
Egypt العربية
Tanzania English
Ethiopia English
Uganda English
Congo - Kinshasa English
Ghana English
Côte d’Ivoire English
Zambia English
Cameroon English
Rwanda English
Germany Deutsch
France Français
Spain Català
Spain Español
Italy Italiano
Russia Русский
Japan English
Brazil Português
Brazil Português
Mexico Español
Philippines English
Pakistan English
Türkiye Türkçe
Vietnam English
Thailand English
South Korea English
Australia English
China 中文
Somalia English
Canada English
Canada Français
Netherlands Nederlands

Differences Between A and CNAME Records

Buy domains, business emails, hosting, VPS and more: Get Started

Cheapest Domains in Kenya

Get your .Co.uk or .Com domain now for just $6.94 (Back to $5.89 in 7 days)

.CO.UK for $6.94 | .COM for $10.87

An A record connects a hostname directly to an IPv4 address. A CNAME record makes one hostname an alias of another hostname.

That is the central difference.

Use an A record when your hosting provider gives you a fixed IPv4 address such as 192.0.2.10. Use a CNAME when the provider gives you a hostname such as project.host.example, especially for a subdomain such as www, shop or app.

The two records can eventually lead visitors to the same server, but they store different targets and obey different DNS rules.

A .co.uk zone follows the same standards as the reserved examples used below.

A record vs CNAME at a glance

Question

A record

CNAME record

What does it point to?

An IPv4 address

Another hostname

Typical value

192.0.2.10

project.host.example

Common name field

@, www, app

www, shop, status

Can you use it at the zone apex?

Yes

Normally no under standard DNS

Can the same name hold other record types?

Yes, subject to type-specific rules

No, apart from DNSSEC-related exceptions

Who manages target changes?

You update the IP

The target provider can change its IPs

What happens during lookup?

The resolver receives an IPv4 address

The resolver follows the canonical target

The @ symbol in many DNS panels means the zone apex: the bare registered domain without www before it.

A provider may use the words root domain or naked domain for the same position.

An A record points a hostname directly to an IPv4 address while a CNAME points an alias to a canonical hostname that then resolves to an IP address

An A record stores the address. A CNAME stores the next hostname that the resolver must follow.

An A record ends at an IPv4 address

An A record answers the question: “Which IPv4 address serves this name?”

Type: A
Name: @
Value: 192.0.2.10
TTL: 3600

This example connects example.com to 192.0.2.10. A resolver can return that address without looking up another hostname.

Choose an A record when:

  • your web host supplies a stable IPv4 address;

  • you need to connect the zone apex to an IPv4 address;

  • a service explicitly asks you to publish an A record; or

  • you control the server address and will update DNS when it changes.

An A record does not cover IPv6. Add an AAAA record when the service also gives you an IPv6 address. Do not paste a hostname into the value field of an A record; the field expects an IPv4 address.

A CNAME makes one hostname an alias

A CNAME answers a different question: “What is the canonical hostname for this alias?”

Type: CNAME
Name: www
Target: project.host.example
TTL: 3600

Here, www.example.com becomes an alias of project.host.example. A resolver follows that target and then obtains its A or AAAA answer.

This suits services whose addresses may change behind a stable hostname. Your website platform, content delivery network or hosted application can update the target’s IP addresses without requiring you to replace an A record in your own zone.

Choose a CNAME when:

  • a provider gives you a hostname rather than an IP address;

  • several subdomains should follow one canonical service name;

  • you want www.example.com to follow another hostname; or

  • a platform’s custom-domain instructions explicitly request a CNAME.

A CNAME does not redirect a browser. DNS resolves names before the browser sends an HTTP request.

If you want example.com/page to send a visitor to a different URL, you need an HTTP redirect or a forwarding service.

A live lookup shows the difference

I queried Google Admin Toolbox Dig. The CNAME query for www.github.com returned github.com as its target.

Google Admin Toolbox Dig showing www.github.com as a CNAME with github.com as its target

The CNAME answer contains another hostname, not an IPv4 address.

I then queried the A record for github.com. That answer returned an IPv4 address directly.

DNS answers and TTLs can vary by time and location, so the address you see later may differ.

Google Admin Toolbox Dig showing an A record for github.com with an IPv4 address

The A answer contains the IPv4 address used for that lookup.

The screenshots show the operational difference without implying that every CNAME requires a visibly slow second trip.

Resolvers cache records, and authoritative responses can include related data. The dependable distinction is the stored target: address versus hostname.

Why a CNAME normally cannot sit at the root

Standard DNS does not allow a CNAME to coexist with other data at the same name.

The zone apex already needs records such as SOA and NS. Turning the apex into a CNAME would conflict with those required records.

That is why a conventional setup often uses:

example.com.       A       192.0.2.10
www.example.com.   CNAME   example.com.

Some DNS providers offer ALIAS, ANAME or CNAME-flattening features for the apex. These are provider-specific solutions, not a reason to assume an ordinary CNAME will work there.

Dark webpage section explaining Cloudflare's CNAME flattening process, detailing how it finds IP addresses, a key difference in A record vs CNAME functionality
This section describes how CNAME flattening works to resolve DNS queries faster by returning an IP address instead of another CNAME.

For example, Cloudflare documentation explains how it flattens an apex CNAME and returns an IP answer, while Route 53 offers its own alias records for supported targets.

Follow the instructions for your active DNS provider. If its panel accepts a CNAME-like record at @, check whether it calls the result flattened, ALIAS or ANAME, and test the public answer after saving.

A CNAME name cannot also carry ordinary records

If shop.example.com has a CNAME, do not add an A, MX or TXT record with that exact same name.

RFC 1034 defines the alias as a separate identity from the canonical name, and later DNS guidance states that a CNAME cannot coexist with other ordinary data at its node.

This restriction can become apparent during service verification. A platform may ask for a CNAME at verify.example.com while another tool asks for a TXT record at the same label.

Use separate labels if the providers support them. Do not force both records onto one name.

The restriction applies to the full hostname, not to the whole domain. A CNAME at www.example.com does not prevent you from keeping MX records at example.com or a TXT record at _dmarc.example.com.

Choose the record from the target you received

Start with the value supplied by the service you are connecting.

Provider supplied

Record to choose

Example

IPv4 address

A

203.0.113.24

IPv6 address

AAAA

2001:db8::24

Hostname

CNAME for a subdomain

tenant.platform.example

Hostname for the apex

Provider-specific alias or flattening

Route 53 alias, ALIAS, ANAME or flattened CNAME

URL with https:// or a path

Neither by itself

Configure an HTTP redirect or application route

Do not convert a provider’s hostname into the IP address it happens to return today unless the provider explicitly tells you to. The service may rotate that address.

The hostname is often the stable contract.

Avoid these five DNS mistakes

1) Putting a hostname in an A record

An A value must be an IPv4 address. If you received site.vendor.example, use the record type the vendor specified, usually CNAME for a subdomain.

2) Putting an IP address in a CNAME

A CNAME target must be a hostname. An IPv4 address belongs in an A record.

3) Replacing mail records by accident

Changing the apex or nameservers can affect far more than the website. Save the current MX, TXT and other service records before a migration. An A record change at @ should not require deleting unrelated mail records.

4) Building long CNAME chains

A chain such as www to site to origin creates extra dependency and makes faults harder to trace. Point the alias to the final stable hostname when the service supports it.

5) Judging success from the DNS panel

A saved row proves only that the panel accepted the input. Query the public DNS after the change, then test the website or service that depends on it.

Our pointing guide covers the wider connection process when your domain and hosting sit with different providers.

Test the answer after every change

Use dig, nslookup or a reputable online DNS lookup. Query the exact hostname and record type you changed.

dig example.com A
dig www.example.com CNAME

On Windows, you can use:

Resolve-DnsName example.com -Type A
Resolve-DnsName www.example.com -Type CNAME

Check that the returned value matches the intended address or hostname. Then test the connected service. A correct DNS answer does not prove that the web server has a valid TLS certificate, recognises the hostname or serves the expected site.

If an old answer remains visible, compare the TTL and query more than one resolver before changing the record again. Repeated edits restart the troubleshooting process and can leave different caches holding different versions.

Use A for an address and CNAME for an alias

The choice becomes straightforward once you inspect the target. An A record stores an IPv4 address. A CNAME stores another hostname and gives the target provider room to manage its addresses.

Use A at the apex when you have a fixed IPv4 address. Use CNAME for www or another subdomain when a platform gives you a canonical hostname. Treat apex aliases and flattening as provider-specific features, and never combine a CNAME with ordinary records at the same hostname.

If you need a domain with DNS controls in one account, search our domains and keep the service’s exact record instructions beside you during setup.


Mysson Victor
Author

Mysson Victor

Digital Marketer and SEO Strategist Nairobi

Mysson is a Digital Marketing Lead and SEO Strategist specializing in organic search growth, conversion optimization, and marketing systems built with artificial intelligence.

His work focuses on search engine optimization, content strategy, WordPress marketing infrastructure, AI driven automation, and online business growth.

Mysson has built and scaled several content driven websites to more than 50,000 monthly visitors through organic search, using advanced keyword research, search focused content creation, and conversion optimization strategies.

His publishing portfolio includes platforms such as The PennyMatters and Moneyspace, where he writes practical guides on personal finance, blogging, technology, and digital growth.

At Cloudoon, the company behind Truehost, Olitt, and CloudPap, Mysson serves as the Digital Marketing Lead, where he oversees SEO strategy, organic growth initiatives, and conversion focused marketing systems across multiple digital products.

Beyond SEO, Mysson designs high converting WordPress landing pages and marketing funnels, combining UX design, search intent, and conversion optimization to improve lead generation and revenue.

He also builds AI powered marketing systems using low code platforms such as Lovable and Google AI Studio, developing tools that automate content workflows, data analysis, and marketing operations.

Through his work in digital publishing and marketing technology, Mysson focuses on turning complex digital strategies into practical systems that help businesses and creators grow online.

View All Posts