انتقل إلى المحتوى

المقارنات DNS مبتدئ1 دقائق قراءة

A Record vs CNAME: What's the Difference?

A records point a name to an IP address; CNAMEs point a name to another name. When to use each, the root-domain rule, and common setups.

بواسطة فريق تحرير ZSOLNET آخر تحديث

هذه الصفحة غير متاحة بالعربية بعد، لذا تُعرض بالإنجليزية.

أهم النقاط

  • An A record maps a hostname directly to an IPv4 address (AAAA for IPv6).
  • A CNAME makes a hostname an alias of another hostname.
  • The root domain can't be a standard CNAME, so it normally uses A/AAAA records.

Both records tell resolvers where a name should lead — they just do it differently.

The difference

A recordCNAME record
Points toAn IPv4 address (203.0.113.10)Another hostname (shop.provider.net)
Can be used at the root domainYesNo (standard DNS)
Can coexist with other records at the same nameYesNo
Updates when the target’s IP changesYou update itAutomatic — follows the target

When to use an A record

Use A (and AAAA for IPv6) records when you know the server’s IP address and control it — for example the root domain pointing to your hosting server.

When to use a CNAME

Use a CNAME when a service gives you a hostname rather than an IP, or when one name should always follow another:

  • www.example.com → example.com
  • shop.example.com → a hosted store platform
  • verification and mail-service records that providers ask you to create as CNAMEs

The root-domain rule

Standard DNS doesn’t allow a CNAME at the zone apex (example.com) because the apex must hold other records like SOA, NS and MX. That’s why root domains normally use A/AAAA records.

Check what a name currently uses with the DNS lookup or CNAME lookup.

الأسئلة الشائعة

Is a CNAME slower than an A record?

A CNAME can require an extra lookup to resolve the target, but resolvers cache both, so the difference is rarely noticeable.

What is CNAME flattening or an ALIAS record?

Some DNS providers resolve the target behind the scenes and answer with A/AAAA records, letting you point the root domain at a hostname.

شارك X LinkedIn Facebook

الدخول إلى حسابك

أدِر نطاقاتك واستضافتك وفواتيرك من مكان واحد.

اتصال آمن مباشرة مع منطقة العملاء في ZSOLNET.

ليس لديك حساب؟