DNS, short for Domain Name System, is one of the most common yet misunderstood components of the web landscape. To put it simply, DNS helps direct traffic on the Internet by connecting domain names with actual web servers. Essentially, it takes a human-friendly request – a domain name like example.com – and translates it into a computer-friendly server IP address – like 184.108.40.206.
Because DNS is all about looking up addresses and connecting devices, many people call DNS the “phonebook of the Internet”. Without DNS, you’d have to memorize every site’s IP address to access it which…well, that just wouldn’t work!
- How Does DNS Work?
- DNS Propagation
- DNS Configuration – How to Set up Your Domain
- Free DNS vs Premium DNS
When a user enters a URL in their web browser, DNS gets to work to connect that URL to the IP address of the actual server. This is called DNS name resolution and involves a DNS recursor querying various nameservers to figure out the actual IP address of a server.
DNS is primarily concerned with four components:
Let’s talk about these four components and how they work together.
A domain registrar is the service provider where domain names are purchased and where domain registration is maintained (such as Movup or Enom).
The registrar is where the domain nameservers are specified.
Most registrars include basic DNS service with the cost of domain registration. As a result, unless you add custom nameservers to the domain, the domain will use the registrar’s standard nameservers. This means that in the vast majority of cases, by default, DNS records are managed by the registrar.
Nameservers are servers much like web servers. However, they are configured to store DNS records rather than to serve up websites or web applications.
This means that when you want to change any DNS record you must change those DNS records on the nameservers that have been specified by the registrar or third-party service such as Cloudflare.
This step is often a little confusing, so let’s break this down a little bit by looking at a fictional example:
- Your domain (example.com) is registered at Movup.
- You add Cloudflare’s nameservers to example.com within your Movup account to start using Cloudflare.
- You change a DNS record for example.com at Movup. This change will not do anything because the domain is not using Movup’s nameservers.
- You make the same DNS change for example.com at Cloudflare. This change will be effective because the domain is using Cloudflare’s nameservers.
So in other words, if you are only using Movup, you will need to update your DNS records with Movupas they control your nameservers. If you are using Cloudflare, you will need to update your DNS records with Cloudflare as they control your nameservers. The same goes for those using Movup DNS.
DNS records associate a domain with a web-based service.
There are several different types of DNS records, but in most cases, only 4 or 5 types of DNS records are used:
- A records: Used to point a domain or a subdomain at an IPv4 address. This is the rule used to point a domain like example.com to the web server where the example.com website lives. (Note: If a web server uses and IPv6 address rather than an IPv4 address, then an AAAA record is used rather than an A record).
- CNAME records: Used to associate a subdomain to the primary or canonical domain. This type of rule is commonly used to associate a www subdomain with the primary domain, such as www.example.com with example.com.
- MX records: Used to associate a domain with an email service. This is the type of rule used if you want mail for example.com to be delivered to a specific email service such as Gmail.
- TXT records: Used to associate any arbitrary text to a domain. Most commonly, TXT records are used to associate SPF records with a domain to improve email deliverability and protect against spammers misusing the domain name when sending out spam. Check out our in-depth blog post on email authentication and why it’s important.
In our case, the web service is website hosting. An A record (or AAAA record) must be added to a domain’s nameservers to associate that domain with the web servers that host the website.
There are many other types of web services that are associated with a domain through DNS records: email, SFTP, hosting control panels, webmail applications, and phpMyAdmin just to name a few.
When you make a change to the DNS of a given domain – such as updating a DNS record or switching nameservers – those changes take some time to take effect. This time is called propagation.
Propagation varies considerably from one situation to the next.
In the case of DNS records, each record has an associated time-to-live (TTL) value. This value determines how quickly changes to DNS records will take effect.
In most cases, TTL for DNS records is set to 1 or 4 hours by default. This means that most of the time DNS changes will take as much as 4 hours to take effect. Higher TTL values are also possible and will mean that when a DNS record is updated that it will take more time before the changes take full effect. In some extreme cases, some might have TTL values as high as one week.
In the case of nameservers, the registrar determines the TTL value and it generally cannot be changed. This means that when you switch to new nameservers it can take from a few minutes up to a day or longer for those changes to take effect.