When we browse the internet, a lot is happening in the background to deliver web pages and services. As a foundation, we have a domain name system (DNS) that helps us convert uniform resource locator (URL) links like www.fasthosts.co.uk into IP addresses. In our case, Fasthosts has an IP address of 213.171.195.48. The DNS server will remember the IP address for us, simplifying web browsing.

Delving deeper into DNS, we have DNS records. This is where a URL is saved with a corresponding IP address, which we then use to connect to the website in question. There are numerous DNS record types, including A, CNAME, ALIAS, and URL records. We will be covering CNAME and ALIAS records in detail throughout this guide – as well as the key differences between CNAME vs ALIAS records.

CNAME records

CNAME stands for canonical name record and is used to map one hostname to another hostname. Essentially – it can point to additional names or subdomains that point to the IP address of a single domain. 

As an example, using a CNAME record, a user would type in www.fasthosts.co.uk, with the DNS service interpreting that URL as fasthosts.co.uk instead. In this example, fasthosts.co.uk is the A record. This is the most basic type of DNS record and points a domain name to a specific IP address.

NOTE – A subdomain is a prefix attached to a domain name. For example, help.fasthosts.co.uk is a subdomain, and fasthosts.co.uk is the domain. Subdomains are, therefore, used to divide up different sections of your website for easier browsing and categorisation.

How does a CNAME work?

As a rule, a CNAME record can never point to an IP address. It can only point to another domain name. You also cannot have two records which reference the same domain name. As an example, you cannot have a CNAME record and a TXT record that both point to www.fasthosts.co.uk.

While CNAME records are useful for redirecting web traffic, they also incur a performance penalty in the form of additional DNS lookup steps. This penalty is exacerbated when pointing one CNAME record to another CNAME record, meaning you should always try to avoid this.

A CNAME record will be formatted with two customisable elements on most DNS management services. These are the Name and the TTL.

When you specify a Name, the DNS service should automatically append the domain name. For example, if you set the Name as www. , then the DNS service will automatically append the domain name fasthosts.co.uk, or our A record.

The TTL stands for time to live. This is the amount of time that a cached CNAME record will be considered accurate. After this time elapses, the CNAME record will be deemed out of date, and a refresh from the authoritative DNS server will take place.

The benefits of CNAME records

So, why would we use a CNAME record?

As CNAME records point to an A record, this is beneficial when changing an IP address. If you change the IP address associated with an A record, you do not need to take the additional step of changing the CNAME IP address association, as it queries the A record for that information.

For example, we could have mail, www, and ftp subdomains for our website stored as CNAME records. This means that, if the A record IP address for fasthosts.co.uk were to change, these changes would also apply to mail.fasthosts.co.uk, www.fasthosts.co.uk, and ftp.fasthosts.co.uk. 

The use of CNAME records, therefore, also benefits the user experience by masking configuration changes for users.

Depending on the size of your website, and the quantity of traffic, you may only need one hosting server. Rather than having individual servers that deal with ftp and mail, a single hosting server can deliver all content for these subdomains when you use CNAME records.

Drawbacks of CNAME records

1. Potential for poor user experience

If a CNAME record is pointed to another CNAME record, this can result in multiple DNS lookups before the intended domain can be loaded – slowing down the loading of a site a user wishes to access. This then results in a user potentially clicking off the site entirely, which can affect site visits, sales and overall SEO.

2. Possibility for DNS loops

Similarly to the first point, if one CNAME points to another and then back to the first, this can create something known as a DNS resolution loop. DNS loops can be a major issue as they can increase load on a DNS – making a domain or particular service unavailable to users.

3. They can’t exist alongside other records

 A CNAME record cannot co-exist with other records for the same domain – meaning you need to take caution about which domain you point it to. As explained previously, you cannot have a TXT record (or other type of record) and a CNAME record pointing to another domain for the same subdomain.

ALIAS records

ALIAS records are very similar to CNAME records. The main difference is that a single CNAME record can only reference a single domain name, whereas multiple ALIAS records can reference a single domain name at once.

In addition, ALIAS records only redirect A records and AAAA records, meaning they do not conflict with other record types like TXT records and URL records. At resolution time, this means that ALIAS records can automatically resolve to one or more A records.

The ALIAS record was created to overcome these problems with CNAME records. An ALIAS record is classed as a custom virtual record and provides CNAME-like behaviour without the limitations of CNAME record types on apex domains (root domains).

Uses and benefits of ALIAS records

One way that you can use ALIAS records is when diverting from a root domain to another location. This cannot be done with CNAME records.

An example of this could be that you want to redirect users that visit example.com to tech.demo.com. You would set an ALIAS record that points visitors from example.com to tech.demo.com, creating a non-HTTP redirect for that domain name.

If you want to redirect users who type an incorrect URL (e.g. heelp.fasthosts.co.uk) to your website, you can do this also with ALIAS records. You would specify the hostname as *, with the asterisk covering any hostnames that aren’t specified in your DNS management service.

If you currently have a domain name registered with Fasthosts or use Fasthosts nameservers for DNS queries, you can follow this guide to set up an ALIAS record on our service.

You will typically find ALIAS records being used on cloud hosting platforms like Fasthosts, to divide up servers existing between subnets in our data centre. This also applies to services that provide IP address pools, like Github with their user-specific Git repositories (github.com/user1, github.com/user2/project1).

Disadvantages of ALIAS records

While there aren’t many to note, the main disadvantage of ALIAS records is that they aren’t a standard DNS feature, which therefore means they lack support from DNS providers. This limited support can potentially cause compatibility issues when trying to use ALIAS records with certain DNS providers, which can result in limitations when configuring a domain.

Plus, ALIAS records can lose geo-targeting because they handle DNS queries differently. Geo-targeting is used to deliver specific content based on where a user is located (e.g. in another country – so a different language and/or currency can appear). But with ALIAS records, the query for a website happens at the authoritative DNS side (e.g. www.thisdomain.co.uk), not where the user is based (e.g. www.thisdomain.es). This means the server handling the DNS request determines the location, not where the user is located.

So, when one website asks for info from another site, the first site's authoritative server decides the geo-targeting data. This said data reflects the server's location, not where the user is. This can be problematic if you’re trying to sell or provide a service in another territory (www.thisdomain.es), this loss of geo-targeting can impact your business, as the user might not be able to display local product offerings or shop in local currency.

Common questions about CNAME and ALIAS records

Why use CNAME over ALIAS?

CNAME records are widely known and supported across the vast majority of DNS providers, meaning you can get support by pointing additional names (or subdomains) to the IP address of your main domain.

Why use ALIAS over CNAME?

Compared to CNAME, ALIAS records can exist alongside other DNS records under the same name. This means that while it might be hard to have multiple records with CNAME for one name (because CNAME can't share its name with other records) – this isn’t an issue with ALIAS.

Another thing is that ALIAS records can be used at the zone apex (the root domain), whereas CNAME records can’t, making ALIAS records more suited to directing root domains.

Can a domain have both an A record and CNAME?

No. You cannot have CNAME records and other records with the same domain name.

When can you not use a CNAME?

There are many instances where you can’t use a CNAME – one is to point to a root domain. CNAME records only work by pointing IP addresses to a subdomain. Instead, you should use an ALIAS record to turn a root domain into an A record so it can be pointed from one root domain to another.

Choose Fasthosts for Web Hosting and DNS

Web hosting and DNS configuration can be tedious, but Fasthosts offers the award-winning Fasthosts Control Panel to streamline the process. This unified management dashboard allows you to manage all of the services you currently use with Fasthosts. Our Dedicated and Virtual Private Servers (VPS) use Fasthosts nameservers, meaning DNS queries never leave our data centres.


Give your business services the platform they deserve. Get in touch with our sales team, or via email at sales@fasthosts.co.uk to find out more!