How DNS works
Names, labels, and fully qualified names
Read a domain name from right to left and recognize the root, top-level domain, registered domain, and subdomain labels.
A DNS name is a list of labels separated by dots. Take api.shop.example.com. The labels are api, shop, example, and com. The dots are separators, not part of any label.
Here’s the trick: read the name from right to left. That’s the order DNS uses.
com sits right below the root of the whole system. example sits below com. Then shop, then api. Each label is one step deeper in the tree.
The root and the trailing dot
The root has a name too. It’s an empty label, and you write it as a final dot:
api.shop.example.com.
A name written with that final dot is a fully qualified domain name, or FQDN. It’s absolute. It means the same thing on every machine, no matter how that machine is configured.
Without the final dot, some tools treat the name as relative. On a company network, printer might silently become printer.office.example.com. Handy when it works, confusing when you’re debugging. The name you typed isn’t always the question that went out.
Let’s compare the two forms:
dig A api.shop.example.com.
dig A api.shop.example.com
Most of the time these ask the same question. The trailing dot makes your intent explicit. When I’m chasing a weird result, I add it.
Relative names in zone editors
DNS dashboards add their own kind of relativity. Inside the example.com zone, one dashboard expects you to type api.shop and appends .example.com for you. Another wants the full name.
Be careful here. Type the full name in the first kind of editor and you end up with api.shop.example.com.example.com. I’ve seen this happen more than once. Check the preview before you save.
Two things that trip people up
DNS names are case-insensitive. API.Shop.Example.COM resolves the same as the lowercase version. The application behind the name can still have case-sensitive URLs though.
And not every label below a suffix is something you can register. co.uk looks like a domain, but you register names under it. Registration policy and the public suffix list are separate from the DNS tree itself.
Try this: take cdn.assets.shop.example.com. and split it into labels. Find the root, guess where the zone apex probably is, and write the relative name you’d type into an example.com zone editor.
Lesson completed