DNS for Beginners - What A, CNAME, MX, TXT Records Do

DNS (Domain Name System) is the system that translates domain names into IP addresses. When you type "beohosting.com" into a browser, the DNS system finds the IP address of the server where the site is located and connects you to it. Without DNS, we would have to remember numeric IP addresses for every site we want to visit. In this guide we explain the most important types of DNS records and how to configure them correctly.
How does DNS work?
Think of DNS as the phone book of the internet. When you type a domain name, your browser asks the DNS server: "What is the IP address of this domain?" The DNS server checks its records and returns an answer. This process happens in milliseconds and is completely invisible to the user. DNS records are instructions that tell DNS servers what to do with different requests - where to direct the site, where to deliver email, how to verify the domain, and much more.
A record (Address Record)
The A record is the most basic DNS record. It links a domain name to a server's IPv4 address. When someone types your domain into a browser, the A record tells where the site is located. Example: "beohosting.com" -> "185.199.108.153". You can have multiple A records for the same domain (load balancing), but the most common case is a single A record pointing to your hosting server. For subdomains you also create separate A records - for example, "blog.beohosting.com" can point to a different server than the main domain.
Example A record setup:
Name: @ (or empty - represents the main domain)
Type: A
Value: 185.199.108.153
TTL: 3600 (1 hour)
AAAA record
The AAAA record is the same as the A record, but for IPv6 addresses. IPv6 addresses are longer and look like this: "2606:4700:3033::6815:b99". As the world gradually transitions to IPv6, it's good practice to have both A and AAAA records for your domain. At BeoHosting all servers support both IPv4 and IPv6, so you can configure both records without additional cost.
CNAME record (Canonical Name)
A CNAME record is an alias - it tells one domain to point to another domain (not to an IP address). The most common example is redirecting the "www" version of a domain to the main domain. Instead of creating a separate A record for "www.beohosting.com", you create a CNAME that says: "www.beohosting.com is the same as beohosting.com". The advantage of a CNAME is that if you change the main domain's IP address, you don't have to also change the www version - it automatically follows the main domain.
Example CNAME record:
Name: www
Type: CNAME
Value: beohosting.com
TTL: 3600
An important limitation: a CNAME record cannot exist on the root domain (@ or empty). Also, if you have a CNAME for a subdomain, you cannot have other records (A, MX, TXT) for that same subdomain. This is a common mistake that leads to email or SSL certificate problems.
MX record (Mail Exchange)
The MX record tells where to deliver email for your domain. When someone sends an email to info@yourcompany.com, the MX record tells the email system which server receives mail for yourcompany.com. MX records have a priority (lower number = higher priority), which allows you to have a backup mail server in case the primary one is down.
Example MX record:
Name: @
Type: MX
Priority: 10
Value: mail.yourcompany.com
TTL: 3600
If you use hosting email, MX records usually point to your hosting server. If you use Google Workspace or Microsoft 365, you need to set MX records pointing to their servers. An error in the MX records means you won't receive emails - that's why you should always check them carefully.
TXT record (Text Record)
A TXT record stores text information for your domain. It's used for various verifications and security configurations. The three most important TXT records are SPF, DKIM, and DMARC - all related to email security. In addition, TXT records are used to verify domain ownership with services like Google Search Console, Facebook Business Manager, and similar.
SPF record example:
Name: @
Type: TXT
Value: "v=spf1 include:_spf.beohosting.com ~all"
This says only BeoHosting servers are allowed to send email on behalf of your domain.
NS record (Name Server)
The NS record specifies which DNS servers are authoritative for your domain - i.e., which servers hold all the other DNS records. When you register a domain, you set NS records that point to your hosting provider's DNS servers. For example, BeoHosting uses ns1.beohosting.com and ns2.beohosting.com. Changing NS records effectively moves management of the entire DNS to another provider, so be careful with this change.
SOA record (Start of Authority)
The SOA record contains administrative information about the DNS zone: primary name server, administrator email, zone serial number, and refresh parameters. This record is usually generated automatically and you rarely need to change it manually. The serial number increases with every zone change, signaling other DNS servers to refresh their copies.
TTL - Time to Live
TTL (Time To Live) determines how long DNS servers cache your record before re-checking the original value. Typical values are 3600 seconds (1 hour) for stable records and 300 seconds (5 minutes) when you plan changes. Low TTL means faster propagation of changes but also more DNS queries to your server. Before site migration, reduce TTL to 300 at least 24 hours in advance, so the IP address change becomes visible as quickly as possible.
Most common DNS errors and how to fix them
Error 1: CNAME on the root domain - many try to set a CNAME for @ which is not allowed. Solution: use an A record for the root domain. Error 2: Wrong MX record - if MX points to an IP instead of a hostname, email won't work. MX must point to a server name, never to an IP. Error 3: Missing SPF - without an SPF record, your emails will likely end up in spam. Error 4: High TTL before migration - reduce TTL before changing servers to avoid long downtime. Error 5: Duplicate records - two A records for the same domain with different IP addresses lead to unpredictable behavior.
How to check DNS records
Use online tools like DNSChecker.org, MXToolbox.com, or our DNS checker to verify DNS records. On Linux and macOS you can use the "dig" and "nslookup" commands in the terminal. For example: "dig beohosting.com A" shows A records for the domain. To check MX records: "dig beohosting.com MX". These tools are invaluable for diagnosing DNS problems.
Conclusion
DNS records may seem complicated at first glance, but they are actually simple once you understand what each type does. The A record points to the server, CNAME is an alias, MX directs email, and TXT stores verifications and security policies. At BeoHosting, DNS records are configured through an intuitive cPanel interface, and our technical support team is there to help if you get stuck. Properly configured DNS records are the foundation of how your site and email work.
BeoHosting Team
10+ years of experience — Web hosting and infrastructure specialists
- Web Hosting
- WordPress Hosting
- VPS
- Dedicated Serveri
- Domeni
- SSL
- cPanel
- LiteSpeed
- Linux administracija
- DNS
Last updated: