What is DNS?
When you want content to be served to the public on the internet, it must live on a physical device somewhere to serve the clients - a “server”. Computers are best equipped to communicate using the Internet Protocol, and these devices each have their own Internet Protocol address – IP addresses – that they use to locate one another.
There are a few problems with this as a human end-user, including the following:
- Sometimes, a web service must move onto a different server or be split onto multiple servers at once. It thus becomes impossible to have a service associated with just one IP address.
- IP addresses are cryptic. Modern IP addresses can be as long as 16 digits long and contain numbers and characters that appear random to people. It would be impractical if not impossible for people to maintain a list of IP addresses to find what they need on the web.
The Domain Name System (DNS) solves these problems. DNS is a system that allows people to use a “domain name” – a human readable text label such as “google.ca” or “fullhost.com” to direct web traffic wherever. It is both a broad network of devices across the world as well as a protocol that devices abide by to take these domain names and retrieve the IP address of a target device.
What is a Domain? Subdomain? Top-level domain?
A domain, in a way, represents a virtual space on the internet. These virtual spaces, unlike physical spaces, are bound by text labels rather than physical boundaries.
Here is an example of a domain name: “www.fullhost.com”. Each period in a domain separates each level of the domain as a whole – www is a subdomain of fullhost.com – it is a space within fullhost.com. Likewise, fullhost.com is a subdomain of .com: the top-level domain. In addition, people often say that there is an implicit ‘.’ at the end of each domain in addition to what you see, representing the existence of the root domain level.
Top level domains (TLDs) are special. You register domains under top-level domains such as .com, .net, .org, .ca, etc. There are hundreds of TLDs to choose from these days, although you will likely only see a handful of them.
TLDs are managed by various organizations. The largest player in this story is ICANN. To register a domain, you must contact a registrar, who has an agreement with the managing entity (like ICANN) for that top-level domain. Through a registrar, your domain can be added to one of their servers and lead traffic where you like. ICANN is responsible for the most common TLDs you’ll see including .com, .org, and .net. CIRA is responsible for .ca domains in a similar way to ICANN. Different TLDs come with different rules and conditions for registration. For example, to register a .ca domain requires that you must have a presence in Canada. Similarly, .eu domains require a relationship with Europe.
How Does a DNS Query Work? (In A Nutshell)
Suppose you wanted to access www.fullhost.com. When you type our domain name into your address bar, your device will initiate a domain name search, to find the IP address of the server hosting our website. The first stop in finding the IP address in question is the root nameserver. The root nameserver will look at the domain name you’re searching for and return the IP address of a TLD nameserver corresponding to the top-level domain. The next stop is the TLD nameserver, which will have a record of the IP address of the authoritative nameserver. The query then gets passed to the authoritative nameserver, which holds the zone file. The zone file is like a direction sign toward all your services - it holds the DNS records, in other words, the individual directions for each type of DNS query.
This is a bit of a simplification however, as there are other types of DNS servers involved. In practice there are many devices involved that act like a copy of the nameservers described above. This both reduces their workload and provides redundancy, resulting in greater speed and reliability. Because of this, there is usually a delay of a good four hours or so for any changes in your DNS records to take effect. This is because your changes need to be copied throughout the DNS infrastructure before they reach the servers that handle most real DNS queries. Regardless, the simplified story above describes how a DNS query plays out well enough for most purposes.
What Are DNS Records? Common Record Types.
DNS records are a very common source of IT troubles. This is not meant to be a guide, rather a brief overview to give you an idea of how DNS records work.
Zone files contain your individual DNS records. A DNS record is like a signpost that says, “for X, go to Y”. Here are a few record types in brief detail:
A Record – ‘A’ stands for “address” record. This links a domain name to an IP address. This is the most basic type of record. A simple website setup might not require anything more than just a single A-record to run.
CNAME Record – or “canonical name” record. This is used to direct traffic from an alias domain to the proper (“canonical”) domain name. For example, a cname record could be used to direct queries from fullhost.ca to fullhost.com.
MX Record – or “mail exchanger” record. This is to direct mail traffic to an email server, which is not necessarily the same place as your website.
TXT Record – or “text record”. This is a record type used for a diverse variety of purposes. Some important txt records we often troubleshoot are Sender Policy Framework (SPF) records, Domain-based Message Authentication, Reporting, and Conformance (DMARC) records, and DomainKeys Identified Mail (DKIM) records. These all help email recipients determine the authenticity of email – without it, your emails may be seen as having a high fraud risk and get blocked by spam filters.