Connect a custom domain: DNS in plain English.

Six steps, four record types and one command to check your work. No networking degree required.

House number 37 on an enamel plate set into a brick wall
Photo by Haberdoedas on Unsplashdithered by Cyborb

To connect a custom domain, you add a few records at the company that runs your domain’s DNS. Usually that means an A record (or an ALIAS) for the bare domain, a CNAME for www, and sometimes a TXT record to prove you own it. Your host tells you the exact values. Then you wait a few minutes, check, and turn on HTTPS.

That is the whole job. The rest of this guide explains each piece in plain words, so you know what you are clicking and how to fix it when something looks wrong.

The short version
  • DNS is the internet’s address book. Records tell browsers where your site lives.
  • You usually need an A or ALIAS record for example.com and a CNAME for www.example.com.
  • Your host’s domain settings page gives you the exact values. Copy them, do not guess.
  • Most changes show up within minutes to a few hours. A lower TTL makes the next change faster.
  • Check your work with one command (dig) instead of refreshing a browser.

What DNS actually does

When someone types your domain, their device asks a DNS resolver for the answer. The resolver asks your domain’s nameservers, which hold your records. Then it caches the answer for a while, so the next visitor gets it instantly.

That caching is why changes are not always instant. It is also why you should never panic in the first ten minutes.

The four records you will actually touch

Most hosts only ever ask for a few record types. Here is what each one means.

RecordWhat it doesExample valueWhen you need it
APoints a name at an IPv4 address203.0.113.10Your host gives you an IP address
AAAAPoints a name at an IPv6 address2001:db8::10Your host gives you an IPv6 address
CNAMEPoints a name at another nameyoursite.host.appYour host gives you a hostname, usually for www
TXTHolds text, often a verification codehost-verify=abc123Your host asks you to prove you own the domain

Two more show up now and then. MX records decide where your email goes, so leave them alone unless you are changing email providers. CAA records list which certificate authorities may issue certificates for your domain. They are optional hardening.

Records or nameservers: pick your approach

There are two ways to connect a domain. You can add a few records where your DNS already lives, or you can move your whole DNS to your host by changing nameservers.

Add records where DNS lives nowSwitch nameservers to your host
What changesTwo or three recordsYour whole DNS zone moves
Email and other recordsStay exactly as they areMust be recreated at the new provider
Best whenThe domain already has email or other servicesThe domain is brand new
How to undoDelete the recordsSwitch back, which is slower to take effect

If your domain already sends or receives email, adding records is the safer choice. Changing nameservers without copying your MX and TXT records is the most common way people break their email on launch day.

Connect your domain in six steps

  1. Find the exact values your host wants

    Open your host’s domain or custom domain settings and add your domain there first. The page will list the records to create, with exact values. Copy them into a note. Hosts differ, so a value from a tutorial is not a substitute. If you have not picked a host yet, where to deploy your app compares nine of them.

  2. Find out where your DNS lives

    Your DNS is not always at the company where you bought the domain. Ask the internet which nameservers answer for it:

    Terminal
    dig +short NS example.com

    If the answer names your registrar, log in there. If it names another provider, that is where you edit records.

  3. Lower the TTL a day early (optional)

    TTL, or time to live, is how many seconds resolvers may cache a record. If you are replacing records that already exist, set their TTL to 300 (five minutes) a day before. Then your real change spreads quickly, and a mistake is quick to undo.

  4. Add the records

    Create the A or ALIAS record for the root (often shown as @) and the CNAME for www. Paste values exactly, with no extra spaces. If your provider adds your domain automatically, enter www, not www.example.com, in the name field.

  5. Remove anything that conflicts

    Delete old A or AAAA records on the same names, especially ones left by a parking page or a previous host. Two records pointing at different servers means some visitors see the old site. Leave MX records untouched.

  6. Verify, then turn on HTTPS

    Wait a few minutes, then check with the commands below. Once the records resolve, your host can issue a certificate, usually automatically. Finally, pick one version (www or the bare domain) and redirect the other to it.

How to check your work

Refreshing a browser tells you little, because your own device caches answers too. Ask DNS directly instead.

Terminal
# Where does the bare domain point?
dig +short A example.com

# Where does www point?
dig +short CNAME www.example.com

# Is the verification record there?
dig +short TXT example.com

On Windows, nslookup -type=TXT example.com does the same job. If a public resolver still shows an old answer, Google and Cloudflare both let you flush a name from Google Public DNS or purge it from 1.1.1.1.

HTTPS is automatic now, and it has to be

Once your domain points at your host, the host proves control of it and requests a free certificate from a certificate authority such as Let’s Encrypt. You rarely see this happen. The padlock just appears.

Automation is no longer optional. The industry is shortening how long a certificate can stay valid:

200 days
The longest a public certificate can be valid since March 15, 2026
CA/Browser Forum
100 days
The limit from March 15, 2027
CA/Browser Forum
47 days
The limit from March 15, 2029
CA/Browser Forum

Let’s Encrypt plans to go further and move from 90-day to 45-day certificates by 2028. For you, this means one thing: use a host that renews certificates for you. Nobody should be pasting certificate files into a dashboard every few weeks.

Before you call it done

Launch check0 of 6

FAQ

How long does it take for DNS changes to work?

Usually minutes to a few hours. Resolvers keep an old answer until its TTL runs out, so a record with a one-day TTL can take a day to update everywhere. Lowering the TTL before a change makes the switch fast.

Should I use www or the bare domain?

Either works. Pick one as the main address and redirect the other to it, so search engines see one site instead of two. Many hosts make the bare domain the default today.

Can I put a CNAME on my root domain?

Not as a plain CNAME, because the DNS rules forbid other records next to it and the root always has some. Use the A record your host gives you, or an ALIAS, ANAME or flattened CNAME if your DNS provider offers one.

Do I have to transfer my domain to my web host?

No. You can keep the domain registered where it is and only add records there. Transferring is a separate process that you only need if you want billing and DNS in one place.

Why does my site show a certificate warning?

The certificate is usually issued only after DNS points at the host. Wait until your records resolve, then check the host’s domain page. If a stale record still points at an old server, some visitors will see that server’s certificate instead.

Key takeaways
  • You connect a domain with two or three records, and your host tells you their exact values.
  • Use an A or ALIAS record at the root and a CNAME for www.
  • Remove conflicting records, and never delete MX records by accident.
  • Check with dig, not with a browser refresh.
  • Let your host handle certificates, because lifetimes keep getting shorter.

Next, see how to put a website online from start to finish, or build the site itself with AI in an afternoon.

Sources
  1. RFC 1034: Domain names, concepts and facilities, IETF
  2. RFC 8659: DNS Certification Authority Authorization (CAA) record, IETF
  3. Ballot SC-081v3: schedule of reducing certificate validity, CA/Browser Forum, April 2025
  4. Decreasing certificate lifetimes to 45 days, Let’s Encrypt, December 2025
  5. Flush cache, Google Public DNS
  6. Purge cache, Cloudflare 1.1.1.1
cyborb.ai

Stop reading about it. Build it.

Describe what you want in plain words. Cyborb plans the work, writes and runs the code, makes the assets, and puts the result online.

Download Cyborb

Free to start. No card required.