Beginner's Guide to DNS and Nameservers
If you’ve ever worked with a domain name, web hosting account, or website, chances are that you’ve had to work with DNS and nameservers. Simply put, DNS and nameservers are systems that connect your domain name to your website and email.
In this article, we’ll take a closer look at both these concepts and help you better understand them so as to avoid common pitfalls and mistakes.
- What is DNS?
- What is a Domain Name, anyhow?
- What are Nameservers?
- What are DNS Zones and Resource Records?
- What is DNS Propagation?
- DNS Resolution Steps
- Common DNS Problems & Solutions
- Discover Web Hosting Canada’s DNS
- Useful Tools & Final Thoughts
What is DNS?
By “mapping” a domain name to a specific IP address with the help of DNS and nameservers, you’re helping visitors access your online content, which includes your website and email.
Sounds simple, right? Well, it can get tricky, fast! DNS is actually one of the most misunderstood parts of how websites and domains work, and can lead to problems or errors with your website and email if used incorrectly.
What is a Domain Name, anyhow?
Domain names like google.com and whc.ca are online addresses, used to access websites for business, news sources and whatever other treasures (or oddities!) the Internet holds.
Technically, a domain name is a string of characters that can be translated into an electronic address (called an Internet Protocol, or IP, address) by computer systems connected to the Internet, thanks to -- you guessed it -- DNS.
Available domain names can be registered for a modest yearly fee through a domain name registration provider (called a registrar) such as Web Hosting Canada, and can be renewed indefinitely.
The registrar will ensure your domain is correctly registered with the organization (called the registry) that manages the Top Level Domain (or TLD) you chose to use. Examples of popular TLDs include .CA (managed by CIRA), .COM (managed by Verisign) and .QUEBEC (managed by Registre Point Québec).
Since each registry sets and manages its own pricing, the cost of the domain registration can vary depending on the TLD you choose and generally ranges between $10-$30 per year, with some niche TLDs costing substantially more. .LUXURY domains, for example, cost a whopping 699$ for the first year of registration!
What are Nameservers?
Nameservers are the address books of the Internet and a critical part of what makes DNS work.
Just like your personal address book may contain the address and phone number of your friends Mike, Sue, and James, nameservers will contain website and email routing information for domain names like mikespizza.ca, sueshop.com, and jamesco.net
Unlike the address book you may have at home, nameservers are fully electronic and are generally managed by service providers such as WHC, Google, or Amazon. Each nameserver can contain information for multiple domains (sometimes even millions of them).
In order to function properly, each domain name must define its authoritative nameservers (these are the nameservers that are actively being used according to the registry). These nameservers will answer the question: who should I ask to find out where my website or email is hosted?
For example, new domain names registered with WHC will usually set the following authoritative nameservers by default:
The set of information each nameserver holds for a specific domain name is called a DNS zone, and a zone may contain multiple resource records, including one to identify where your website is hosted and another for where your email is hosted.
What are DNS Zones and Resource Records?
A DNS zone is a set of DNS information about a specific domain name.
Going back to our address book example, you can think of a zone as all the information you have recorded for your friend Mike. For example, you’ll have his home address, his mobile phone, and his email address. Each distinct piece of information, such as his mobile phone, can be considered a resource record.
Online, DNS zones and resource records help answer questions such as:
- Where is this domain’s website hosted?
- Which email server (or provider) handles this domain’s incoming emails?
There are a number of different types of DNS resource records, but we’re going to focus on two of the most commonly used records:
- A Record: this is the main and most important resource record in your domain’s DNS zone. The “A” stands for address and this record will contain the IP address of the device hosting your main website.
Example of an A Record:
- MX records are mail exchange records and will contain a hostname. They define which mail servers handle incoming emails to your domain. If you want to be able to receive email from an address using your domain name, you’ll need to have properly configured MX records.
Example of an MX Record:
There are dozens of other DNS resource record types available, including CNAME and TXT records, which are sometimes used with hosting accounts to establish domain ownership, or to enhance email security, but we’ll save those geeky technical details for a later article.
How can I change my domain’s DNS Resource Records?
You may occasionally need to change your domain’s DNS resource records.
Common reasons for changing DNS records include pointing your website to a specialized service provider (like a website builder or third party e-commerce platform) or switching your email service provider (to Microsoft 365 or G Suite, for example).
How you can execute this change will depend on how your domain and DNS are set up. In most cases, you’ll connect to your domain name or hosting provider’s client portal, look for a zone or DNS editor, and then fill out the new resource record information as instructed by your new service provider.
If your domain is registered with Web Hosting Canada, consult How to change DNS Records with the Zone Editor for step-by-step instructions.
What is DNS Propagation?
DNS propagation is the process through which changes to DNS records or nameservers take effect on all networks around the world. It usually involves a delay that can vary from a few seconds to a few hours, depending on where you are in the world and how your Internet-enabled device is configured.
In short, when changing a DNS record, don’t expect instant results all over the world. The process often takes several hours to propagate everywhere and in some cases can take over 24 hours, because of how some DNS services memorize (or cache) DNS records.
The propagation process can be accelerated by reducing a setting on your DNS records called the Time to Live (or TTL), at least a day in advance of making your changes. This setting provides a suggestion for how long other secondary DNS services should save old entries, so reducing it increases your chances of applying the changes faster. Unfortunately, not all DNS services interpret TTL values the same way, so specific results can’t be guaranteed.
TTL is defined in seconds, so common values are 3600 (1 hour), 86400 (1 day), or 60 (1 minute). Setting this value to 60 at least one day before your DNS change can help reduce DNS propagation delays. Setting it back to 3600 or 86400 once your change has finished propagating is also recommended, in order to reduce the number of requests handled by your authoritative DNS service.
DNS Resolution Steps
Now that you understand the basic components of DNS, let’s see how a DNS request gets handled from the moment you type in a website address in your browser’s address bar to the moment its content is displayed on your screen. We'll work with "example.ca" as the domain name:
- Is the website "example.ca" available in your browser’s cache (memory)? If so, instantly display it; otherwise proceed to next step
- Is the website’s DNS information available in your computer or router’s cache (memory)? If so, use it to obtain the website’s IP and proceed to the last step
- The DNS resolution process begins:
- Query your primary DNS resolver (its location is defined on your device’s operating system) for the the domain’s IP address (found within its DNS A Record). The DNS resolver service is often provided by your Internet Service Provider (Bell, Telus, Vidéotron, etc)
- Is the domain’s IP already cached (memorized) inside your primary DNS resolver? If so, return the website’s IP and proceed to the last step.
- Query the Internet’s root servers to obtain the TLD name server responsible for .CA TLD
- Query one of .CA TLD’s nameservers to obtain this specific domain’s nameserver
- Query one of the domain’s nameservers to obtain the specific domain’s IP address
- We finally have the IP address of the website we’re trying to reach! The DNS part of this process has completed successfully. The DNS information may now be cached (memorized) in multiple locations, including your browser, operating system, router, ISP’s resolvers, and other recursive nameservers, for a duration equal to or shorter than the record’s TTL.
- Connect to the IP address of the web server, and obtain the website content, then display it on the screen. The website content may also now be cached (memorized) by your browser for faster load times in the future.
Common DNS Problems & Solutions
Here are some common DNS-related issues:
Changes to my DNS still haven’t taken effect over 24 hours later
This may occur for several reasons:
- You made the change on a nameserver that isn’t authoritative
This means you’ve made these changes in the wrong place. You’ll need to find out what your authoritative nameservers are, usually by inspecting the results of a whois or dig query, then make your DNS changes in the correct place.
- You made an error in your DNS record
Double-check the exact value/syntax you used in your DNS record, using tools like intoDNS or DNS validator. A small error such as an extra period or space can cause problems. You may also have indicated the wrong IP address in your A Record.
- You’re seeing a stale (cached) version of your page
Try clearing your browser’s cache and flushing your operating system’s DNS cache.
My domain is no longer working or responding to DNS requests
This could mean that:
- You have set the wrong nameservers for your domain name
Double-check which nameservers you should be using with your domain name and hosting provider, and update your nameservers to the ones recommended by your provider. Contact their support team if you are unsure.
- Your domain name is expired or disabled
Inspect its whois output and consider renewing your domain ASAP. If it’s suspended, contact your domain name provider to find out why. Oftentimes, a domain name can get temporarily disabled if changes were made to its administrative email contacts that were not validated within 2 weeks.
- Your DNS service might be offline, unreachable, or otherwise malfunctioning
Verify the status of your DNS service using tools such as intoDNS or DNS validator, and contact your DNS service provider for assistance if you see errors.
Discover Web Hosting Canada’s DNS
Web Hosting Canada provides reliable, secure, and high-performing DNS service along with 24/7 expert support with all its hosting services.
Basic DNS provides redundant DNS service from multiple Canadian locations, and includes a DNS zone editor to help you easily change your DNS settings, as often as necessary, with low TTL support. It’s included with all of WHC’s hosting and domain name services.
Premium DNS improves the basic offering by distributing the DNS service to multiple locations around the world through Anycast technology, effectively improving its performance and routing, in addition to other security enhancements. It’s included with the Pro and Enterprise hosting plans, and can be ordered as a standalone service.
Useful Tools & Final Thoughts
To help better troubleshoot and explore DNS issues, we’ve compiled some of our favorite DNS tools below:
- Whois.net and RDAP Lookup : useful WHOIS tool, for basic domain information
- IntoDNS: DNS health reports
- DNS validator: alternative to intoDNS
- Dig Web Interface: an online version of the powerful dig Linux tool
- Whatsmydns.net: Global DNS Propagation checker
- DNSDumpster.com: DNS research & recon
Hopefully this article has taught you, or clarified, a few things about DNS.
As a rule of thumb, avoid making DNS changes that you are unsure of, and consider checking with your website/email administrator or hosting provider before any major changes.
DNS remains a relatively complex (and oftentimes confusing) topic that can take considerable time to master. The Internet is full of excellent resources describing the inner workings of DNS in various levels of detail. That being said, unless you’re working in IT, we’ll understand if you decide you know enough about DNS as-is. After all, that’s why you trust experts with this stuff!
Also on the WHC Blog
New SSL Certificates now have a Maximum 1-Year Duration
Effective August 1, in order to increase the security and reliability of certificates, new or renewed SSL certificates now have a maximum duration of 1 year. If you have an upcoming SSL renewal for 2+ years, we’ve automatically...Read full article
We’re moving to a new office!
As our team continues to grow, we’re moving to a bigger office by August 1! Here’s our new office address: 7250 Clark Street, #301 Montreal, Quebec H2R 2Y3 Located just minutes away from Jean Talon market,...Read full article
How can we help?
Our friendly customer service team is available right now.