Domains & DNS

DNS Records You Will Use

30 Min.

Record types

Type Purpose Example
A name → IPv4 address @ A 203.0.113.10
AAAA name → IPv6 address @ AAAA 2001:db8::10
CNAME alias to another hostname www CNAME myapp.onrender.com
MX mail servers for the domain @ MX 10 mx1.mailprovider.com
TXT text: verification, SPF, DKIM, DMARC @ TXT "v=spf1 include:_spf.google.com ~all"
CAA which certificate authorities may issue certificates @ CAA 0 issue "letsencrypt.org"
NS delegate a domain or subdomain to nameservers docs NS ns1.otherdns.com

@ means the domain itself (the "apex" or "root"), for example pandadevhub.com.

The apex CNAME problem

DNS does not allow a CNAME at the apex alongside other records (like MX). Options:

  • Use the A record IP your host provides for the apex.
  • Use your DNS provider's ALIAS/ANAME or CNAME flattening feature, which behaves like a CNAME at the apex.
  • Point the apex at www with a redirect.

Subdomains

Subdomains are just records with a name: app.pandadevhub.com, api.pandadevhub.com, mail.pandadevhub.com. Each can point somewhere different. Wildcards (*.example.com) match any subdomain without its own record.

TTL

TTL (time to live, in seconds) tells resolvers how long to cache a record. Typical values: 300 (5 minutes) for records you may change, 3600 (1 hour) or more for stable records. Before migrating, lower the TTL a day in advance.

Checking records

dig +short A pandadevhub.com
dig +short CNAME www.pandadevhub.com
dig +short MX pandadevhub.com
dig +short TXT pandadevhub.com
dig @1.1.1.1 pandadevhub.com        # ask a specific public resolver

Online tools such as DNS checkers show results from many locations, useful for watching changes spread.

Exercise

For a domain you control (or a free subdomain), create: an apex record for your host, a www CNAME, a TXT verification record and a CAA record for Let's Encrypt. Verify each with dig.

Check yourself

  • Why can't you put a CNAME at the apex next to MX records?
  • What does lowering a TTL before a migration achieve?
  • Which record tells the world where to deliver your email?

Ihr Fortschritt wird nur in diesem Browser gespeichert.

Zur Prüfung einreichen (10 Punkte)