What are DNS Settings? The Ultimate Guide for Beginners
Have you ever wondered how computers are able to find and load websites when you type in a domain name like wpbeginner.com? It‘s all thanks to a system called DNS or Domain Name System. DNS works behind the scenes to translate human-friendly website names into the numeric IP addresses that computers use to communicate with each other.
Think of DNS like the internet‘s phonebook. When you want to call a friend, you look up their name to get their phone number. Similarly, when you enter a URL into your web browser, DNS looks up the website‘s domain name to find its corresponding IP address. This allows your browser to contact the right web server and load the site.
In this beginner‘s guide, we‘ll dive deeper into what DNS settings are, the different types of DNS records, and how to configure them for your own website. Let‘s get started!
How DNS Works (In Simple Terms)
Every device connected to the internet, whether it‘s a computer, phone, or web server, has a unique IP address that identifies it, like 216.58.217.206. However, IP addresses are hard for people to remember. Imagine if you had to memorize a string of numbers for every website you wanted to visit!
That‘s why domain names were created. They provide a user-friendly way to access websites without needing to know their actual IP address. When you type a URL like www.wpbeginner.com into your browser, here‘s what happens behind the scenes:
Your browser sends a request to your operating system‘s DNS resolver to find the IP address for wpbeginner.com.
The resolver checks its local DNS cache to see if it already has the record. If so, it returns the IP address and the process ends here.
If the record is not found locally, the resolver sends a request to your Internet Service Provider‘s DNS recursive nameserver.
The recursive nameserver checks its own cache. If no record is found, it starts making requests to the root nameservers, followed by the TLD nameservers (.com in this case), and finally to wpbeginner.com‘s authoritative nameserver to get the IP address.
The authoritative nameserver looks up wpbeginner.com in its zone files and returns the IP address back to the recursive nameserver.
The recursive nameserver caches the record and sends it back to your DNS resolver.
The resolver caches the record and gives your browser the IP address it needs to access the website.
This entire process usually happens in milliseconds! The DNS system uses a distributed network of servers that each maintain a small portion of the massive DNS database. Spreading out this responsibility makes DNS extremely fast and resilient.
The Different Types of DNS Records
A DNS record is essentially a mapping between a domain name and an IP address or another piece of information. There are several types of records that have different functions. Let‘s go over the most common ones you‘ll encounter:
A Record
An A record, short for "Address" record, maps a domain name to an IPv4 IP address. For example:
wpbeginner.com. A 192.0.2.1This A record says that wpbeginner.com points to the IP 192.0.2.1. You would create an A record with your domain registrar to point your domain to your web hosting server. A records only support IPv4 addresses – if you need to use an IPv6 address, you‘ll want an AAAA record instead.
CNAME Record
CNAME stands for "Canonical Name". It creates an alias that points one domain to another. For instance:
www.wpbeginner.com. CNAME wpbeginner.com.With this record, anyone accessing www.wpbeginner.com will be sent to wpbeginner.com instead. The CNAME just refers to another domain though – it doesn‘t provide an IP address. The domain it points to needs its own A record. CNAMEs are frequently used to map subdomains to a main domain or point an old domain to a new one.
MX Record
MX records, meaning "Mail Exchanger", specify the mail servers responsible for accepting emails on behalf of your domain. The record contains a priority number and the domain name of the mail server:
wpbeginner.com. MX 10 mail.wpbeginner.com.The MX record above says the mail server for wpbeginner.com is at mail.wpbeginner.com. The 10 indicates this mail server‘s priority order if there are multiple records. The lower number gets priority. You need properly configured MX records to be able to send and receive emails with your custom domain.
TXT Record
TXT records allow you to add arbitrary text data to your DNS zone. Common uses include domain ownership verification, anti-spam measures like SPF and DKIM records, and security features like DMARC policies. A TXT record looks like:
wpbeginner.com. TXT "v=spf1 a mx -all"This example is an SPF record that specifies which IP addresses or servers are allowed to send email on behalf of wpbeginner.com. TXT records have become a general purpose way to add extra information to DNS for various services and protocols.
There are other types of DNS records like NS, SOA, SRV, and CAA that have more specific technical uses. But the ones we‘ve covered are the essentials that every website owner should know.
Managing Your Website‘s DNS Settings
As a website owner, you‘ll need to configure your domain‘s DNS settings whenever you:
- Sign up for a new web hosting plan and need to point your domain to the host‘s servers
- Want to use a separate email hosting provider so you can have email addresses at your domain
- Add subdomains for different parts of your site, like blog.yourdomain.com or shop.yourdomain.com
- Switch to a premium DNS service for better performance and reliability
Most domain registrars include DNS management tools that you can access through your registrar account. Look for an option called something like "DNS Management", "Name Server Settings", or "Domain Manager".
Here you‘ll be able to view and edit the DNS records for your domain. The exact interface varies between registrars, but in general you‘ll see a list of your domain‘s existing DNS records. To add a new record:
Select the record type from a dropdown menu (A, CNAME, MX, etc.)
Enter the appropriate details, like the subdomain (or @ for the root domain), TTL (time-to-live), and the IP address or domain name to point to.
Save your changes.
The new record should take effect within the TTL period, which is often 30 minutes to a few hours. But it can take up to 48 hours due to DNS propagation, which is the time it takes for DNS changes to update throughout the entire internet.
Some of the most popular domain registrars with robust DNS management are:
- Domain.com
- Namecheap
- Google Domains
- GoDaddy
- Hover
Many web hosting companies also provide DNS services that you can use instead of your registrar‘s default nameservers. For example, Bluehost and HostGator both have their own DNS management built into their hosting control panels.
The advantage of using your web host‘s nameservers is that they can automatically configure the DNS records needed to associate your domain with your hosting account. This saves you the trouble of having to manually update your A records and CNAME records to point to your hosting server‘s IP address.
To change your domain to use your web host‘s nameservers:
Login to your hosting account and navigate to the DNS settings.
Look for your web host‘s nameserver addresses. There should be at least two, like ns1.example.com and ns2.example.com.
Login to your domain registrar‘s control panel and find the option to set the nameservers for your domain.
Enter your web host‘s nameserver addresses and save the changes.
After updating your nameservers, it can take 24-48 hours for the switch to fully propagate across the internet. During this time, your website may be intermittently unavailable.
In general, it‘s best to use your registrar‘s DNS if you just need a simple setup to point your main domain to your web host. Use your web hosting company‘s DNS if you want them to handle the more technical aspects for you. Or, use a premium DNS provider for the best performance and advanced features, which we‘ll discuss next.
Premium DNS Providers
For most websites, the free DNS provided by your domain registrar or web host will work just fine. However, some sites may benefit from using a premium DNS service instead.
Premium DNS providers focus solely on DNS, so they tend to have much faster lookup speeds and near 100% uptime compared to a registrar‘s default nameservers. They accomplish this with anycast routing, which means they have dozens of nameservers located around the world. When a visitor requests your site, they get routed to the closest physical nameserver to their location.
That geographic distance makes a difference in how fast the DNS lookup occurs. With strategically placed nameservers across the globe, premium DNS can shave vital milliseconds off your site‘s total loading time.
In addition to raw speed, premium DNS services usually come with other benefits like:
- Better security through DNS firewalls, DDoS mitigation, DNSSEC support, and real-time threat intelligence.
- More precise traffic routing with geolocation load balancing and active failover protection.
- Deeper insights from real-time logs and analytics on your DNS traffic and performance.
- Higher query limits and more advanced record types for greater scalability and configuration options.
- Expert 24/7 customer support to quickly resolve any DNS issues that could impact your site.
Of course, those premium features come at a price. Most premium DNS providers charge based on the monthly query volume. For example, DNSMadeEasy starts at $5/month for up to 500,000 queries. That should be plenty for small to medium websites, but high traffic sites can easily exceed that.
Still, even at a higher price point, premium DNS can be a smart investment for mission-critical websites that can‘t afford any downtime or performance issues. Ecommerce stores, SaaS apps, publishing sites, and other online businesses may find that the benefits of premium DNS are well worth the added cost.
Some of the top premium DNS providers to consider are:
- Amazon Route 53
- Cloudflare
- DNSMadeEasy
- NS1
- Dyn
- Google Cloud DNS
DNS Best Practices & Common Issues
No matter which type of DNS provider you use, there are some best practices you should follow to keep your site running smoothly:
Don‘t set your TTLs too high. The TTL indicates how long a DNS record should be cached by a recursive nameserver. Setting it too high means it will take longer for changes to propagate. A good range is 30-60 minutes for most records.
Use low TTLs if you‘re planning to migrate your site. In the days leading up to a major change like switching web hosts, update your TTLs to 5 minutes. This ensures that when you update your records to point to the new host, it will take effect quickly. Then you can raise the TTLs back to normal once the migration is complete.
Make sure your NS records match at your registrar and nameservers. Your nameservers‘ NS records need to be authoritative and your registrar needs to use those same nameservers. If not, you could run into a "lame delegation" issue.
Create both www and non-www versions of your domain. Set up your DNS so that both yourdomain.com and www.yourdomain.com work. You can redirect one to the other, but make sure both addresses are accessible.
Enable DNSSEC (Domain Name System Security Extensions) if your DNS provider supports it. DNSSEC adds a layer of authentication to prove that DNS responses are legitimate and not tampered with by attackers.
Audit your DNS records regularly. Use a tool like MxToolbox or DNSstuff to periodically check your DNS health and configurations. Look for incorrect, outdated, or missing records that could cause problems.
Following these DNS best practices will help you avoid common DNS issues like:
- DNS propagation delays – when DNS changes take a long time to update everywhere, usually due to high TTLs.
- Incorrect DNS records – mistakes in your DNS configuration, like typos in IP addresses or forgetting to update old records.
- DNS spoofing – a type of attack where fake DNS responses are sent to redirect traffic to a malicious site.
- DNS cache poisoning – when attackers insert fraudulent records into a nameserver‘s cache to divert requests.
- Lame delegation – when NS records are out of sync between a parent and child domain, breaking the chain of authority.
While DNS problems can certainly cause headaches, the good news is that most are easily resolved by carefully checking your records and configurations. And by choosing a reliable DNS hosting provider, you can minimize the risk of running into issues in the first place.
DNS Settings Key Takeaways
DNS might seem complicated at first, but it plays a crucial role in keeping the internet running smoothly. As a website owner, understanding the basics of how DNS works and the different types of records can save you a lot of trouble when it comes to managing your domain.
The key things to remember are:
DNS translates domain names into IP addresses so that computers can find and load websites.
The main DNS record types are A records for IP addresses, CNAME records for domain aliases, MX records for email, and TXT records for added security.
You can manage your domain‘s DNS settings through your domain registrar, web hosting provider, or a premium DNS service.
Premium DNS can offer faster speeds, better security, and advanced features compared to free DNS from registrars.
Use DNS best practices like low TTLs, enabling DNSSEC, and keeping your records updated to avoid common DNS issues.
Armed with this DNS knowledge, you‘ll be well-equipped to handle any domain changes or troubleshooting in the future.
Now over to you – how are you managing your website‘s DNS settings? Are you using your registrar‘s default nameservers or a premium DNS provider? Let us know in the comments!
