So, you’ve finally built a website, got yourself a domain name, and set up hosting. You’re almost there! All that’s left to make your website go live is to configure your DNS settings. You may have received an email from your hosting provider asking you to set up certain DNS records. All those abbreviations (A, CNAME, MX, TXT etc.) and technical terms (TTL, name server, propagation) may seem confusing at first. But don’t worry, DNS records are not as complicated as they sound.
In this guide, we’ll break down the different types of DNS records, what they do, and why your website needs them to function properly. Whether you need to point your domain to a web server, set up email services, or verify domain ownership, you will find all the answers here!
Table of Contents
What is DNS and why does it matter?
Before we take a deep dive into DNS records, let’s take a quick step back to understand what DNS actually does.
Understanding the role of DNS
DNS (Domain Name System) is like the internet’s phonebook. It is a specialized system that translates human-friendly domain names (like yoursite.com) into IP addresses (like 172.213.222.111) that computers use to identify websites. Without DNS, your visitors would have to remember your server’s IP address just to access your site.
With DNS, the process is made simple. Every time someone enters your website’s domain into a browser, DNS works in the background to find the right server and load the website. This whole translation happens in milliseconds, leading to a seamless online experience for all.
Want to learn more about how DNS works? Check out our in-depth guide on What is DNS.
Why DNS records are important
DNS records are the instructions that tell the internet/DNS how to handle your domain. Here’s why they matter:
- DNS records are used to direct visitors to the correct server that’s hosting your website.
- They are also used for routing emails to the right inbox.
- Certain DNS records, when properly configured, can protect against email spoofing and phishing attacks.
- You can also use them to set up subdomains and point them to different locations.
- Some DNS configurations distribute traffic across multiple servers to improve speed and reliability.
- They also make the domain transfer process work without downtime. If you update your DNS records to match the new hosting provider before the transfer is complete, your website and emails will continue working without interruption.
But which DNS record is responsible for each of these important functions? Let’s break it down in the next section.
Common types of DNS records and their functions
Below are some of the most common DNS records and what they do.
A record (Address record)
The A record maps a domain name to an IPv4 address. It is what directs visitors to the correct web server when they type your domain in a browser.
Example:
yoursite.com. 3600 IN A 192.168.1.1
In this example, yoursite.com points to the IP address 192.168.1.1 with a TTL (Time to Live) of 3600 seconds.
AAAA record (IPv6 address record)
Similar to the A record, but it maps a domain to an IPv6 address instead of IPv4.
Example:
yoursite.com. 3600 IN AAAA 2001:db8::ff00:42:8329
This record ensures that websites can be accessed via IPv6 networks. IPv6 is a newer version of IP that allows more devices to connect to the internet since IPv4 addresses are running out. If your hosting provider supports IPv6, don’t skip configuring this record as it ensures broader accessibility for your website.
CNAME record (Canonical name record)
A CNAME record is used to alias one domain name to another. This is common for subdomains or when pointing multiple domains to the same server.
Example:
www.yoursite.com. 3600 IN CNAME yoursite.com.
This means www.yoursite.com will load the same content as yoursite.com.
MX record (Mail exchange record)
MX records tell mail servers where to deliver emails sent to your domain.
Example:
yoursite.com. 3600 IN MX 10 mail.yoursite.com.
The number 10 represents the priority of the mail server. Lower numbers have higher priority.
TXT record (Text record)
TXT records store text-based information, often for verification and security purposes. They can be used for domain ownership verification, email security, or other purposes.
Example:
yoursite.com. 3600 IN TXT “google-site-verification=abc123def456”
This TXT record is used to verify domain ownership with Google services.
SPF record (Sender policy framework record)
SPF records help prevent email spoofing. While creating one, you specify the mail servers that are authorized to send emails on behalf of your domain.
Example:
yoursite.com. 3600 IN TXT “v=spf1 include:_spf.google.com ~all”
This SPF record tells receiving mail servers to accept emails only from Google’s mail servers for yoursite.com.
NS record (Name server record)
NS records define which name servers are authoritative for a domain. These servers store and manage your DNS records.
Example:
yoursite.com. 3600 IN NS ns1.exampledns.com.
yoursite.com. 3600 IN NS ns2.exampledns.com.
This means that ns1.exampledns.com and ns2.exampledns.com handle the DNS for yoursite.com.
PTR record (Pointer record)
Used for reverse DNS lookups, PTR records map an IP address back to a domain name. They are often used for email authentication.
Example:
2.2.178.193.in-addr.arpa. 3600 IN PTR yoursite.com.
This maps 193.178.2.2 to yoursite.com.
SRV record (Service record)
SRV records specify the location (hostname and port) of servers for specific services, such as VoIP or chat applications.
Example:
_service._protocol.yoursite.com. 3600 IN SRV 10 5 5060 sip.yoursite.com.
This SRV record directs SIP (VoIP) traffic to sip.yoursite.com on port 5060.
SOA record (Start of authority record)
The SOA record contains important information about a domain’s DNS zone, including the primary name server, the domain administrator’s email, and timing values for DNS updates.
Example:
yoursite.com 900 SOA ns1.yoursite.com. admin.yoursite.com. (
25
6000
4000
90000
500
)
This SOA record defines key settings for the DNS zone of yoursite.com. It includes the primary name server (ns1.yoursite.com), the contact email (admin.yoursite.com), and values that control how often DNS information is refreshed, retried, or expires.
How to Manage DNS Records (Step-by-Step Guide)
Once you know where to look and what to do, DNS record management is actually quite straightforward. Let’s go through the key steps of adding, changing, and exporting DNS records.
How to add a DNS record
- Log into your client area on your hosting provider’s website.
- Look for a section called “DNS Management,” “Manage DNS,” “DNS Zone Editor,” or “Name Server Settings.”
- Click “Add Record” and select the appropriate record type (A, CNAME, MX, etc.). Here’s a screenshot of how the HOSTAFRICA DNS Manager interface looks like:
- Fill in the hostname, value (IP address, domain, or other data), TTL (Time to Live), and other required details.
- Click “Save” or “Confirm” to apply the new DNS entry.
- Wait for the DNS propagation to complete. It can take up to 48 hours.
How to change DNS records
-
Log into your client area on your hosting provider’s website.
-
Look for a section called “DNS Management,” “Manage DNS,” “DNS Zone Editor,” or “Name Server Settings.”
-
Locate the specific DNS record you need to change.
-
Click the “Edit” or “Modify” option and update the necessary fields, such as the IP address or destination.
-
Confirm and save your modifications.
-
That’s it. Depending on the TTL setting, the changes should take effect after a short period.
How to export DNS records
- Log into your client area on your hosting provider’s website.
- Look for a section called “DNS Management,” “Manage DNS,” “DNS Zone Editor,” or “Name Server Settings.”
- Search for an export option. Some providers have an “Export DNS” or “Download Zone File” button. For example, from the HOSTAFRICA client area, you can export a DNS Zone by selecting this option on the DNS manager screen:
- Download the file. it would either be a .txt or .csv file that contains all your DNS records.
- In case a file download option isn’t available, you would have to copy the records manually.
Where are DNS records stored?
DNS records are stored in a DNS zone file, which is hosted on authoritative name servers. These name servers are managed by your domain registrar, web hosting provider, or a third-party DNS service like Cloudflare or Google Public DNS.
How long does it take for DNS records to update/propagate?
DNS record updates can take anywhere from a few minutes to 48 hours to fully propagate across the internet. The exact time depends on several factors, including:
- TTL (Time to Live) settings: Lower TTL values make updates happen faster, while higher TTL values cause longer delays.
- ISP caching: Internet Service Providers (ISPs) cache DNS records, and some take longer to refresh their caches.
- DNS server hierarchy: Changes need to spread across multiple DNS servers worldwide, which can take time.
- Domain registrar and hosting provider: Some registrars and hosting services process DNS changes faster than others.
- Type of DNS record: Records that depend on multiple servers (like NS or MX records) update slower than those (A, CNAME) that don’t.
How to read DNS records (DNS lookup tools)
You’d sometimes need to read DNS records for troubleshooting, verifying configurations, or simply understanding how your domain is set up. Let’s explore common ways to do that.
Checking DNS records using WHOIS
WHOIS is a tool that retrieves domain registration details, including name servers and some DNS information. Many domain registrars and online WHOIS lookup tools let you check this data. For example, here’s a WHOIS lookup performed on google.com:
Using nslookup and dig commands
For more technical users, command-line tools like nslookup and dig are powerful ways to query DNS records.
Using nslookup
- Open your command prompt (Windows) or terminal (macOS/Linux).
- Type nslookup followed by the domain name. For example:
nslookup google.com
- To check specific record types, use:
nslookup -type=mx google.com
This will show the MX records for google.com. Expect an output like this:
Server: UnKnown
Address: 192.168.100.1
Non-authoritative answer:
google.com MX preference = 10, mail exchanger = smtp.google.com
Using dig
- Open your terminal (macOS/Linux).
- Type dig followed by the domain name. For example:
dig example.com
Expect an output like this:
; <<>> DiG 9.16.23-RH <<>> example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60255
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1220
; COOKIE: f2a3ebf7c43ff315d766aacd67ca70336533108497d3ad38 (good)
;; QUESTION SECTION:
;example.com. IN A
;; ANSWER SECTION:
example.com. 120 IN A 96.7.128.198
example.com. 120 IN A 23.192.228.80
example.com. 120 IN A 23.192.228.84
example.com. 120 IN A 23.215.0.136
example.com. 120 IN A 23.215.0.138
example.com. 120 IN A 96.7.128.175
;; Query time: 10 msec
;; SERVER: 192.168.100.1#53(192.168.100.1)
;; WHEN: Thu Mar 06 23:04:03 EST 2025
;; MSG SIZE rcvd: 164
- To check specific record types, use:
dig example.com A
This will display the A records for example.com:
Online DNS checkers (intodns.com, MXToolbox, etc.)
You can also use online tools like IntoDNS and MXToolbox to check DNS records. They provide detailed reports on DNS configurations, email settings, and possible issues. Simply visit the website, enter the domain name in the text box, and hit Enter.
Here’s how a DNS lookup for google.com looks like on IntoDNS:
Conclusion
As a website owner, it’s important to understand what DNS records are and how they work. You can use them to control how your domain connects to websites, email services, and other online platforms.
If you’re looking for a platform that simplifies the process of managing DNS settings, check out our domain management and hosting services today!