Domain name basics

By kathc, 22 September, 2023

 

Domain names are structured with the protocol (HTTPS:) // domain-name . top level domain (.com, .org, .ca). Anything between the separator for the protocol and the domain is a sub-domain. 

You register your domain name with a registrar that has the authority to add records to the TLD, so it is unique in the world to create URLs that point to only your web services (Unique Resource Locator). If you have multiple resources using the same domain, you will use subdomain names (also unique within your domain). 

The DNS (Domain Name Server) service you're using can route within that domain using lines in a table (records) with various record types (https://en.wikipedia.org/wiki/List_of_DNS_record_types). The most necessary to a functioning small organization are A (the main record that points your domain name to the IP address of the server hosting your website), CNAME (Canonical Name) which includes subdomains pointed to the same or other IP addresses or domains, MX (mail exchange) that routes your messages to and from your mailbox and NS (the nameservers that keep track of where your other records are stored). 

www is an old-fashioned (from the 80s) way of telling computers what server to connect to for a domain. We had to put www. (for World Wide Web) in front of our website name, mail. in front of our email server, ftp. or samba. for our file server, etc. to help browsers find the right endpoint for their request. Modern browsers (since about 2000) assume the protocol (i.e. HTTP: or HTTPS: mean Hypertext Transport Protocol (with and without Security, mail: means email) and DNS uses different types of records to tell the domain system where to send the appropriate traffic (I usually add a CNAME of WWW to refer any traffic, but that doesn't work for rules that are directing to specific pages within another domain). As soon as you have two or more websites on a domain (e.g. actioncanadashr.org and secure.actioncanadashr.org) they can't both be www so you have to choose which one is the primary and point all traffic there using a CNAME record which says I know that I told you that actioncanadashr.org is the server at x.x.x.x, but you should also send www.actioncanadashr.org there because it's the same thing, but send secure.actioncanadashr.org requests over to y.y.y.y). DNS records are also necessary when you have two or more servers providing service for a single domain name (e.g. multiple MX records for mail servers that end up putting the messages in a mailbox).

My preference is to set up a domain without a single point of failure, so I'll register the domain with one company, get DNS at a second, and hosting at a third. e.g. purchase a domain at Rebel.ca, add it to my account at Cloudflare, and host through Cloudways. 

It's slightly more complicated than buying it all in one place, but when any one of those fails, I still have access to the others (e.g. if Rebel decides to get out of the registrar business, all I have to do is transfer my domains to another registrar, and my site carries on, or if I decide to change hosting, I just have to adjust the A and CNAME records at Cloudflare rather than learning a new host's DNS entry system). 

Comments