Differences between A, CNAME, ALIAS and URL records

A CNAME, ALIAS and URL records are all possible solutions to point a host name (name hereafter) to your site. However, they have some small differences that affect how the client will reach your site.

Before going further into the details, it’s important to know that A and CNAME records are standard DNS records, whilst ALIAS and URL records are custom DNS records provided by DNSimple’s DNS hosting. Both of them are translated internally into A records to ensure compatibility with the DNS protocol.

A (Address) record (IPv4)

This type of record allows associating a domain name or subdomain with an IP address (32-bit).

Sample configuration for A record type

IP Type Host Name
11.22.33.44 A example.com

AAAA record (IPv6)

The AAAA record is similar to the A record, but it allows you to point a domain to a IPv6 address (128-bit).

This will configure in the same way as A record is configured.

IP Type Host Name
1111:2222:3333:4444:5555 AAA example.com

CNAME record

This record specifies an alias of another domain name, canonical name. CNAME record will point your domain or subdomain to the IP address of the destination hostname.

If the IP of the destination hostname changes, you won’t need to change your DNS records as the CNAME will have the same IP.

Sample configuration

IP Type Host Name
11.22.33.44 A example.com
Host Type Name
example.com CNAME mysite.com

Please don’t set up CNAME for naked domain (@ hostname), since it may affect the operation of the domain’s MX records and, consequently, the email service.

Thus, in most cases you will need to create CNAME record for WWW (or other subdomain) and URL redirect for @ that will point to http://www.yourdomain.tld/

NS record

A NS record or name server record tells recursive name servers which name servers are authoritative for a zone.  Recursive name servers look at the NS records to work out who to ask next when resolving a name.

This type of record allows you to delegate a subdomain of your domain to a name server, not associated with a domain itself. This is needed when your subdomain is hosted separately from a domain name.

Name Type Host Name
ns1.myhisting.com NS blog

SRV record

The SRV (Service) record is a Domain Name System (DNS) resource record that is used to identify computers that host specific services.

SRV records allow you to define the location, i.e. the hostname and port number, of servers for specified services.

Name Type Host Name Priority Port Weight
_myservice._myprotocod SRV example.com

0

8080

5

Name should in the format of _service._protocol

TXT record

A TXT record is a type of DNS record that provides text information to sources outside your domain. The text can be either human or machine-readable and can be used for a variety of purposes. You can input any text for descriptive purposes.

TXT records are often used to store SPF (Sender Policy Framework) records and to prevent people from receiving fake emails.

Sometimes these records need to be set up for verification purposes, for example, some Google services require it.

Name Type Text Type Text
myname TXT mysite-verification=af4323-jkg7823-dfpq83h9c

URL Redirect (Unmasked Forwarding)

URL Redirect is used to redirect a domain to another URL/domain name.

When users type your domain in the URL bar, they are redirected to any specific web page, for example, http://maps.google.com/ or http://en.wikipedia.org/wiki/Main_Page. In this case, the destination URL is displayed for them in the address bar instead of yourdomain.tld.

Host Name Type Redirect URL Forwarding Type
example.com URL Redirect www.google.com unmasked

URL Frame (Masked Forwarding)

The URL Frame is similar to URL Redirect except that instead of redirecting the client to your web page, the web page is displayed in a frame.

With this method the client’s browser will display your domain name (for example: www.yourdomain.tld) while they are using your site and not the actual URL to your page.

Host Name Type Redirect URL Forwarding Type
example.com URL Redirect www.google.com masked

It looks cool, but is have some cons:

– It’s bad for SEO

– Not all websites allow masking itself

URL Redirect (301)

URL Redirect (301) (sometimes known as Permanent Redirect) should be used when you wish to permanently redirect your domain to some specific URL/domain name.

In this case search engines are notified of a permanent address change and the values of internal links are transferred to the new site.

Host Name Type Redirect URL Forwarding Type
example.com URL Redirect www.google.com Permanent(301)

When should you use this

– You’ve moved your site to a new domain

– When you merge two websites into one and you want to redirect the user request of the outdated URL to the correct page

MX record

A mail exchanger record (MX record) is used to direct email to a particular mail server.

Like a CNAME, MX entries must point to a host name and should not be pointed directly to an IP address.

You also need to set priority for your MX record in Priority column.

The lowest priority email server is the first destination for email. If the lowest priority email server is unavailable, mail will be sent to the higher priority email servers.

IP Type Host Name
11.22.33.44 A example.com
Host Name Type Name Priority
example.com MX mx.mysite.com

10

MXE record

MXE (Mail Easy) is used to forward mail to an IP address of a mail server.

Using a mail record allows you to specify the address of your mail server. When you use a mail record, you must use an IP address in the address field. (Experts: Creating a mail record actually creates both the MX and the A record in DNS. Also, when using multiple mail servers, a preference value of 10 is used on all entries).

IP Type
11.22.33.44 MXE

Prakash & Surender,
ROR Developers,
Mallow Technologies.

4 Comments

  1. Jayaprakash

    Is CNAME and ALIAS records same? I hope it shouldn’t be.

    1. harrysuren

      Hi Jayaprakash,

      Thanks for reaching out!

      The CNAME and ALIAS records aren’t same.

      The A record used to point a host name to a specific IP address. Example,
      192.0.0.1 A mallow-tech.com

      The CNAME record points a host name to another host name, it can be either a A record or CNAME record. Example,
      192.0.0.1 A mallow-tech.com
      mallow-tech.com CNAME blog.mallow-tech.com
      blog.mallow-tech.com CNAME updates.mallow-tech.com

      Cheers,
      Surender Thillainathan

      1. Jayaprakash

        Hi Surrender,

        I hope you misunderstood A and ALIAS records. A and ALIAS records are also not same.

        1. Harry Suren (@Harry_Suren)

          Hi Jayaprakash,

          Thanks for pointing it out 🙂

          I hope you came across the blog to know about CNAME. Lets have a quick view about ALIAS record.

          An ALIAS record is a virtual record type that we created to provide CNAME-like behavior on apex domains. The ALIAS record behaves like an A record returning one or more A records matching the alias target.

          The ALIAS records will be created by keeping two goals in mind.
          1. Make it possible to alias the root domain to another service
          2. Make it possible to use an alias system that can coexist with other data

          You can learn more about the difference between CNAME record and ALIAS record in these blogs.
          https://blog.dnsimple.com/2014/01/why-alias-record/
          https://ns1.com/articles/comparing-alias-and-cname-records

          And most importantly, my name is “Surender” (with single “r”) not “Surrender” (with double “r”)

          Hope this resolves your doubt.

          Happy to help if you want to know more 🙂

          Cheers!
          Surender Thillainathan

Leave a Reply

%d bloggers like this: