DEV Community

Bert Heyman
Bert Heyman

Posted on

Domain records for dummies

If you own a domain name, you get to choose what site is displayed on it. But there's more to that: it's also possible to determine who can use the domain to send emails or you can verify your ownership. How does this work?

First things first: nameservers

By setting the nameservers, you basically tell the domain what rules to listen to. By default, these will probably be the servers from the provider you bought the domain from. However, you can pick any nameservers you want.

Getting your settings right: DNS records

These nameservers can set DNS records to specify all sorts of stuff.

A record

Tell the domain what server (by IP) to use for the website. Most of the time, this one will be the most important.

AAAA record

Using an IPv6 for your server? Then you'd need to use an AAAA record instead of a regular A record.

CNAME record

Defines an "alias" and thus points to another domain that, in turn, might have an A record.

MX record

A Mail Exchange record will make sure the correct mail server is used.

TXT record

A TXT record can basically be anything. They are often used to confirm ownership of the domain, which is useful for some Google services.

SRV record

Used to connect to other services. Might be used for email of other software. These aren't used too much, in my experience.

Help! I set some records but they won't work

Using the right nameservers?

It's possible to have records on other nameservers than the active one.
Domain name >> nameservers (service B) >> records (service B)
If you are editing records on service A, they won't take into effect until the nameservers point to service A.

Account for DNS caching

DNS settings are cached on several levels, so it might take a while before you see a difference. In general, it's best to account for 24h when changing nameservers and up to 4h for changes in the records.

Tip: if you know a change is coming, lower the Time To Live (TTL) setting beforehand. The default of 3600 seconds means a record will be updated once every hour.

Check the active settings with tools like Google dig. Waited long enough and still not updated? Check on a different network of with 4G. If it's allright there, the settings might be cached on your local network.

Anything to add? Don't hesitate to leave a comment, would love to learn from you!

Discussion (0)