DNS is what makes it so that we don’t have to remember IP addresses like they are phone numbers. This Knowledgebase article is a detailed overview of the Internet’s Domain Name System, covering technical and theoretical aspects behind how domain names work.
What is a domain name?
A domain name consists of two or more parts, technically they are called labels, separated by a dot. For example, chemicloud.com.
The right-most label (the part after the dot) specifies the top-level domain.
Each label to the left specifies a subdivision or subdomain of the domain above it. Note that “subdomain” expresses relative dependence, but it’s not absolute. For example, chemicloud.com comprises the subdomain of the net domain, and www.chemicloud.com comprises a subdomain of the domain chemicloud.com.
In theory, this subdivision can reach 127 levels deep and each label can contain up to 63 characters, as long as the whole domain doesn’t exceed a total length of 255 characters.
In the real world though, most registrars have shorter limits.
A hostname refers to a domain name that has one or more IP addresses associated with it. For example, lab.chemicloud.com is a hostname.
What is DNS?
The DNS, or Domain Name System, consists of a hierarchical set of DNS Servers. Each domain or subdomain has more authoritative DNS servers which publish information about that domain and the nameservers of any domains “beneath it”. The hierarchy of authoritative DNS servers matches the hierarchy of domains.
At the top of the hierarchy stands the root nameservers, the servers which are queried when looking up, or ‘resolving’, a top-level domain name (TLD).
A major component of DNS is iterative and recursive queries.
- An iterative query is one where the DNS server may provide a partial answer to the query (or give an error). DNS servers must support non-recursive queries.
- A recursive query is one where the DNS server will fully answer the query, or give an error. DNS servers are not required to support recursive queries and both the resolver, or another DNS server acting recursively on behalf of another resolver, negotiate the use of recursive services using bits in the query headers.
What is DNS Propagation?
DNS Propagation refers to the time for any change to DNS records to transmit across the Internet. Remember that DNS changes can take up to 24 hours to fully propagate. Here’s a great online tool to check on DNS propagation.
Struggling with DNS issues? ChemiCloud is the hosting solution designed to save you time! 🤓 Check out our web hosting plans!
All About DNS Records
The root domain, also sometimes referred to as the parent, naked, or apex domain is the primary entry point for the domain without any subdomains. The NAME field typically remains blank as this would define a subdomain.
This type of record should usually be an A record with the value set to the destination IP address. Using a CNAME for the root domain can cause other DNS functions, such as MX records, to route incorrectly.
It is standard practice to set the A record for the root domain to that of the www subdomain.
CNAME or “Canonical Name”
CNAME Records are used to define an alias hostname. A CNAME record takes this format:
alias.domain.name IN CNAME otherhost.domain.name.
This defines alias.domain.name as an alias for the host whose canonical (standard) name is otherhost.domain.name.
An A record gives you the IP address of a domain. That way users who try to go to www.example.com will get to the right IP address. An A record or Address Record maps a host name to a 32-bit IPv4 Address. An A record takes this format:
Name TTL TYPE DATA ftp.domain.com 43200 A IP Address
Some DNS zones include a wildcard entry, which looks like this:
*.domain.com IN A xxx.xxx.xxx.xxx
The X represents a particular IP address. The * takes anything that comes before the domain, like myawesomesoup.domain.com, or pullmyfinger.domain.com and points it to the server’s IP address. This way, if someone mistakenly types too many or too few www’s, they still get to your website.
Using a wildcard entry is also useful when setting up subdomains in your hosting account, relieving you of the duty of adding additional A records for each subdomain.
These are also known as Mail Exchange Records. They map a domain name to a list of all mail exchange servers for that domain. A zone can have one or more Mail Exchange (MX) Records. These records point to hosts that accept mail messages on behalf o the host. A host can be a Mail Exchange for itself. MX Records don’t need to point to a host in the same zone, either.
An MX Record takes this format:
host.domain.name IN MX 10 otherhost.domain.name. IN MX 20 otherhost2.domain.name.
The MX preference numbers, which can be set from 0 to 65535, signify the order in which mailers select MX records when they attempt mail delivery to the host. The lower the M number, the higher the host is in priority.
PTR Record (AKA Pointer Records)
These map an IPv4 Address to the canonical name for that host. Setting up a PTR record for a hostname in the in.addr.arpa.domain that corresponds to an IP address implements reverse DNS lookup for that address.
NS Records (AKA Name Server Records)
These map a domain name to a list of DNS servers that are authoritative for that domain. For instance, some name servers that belong to Cloudflare:
SOA Record (AKA Start of Authority Record)
This specifies the DNS server providing authoritative information about an Internet domain, the email of the domain administrator, the domain serial number, and several timers relating to refreshing the zone.
The TXT Record allows a domain or DNS administrator to insert arbitrary text into a DNS Record. For example, this can be used to implement the Sender Policy Framework (SPF) and DomainKeys DNS records.
That’s a wrap!