Setting up DNS is an essential part of managing your website and domain name. Whether you are launching a new website, want to configure your email or create a subdomain, you will always come into contact with DNS settings. In this complete guide, you will learn step by step how to set up and manage DNS for your domain name, from the basics to advanced configurations.

What is DNS? A quick refresher

DNS stands for Domain Name System and works like the phone book of the internet. When you type a domain name such as theory7.net into your browser, DNS translates this readable name into the IP address of the server where the website is located. Without DNS, you would only be able to visit websites by typing in long strings of numbers.

The DNS system works through a hierarchy of servers that together ensure that every domain name points to the right IP address. Do you want to understand the technical background in detail? Then read our extensive article on how DNS works. In this article, we focus on the practical side: how to set up and manage DNS.

You set up DNS through your domain registrar or hosting provider. There you have access to a DNS management panel where you can add, change and delete different types of records. Each type of record has a specific function, and it is important to understand which record you need and when.

DNS records explained: all types in a row

When you set up DNS, you will come across different types of records. Each record type has a specific purpose. Below we explain the most important DNS records with practical examples.

A record (Address Record)

The A record is the most fundamental DNS record. It links a domain name to an IPv4 address. When someone visits your website, the browser looks up the A record to know which server the traffic should be sent to.

When do you use it: When setting up your website on a hosting server, when creating subdomains that need to point to a specific IP address.

Example: theory7.net A 93.184.216.34 - This tells DNS that theory7.net can be found at IP address 93.184.216.34.

AAAA record (IPv6 Address Record)

The AAAA record is the IPv6 variant of the A record. Because IPv4 addresses are running out, IPv6 is becoming increasingly important. The AAAA record links a domain name to an IPv6 address, which looks very different from an IPv4 address.

When do you use it: When your hosting server supports IPv6 (which is becoming more and more common). It is best practice to set up both an A and AAAA record for maximum reachability.

Example: theory7.net AAAA 2001:0db8:85a3:0000:0000:8a2e:0370:7334

CNAME record (Canonical Name)

A CNAME record creates an alias from one domain to another. Instead of pointing to an IP address, a CNAME points to another domain name. This is handy when you want multiple subdomains to point to the same server without creating a separate A record for each one.

When do you use it: For subdomains (www.yoursite.com to yoursite.com), for third-party services (such as a blog.yoursite.com to platforms.wordpress.com), for CDN configuration.

Example: www.theory7.net CNAME theory7.net - This ensures that www.theory7.net points to the same address as theory7.net.

MX record (Mail Exchange)

MX records determine which mail server is responsible for receiving email for your domain. Without correctly configured MX records, you cannot receive email on your domain name. You can set up multiple MX records with different priorities as a backup.

When do you use it: When setting up email for your domain, when switching to another email provider (such as Google Workspace or Microsoft 365), when configuring backup mail servers.

Example: theory7.net MX 10 mail.theory7.net - The number 10 is the priority (lower = higher priority).

TXT record (Text Record)

TXT records contain textual information that is used for various purposes. The most common applications are email authentication (SPF, DKIM, DMARC) and domain verification for services such as Google Search Console or Microsoft 365.

When do you use it: For SPF records (which servers are allowed to send email on behalf of your domain), for DKIM (email signing), for DMARC (email authentication policy), for domain verification with external services.

SPF example: theory7.net TXT "v=spf1 include:_spf.google.com ~all"

NS record (Name Server)

NS records indicate which nameservers are responsible for the DNS zone of your domain. These records are usually set with your domain registrar and point to the DNS servers that host your DNS records. Do you want to know more about changing nameservers? Then read our separate article about this.

When do you use it: When moving your DNS to another provider, when setting up a new domain with a hosting company.

SRV record (Service Record)

SRV records specify the location of specific services on your domain. They are set manually less often, but are important for services such as VoIP (SIP), instant messaging (XMPP) and Microsoft services.

When do you use it: When configuring Microsoft Teams or Skype for Business, for VoIP configurations, when setting up game servers.

SOA record (Start of Authority)

The SOA record contains administrative information about the DNS zone, such as the primary nameserver, the email address of the administrator and parameters for zone transfers. This record is usually managed automatically by your DNS provider and you rarely need to adjust it manually.

Step by step: setting up DNS for a new domain name

Have you just registered a new domain name? Then you need to set up the DNS before your website and email will work. Below we explain step by step how to do this.

Step 1: Setting nameservers

The first step in setting up DNS is deciding which nameservers you are going to use. If you have hosting and domain with the same provider (as with Theory7), the nameservers are often already set correctly. If you use an external hosting company, then you have to enter the nameservers of that company with your domain registrar. Typically you are given two or more nameservers, such as ns1.hostingprovider.com and ns2.hostingprovider.com.

Step 2: Setting an A record for your website

Create an A record that links your domain name (e.g. yoursite.com) to the IP address of your hosting server. You can find this IP address in the dashboard of your hosting provider. Also create an A record (or CNAME) for the www variant so that both yoursite.com and www.yoursite.com work.

Step 3: Setting MX records for email

Do you want to receive email on your domain name? Then set up the MX records that point to your mail server. With most hosting providers these are configured by default. If you use an external email service such as Google Workspace or Microsoft 365, then you have to adopt their specific MX records.

Step 4: TXT records for email authentication

Add SPF, DKIM and DMARC records as TXT records. These records ensure that email sent from your domain is recognized as legitimate by receiving mail servers. Without these records, there is a good chance that your emails will end up in spam.

Step 5: Checking and testing

After setting up DNS, it is important to check that everything works correctly. Use tools like dig, nslookup or online DNS checkers to verify that your records have propagated correctly. Keep in mind that DNS changes need time to be applied worldwide (DNS propagation).

Changing DNS for common scenarios

You do not only set up DNS for a new domain. There are various situations in which you have to adjust existing DNS settings. Here we discuss the most common scenarios.

Moving a website to another server

When moving your website to a new hosting server, you have to change the A record to the IP address of the new server. Make sure your new website already works fully on the new server before you change the DNS. If needed, temporarily lower the TTL (Time to Live) a day before the move, so that the change is applied more quickly. Read more about connecting a domain name to hosting for a detailed guide.

Setting up or switching email

When switching to another email provider, you change the MX records to the servers of the new provider. Do not forget to also adjust the associated TXT records (SPF, DKIM). It is wise to only remove the old MX records after the new ones have fully propagated, to prevent email loss.

Creating a subdomain

You create a subdomain (such as blog.yoursite.com or shop.yoursite.com) by adding a new A record or CNAME record. With an A record you point the subdomain to a specific IP address. With a CNAME you forward it to another domain. Subdomains are handy for separating different parts of your online presence.

TTL (Time to Live) explained

TTL is an important setting in DNS that indicates how long a DNS record may be kept in cache by intermediate DNS servers (resolvers). The TTL is expressed in seconds. A commonly used value is 3600 (1 hour) or 86400 (24 hours).

A low TTL (for example 300 seconds = 5 minutes) means that changes are applied faster, but causes more DNS requests to your nameservers. A high TTL (for example 86400 seconds = 24 hours) means that changes take longer to apply, but reduces the load on your DNS servers and makes lookups faster for visitors.

Practical tip: normally use a TTL of 3600-86400 seconds. If you are planning to make DNS changes (such as a server move), lower the TTL to 300 seconds 24-48 hours in advance. Then make the change, and set the TTL back to the normal value after a successful migration.

DNS propagation: how long does it take?

After setting up or changing DNS, it takes a while before the changes are visible worldwide. This process is called DNS propagation. How long propagation takes depends on several factors, but the most important is the TTL value of the changed record.

In practice you can expect the following: with a TTL of 300 seconds, changes are usually visible within 5-30 minutes. With a TTL of 3600 seconds it can take 1-4 hours. With a TTL of 86400 seconds it can take up to 24-48 hours before the change has been applied everywhere.

During the propagation period, some visitors may still see the old settings while others already see the new ones. This is normal behavior and no cause for concern. Therefore, preferably plan major DNS changes for quiet moments, such as during the weekend or outside office hours.

DNS tools for checking and troubleshooting

There are various tools available to check your DNS settings and track down problems. Regularly checking your DNS is an important part of good domain management.

dig (Domain Information Groper)

dig is a powerful command-line tool available on Linux and macOS. With the command "dig yoursite.com A" you can query the A record of your domain. dig shows detailed information including the TTL, the responding nameserver and any error messages. It is the tool that professionals use most for DNS diagnostics.

nslookup

nslookup is a simpler tool that is available on all operating systems, including Windows. With "nslookup yoursite.com" you can quickly check which IP address your domain points to. It is less extensive than dig, but sufficient for quick checks.

Online DNS checkers

For those who prefer not to use command-line tools, there are excellent online alternatives. Websites such as MXToolbox, DNSChecker.org and WhatsMyDNS.net offer a visual overview of your DNS records and show the propagation status worldwide. These tools are particularly handy for checking whether a DNS change has been applied everywhere.

Common DNS mistakes and how to fix them

When setting up DNS, you can make various mistakes that cause your website or email not to work. Below are the most common problems and their solutions.

CNAME on the root domain

A common mistake is setting a CNAME record on the root domain (yoursite.com without www). Technically this is not allowed according to the DNS standard, because a CNAME cannot coexist with other records, and the root domain always has an SOA and NS record. Instead, use an A record on the root domain. Some DNS providers offer an ALIAS or ANAME record as an alternative that does work on the root domain.

Wrong MX priority

When setting up MX records, it is important to use the right priority values. A lower value means a higher priority. If you accidentally give a backup mail server a lower priority value than the primary server, email goes to the wrong server. Always check your email provider's documentation for the correct priorities.

Missing or incorrect SPF records

A missing or faulty SPF record is one of the most common causes of email deliverability problems. If your SPF record does not contain all the servers that send email on behalf of your domain, emails may be marked as spam or even rejected. Make sure your SPF record contains all the email services you use and does not require more than 10 DNS lookups.

Forgetting to delete the old records

After a move or change, many people forget to delete the old DNS records. This can lead to conflicting settings and unpredictable behavior. After every DNS change, it is wise to review all records and delete outdated entries.

DNSSEC: extra security for your DNS

DNSSEC (DNS Security Extensions) adds an extra security layer to DNS by digitally signing records. This prevents attackers from being able to forge DNS responses (DNS spoofing or cache poisoning). With DNSSEC, your browser can verify that the DNS response actually comes from the right nameserver and has not been manipulated along the way.

You activate DNSSEC with your domain registrar. Most modern registrars support DNSSEC and offer it for free. After activation, a DS record is added to the parent DNS level (the registry) that confirms the authenticity of your DNS zone. SIDN (the administrator of .nl) fully supports DNSSEC and recommends it for all .nl domains.

Please note: if you have enabled DNSSEC and you move your domain to other nameservers, you have to disable DNSSEC first with the old provider and then enable it again with the new one. Otherwise your domain can temporarily become unreachable.

Setting up and managing DNS at Theory7

With Theory7 web hosting you get access to a user-friendly DNS management panel with which you can easily manage all your DNS records. Our panel offers a clear interface for adding, changing and deleting all common DNS record types.

Important features of Theory7 DNS management are: a visual dashboard with all DNS records in a row, immediate changes without waiting times on our end, DNSSEC support for extra security, optimal TTL values by default, and support for all record types including SRV and CAA.

Do you need help setting up DNS? Our Dutch customer service is happy to help you. Whether you are registering your first domain name or want to set up a complex multi-domain configuration, we are ready for you.

Frequently asked questions about setting up DNS

How long does it take before DNS changes are active?

DNS changes depend on the TTL (Time to Live) setting. With a low TTL of 300 seconds, changes are usually active within 5-30 minutes. With the standard TTL of 3600 seconds it can take 1-4 hours. In the worst case (high TTL) it can take up to 48 hours before the change is visible everywhere.

Can I set up DNS myself or do I need a technician?

With a good DNS management panel you can make most DNS settings yourself. The basic settings (A record, MX records) are relatively simple. For more complex configurations such as DKIM, DNSSEC or SRV records, it can be handy to consult your provider's documentation or ask customer service for help.

What happens if I make a mistake in my DNS settings?

A mistake in your DNS can cause your website to become unreachable or email to no longer arrive. Fortunately, DNS changes can always be undone. Before you make changes, make a note of the current settings so that you can restore them if something goes wrong. Most DNS providers also offer a history of changes.

Do I have to adjust DNS records if I move to another host?

Yes, when moving hosting you have to change at least the A record to the IP address of your new server. If you also switch email providers, the MX records and associated TXT records (SPF, DKIM) also have to be changed. When moving to Theory7, we are happy to help you with the correct settings.

What is the difference between changing nameservers and changing DNS records?

Changing nameservers determines which DNS server is responsible for your domain. Changing DNS records changes the individual settings within that DNS server. If you switch hosting providers, you usually change the nameservers. If you only want to adjust a specific setting (such as an MX record for email), you only change that specific DNS record.

Setting up DNS: overview of record types

When you want to set up DNS, it is handy to know which record types exist. Below you will find an overview of the most important DNS records you need when setting up DNS.

  • A record - Links your domain name to an IPv4 address. Essential when setting up DNS.
  • AAAA record - Links your domain name to an IPv6 address.
  • CNAME record - Points a subdomain to another domain.
  • MX record - Determines which mail server receives email for your domain.
  • TXT record - Used for verification, SPF and DKIM when setting up DNS.
  • NS record - Indicates which nameservers manage your domain.
Record TypeFunctionExample valueTTL (recommended)
AIPv4 address mapping192.168.1.13600
AAAAIPv6 address mapping2001:db8::13600
CNAMEDomain aliaswww.example.com3600
MXMail server designationmail.example.com3600
TXTVerification and securityv=spf1 include:...3600

By correctly setting up these records, you ensure that your website and email function properly. If in doubt about setting up DNS, contact your hosting provider.

Free tool: Use our DNS Lookup tool. View all DNS records of a domain: A, AAAA, MX, TXT, NS and more.