DEV Community

Cover image for DNS and Other Taxes
Aaron Rosenberg
Aaron Rosenberg

Posted on • Edited on

DNS and Other Taxes

Tl;dr

This is probably what you're looking for

Setup Your Domain URLs

The most common web address setup has the apex and www subdomain go to the same website (i.e. respectively https://example.com and https://www.example.com both work). Two types of DNS records are used to connect the apex to the site's source/hosting and to point the subdomain at the apex.

  1. Most cloud hosts provide a unique subdomain like krabby-kitten-1234.the-cloud.com. Create an ALIAS Record with host @ and value of the cloud subdomain.
    • If you have an IP address instead, create an A Record with it If you have an IP instead
    • Some DNS Providers (e.g. Cloudflare) use CNAME flattening to do this
  2. Create a CNAME Record with host www and and apex domain, example.com, as the value.

Finally, register the apex and subdomains with your cloud provider. This is typically a part of generating SSL certificates.

Hopefully that’s all you need! The rest of this post serves as an appendix if I get amnesia or if this is the first time you’re encountering these terms.

Why?

I call infrequent intricate tasks with painful penalties for minuscule mistakes “doing your taxes.” They’re bad enough without unambiguous concise information being so difficult to find. As to "be the change you wish to see in the world," this is the Good Enough™ primer for the next time.

Appendix

Parts of a URL

Image description

Record Types

  • A Record
    • This connects either an apex or subdomain to a static IP address.
  • CNAME Record
    • This connects a subdomain to another URL such as krabby-kitten-1234.the-cloud.com. It cannot be used for the apex domain because … reasons.
  • ALIAS Record
    • A CNAME that can be used for the apex or subdomains 😑

DNSWTF

Ultimately a URL needs to be turned into an IP address and it’s the Domain Name System (DNS) that handles this. When you buy a domain from a registrar, you create DNS records to tell other computers what IP address they can connect to in order to access the root and subdomains. When you specify another URL like with ALIAS and CNAME records, that address DNS records are looked up and so on until an IP address is found.

Top comments (0)