Skip to main content

Your privacy

We store what the site needs to work, like a notice you closed or your domain shortlist. With your OK we also use Google Analytics to see which pages help people, and the Meta Pixel to measure which of our adverts work. Privacy policy

Serverlys
Domains & DNS

Add an A record or a CNAME record

Which record a name needs, how to type the host field without doubling the domain, and how to check the result.

All Domains & DNS tutorials6 stepsAbout 5 minutes

Before you start

  • Access to wherever the domain's DNS is hosted — the nameservers decide where that is
  • The IP address or hostname you were given
  1. Step 1: Choose the record type

    An A record maps a name to an IPv4 address; AAAA does the same for IPv6. A CNAME makes a name an alias of another hostname, so it follows that hostname wherever it moves. If a service gave you an IP address, use A. If it gave you a hostname, use CNAME.

  2. Step 2: Know where a CNAME is not allowed

    A name that has a CNAME may have no other record at all. That rules out the bare domain (@), which must also carry the zone's SOA and NS records. Some DNS providers offer a substitute for the apex, called ALIAS, ANAME or CNAME flattening; whether you have it depends on the provider. Without it, the apex gets an A record.

  3. Step 3: Open the zone editor and add the record

    In cPanel it is Domains → Zone Editor → Manage next to the domain → Add Record. At a registrar it is usually under DNS settings. Every editor asks for the same four things: name (host), type, TTL and value.

    blog.yourdomain.com.   3600  IN  A      192.0.2.10
    shop.yourdomain.com.   3600  IN  CNAME  shops.example-platform.com.
  4. Step 4: Type the name the way the editor expects

    Panels differ: some want only the label (blog), some want the full name, and some want a trailing dot to mark a name as complete. If the editor appends your domain and you type the full name too, you create blog.yourdomain.com.yourdomain.com. After saving, read back the full name the editor displays.

  5. Step 5: Remove what the new record replaces

    If an A record already exists for the name you want to CNAME, delete it — the two cannot coexist. If you are changing an A record, edit it rather than adding a second one: two A records on one name split visitors between both addresses.

  6. Step 6: Check the answer

    Query the record directly. On Windows, nslookup does the same job. Expect the new value once the old record's TTL has run out.

    dig +short A blog.yourdomain.com
    dig +short CNAME shop.yourdomain.com
    nslookup -type=CNAME shop.yourdomain.com

The mistake people make

Adding a new A record next to the old one instead of editing it. DNS returns both, so roughly half of visitors keep landing on the old server and the problem looks intermittent.

Stuck on something not covered here?

Support is included on every plan, and it reaches a person. There is also the blog for the why behind these, and the FAQ for questions about buying.

Get help

A plan that still makes sense in year two

Free migration, free SSL and daily backups on every plan, with a 30-day money-back guarantee.

Prefer the phone? (305) 671-1272 · Existing customer? Client login