How-To Guides

How to Configure Your Website's DNS Settings (A, CNAME, MX, TXT)? A Comprehensive Domain Management Guide

  • 18 min read
  • Hostragons Team
How to Configure Your Website's DNS Settings (A, CNAME, MX, TXT)? A Comprehensive Domain Management Guide

DNS settings are technical records that determine which servers your domain directs your website, email services, and verification records to. When you purchase a domain, it is usually linked to your hosting IP address through an A record, while CNAME records are added for subdomains like www, MX records are defined for corporate emails, and TXT records are used for SPF, DKIM, DMARC, or service verifications. In short, DNS is the internet's address book that directs a visitor's browser from the domain they type to the correct web server and service.

This guide will step by step cover what A, CNAME, MX, and TXT records do, when to use each type of record, what to pay attention to while configuring DNS settings in your domain panel, and how long changes will take to propagate. We will use real-life scenarios in our examples: connecting a domain to a hosting package, creating a www redirect, using corporate email, verifying with Google Search Console, and improving email deliverability.

DNS configuration may seem complex at first glance; however, once you understand the logic behind it, it is a systematic process to manage. An incorrect record can prevent your website from loading, emails from being delivered, or SSL verification from completing. Therefore, before making changes, it is important to take note of existing records, plan TTL values accurately, and, if possible, proceed by testing each change individually. If you manage your domain, hosting, and SSL services within the same ecosystem via Hostragons, the process becomes more controlled; you can check the Hostragons Domain Registration and Transfer Services, Hostragons Web Hosting Packages, and Hostragons SSL Certificates pages for more information.

What is DNS and Why is it Important in Domain Management?

DNS stands for Domain Name System and operates as a distributed system that translates domain names into IP addresses. While people use memorable domain names like example.com, servers communicate using IP addresses like 192.0.2.10. DNS records indicate which IP address, email server, or verification value is associated with the domain name.

There are three main components involved in launching a website: domain, hosting, and DNS. Your domain is your brand's name on the internet, hosting is the server that stores your files, and DNS is the layer that connects the two. If you have a domain but your DNS records do not point to the hosting IP address, visitors cannot reach your site. If you have hosting but the nameserver or A record is incorrect, the browser may display a blank page, connection error, or old server content.

DNS is also crucial for your email infrastructure. For example, MX records determine which server emails sent to info@yourdomain.com will be delivered to. TXT records like SPF, DKIM, and DMARC are used to ensure your outgoing emails do not end up in the spam folder. Therefore, DNS settings are not only limited to the website opening process; they play a critical role in brand credibility, email reputation, advertising verifications, and security policies.

Types of DNS Records: Comparing A, CNAME, MX, and TXT

The most commonly used DNS records are A, CNAME, MX, and TXT records. Each serves a different purpose, and choosing the wrong record type can lead to service interruptions. The table below helps you quickly understand the fundamental differences.

Types of DNS Records: Comparing A, CNAME, MX, and TXT
Record TypeWhat Does It Do?Common UsageExample ValuePoints to Note
APoints the domain to an IPv4 address.Connecting the domain to the hosting server.203.0.113.25If the IP address changes, the record must be updated.
CNAMELinks one domain name as an alias to another domain name.Subdomains like www, blog, or panel.yourdomain.comNot recommended for the root domain in most DNS systems.
MXDetermines which mail server emails will go to.Corporate email, Google Workspace, Microsoft 365.mail.yourdomain.comPriority values must be ordered correctly.
TXTHolds text-based verification and security information.SPF, DKIM, DMARC, service verification.v=spf1 include:... ~allMultiple SPF records can cause errors.

You can think of this table as a practical rule: Use an A record to link your website to an IP address, a CNAME record to link a subdomain to another address, an MX record for email delivery, and a TXT record for verification and email security. Choosing the right record type during DNS settings is the first step toward a seamless launch.

Preparation Checklist Before Making DNS Settings

Having certain information ready before making DNS changes saves time and reduces the risk of errors. Particularly if you have a live website or active email traffic, unplanned changes can negatively impact user experience. The following checklist serves as a practical starting point for a professional domain management process.

  • Ensure you have access to the domain management panel.
  • Note the server IP address provided by your hosting provider.
  • Check the nameserver addresses or DNS zone information you will use.
  • If you have an email service, obtain MX, SPF, DKIM, and DMARC values from your provider.
  • Take a screenshot of the existing DNS records or export them.
  • Plan to lower the TTL values before making changes.
  • Perform actions outside of peak traffic hours for live sites.
  • Prepare DNS checking tools and browser cache clearing steps for testing after changes.

TTL stands for Time To Live and indicates how long a DNS record is cached. For example, if the TTL is 3600, the record may stay cached for about one hour. If you are making a significant server migration, reducing the TTL value to something like 300 seconds a few hours before the change can speed up the propagation process. However, using unnecessarily low TTL can increase the number of DNS queries; therefore, it is common practice to return to balanced values like 1800 or 3600 after the process is complete.

How to Create an A Record?

An A record points a domain or subdomain to an IPv4 address. It is the record you will most frequently edit when you want to connect your website to a hosting package. For instance, if you want your yourdomain.com to point to the IP address 203.0.113.25 on the Hostragons hosting server, you need to create an A record for the root domain.

Example Scenario for A Record

Let’s say you have set up a new WordPress site, and your server IP address appears as 203.0.113.25 in your hosting panel. You would typically enter @ in the name or host field in the DNS management section of your domain panel. This symbol represents the root domain. You select A in the type field, enter 203.0.113.25 in the value field, and prefer 3600 for TTL. After adding the record, yourdomain.com will start resolving to this IP address.

Steps for Adding an A Record

  • Log into your domain management panel.
  • Open the DNS management, DNS zone, or DNS records section.
  • Select the option to add a new record.
  • Select A as the record type.
  • Enter @ for the root domain in the host field, or a value like blog or panel for a subdomain.
  • Type the hosting IP address in the value field.
  • Specify the TTL value and save the record.
  • Test the domain from a browser and DNS query tools after propagation.

The most common mistake when adding an A record is creating a second record that conflicts with the new IP address without deleting the old one. Multiple A records can be used for load balancing purposes; however, in a standard hosting scenario, accidentally defining two different IPs can cause visitors to sometimes go to the old server and sometimes to the new server. Therefore, it is essential to check the records for the same host.

How to Create a CNAME Record?

A CNAME record, which stands for Canonical Name, redirects one domain name as an alias to another domain name. The most common usage is for the www subdomain. For example, if you want www.yourdomain.com to show the same site as yourdomain.com, you can create a CNAME record for www.

Example Scenario for CNAME Record

Assuming your yourdomain.com root domain is linked to the hosting IP address via an A record. Instead of writing an IP for www.yourdomain.com, you can create a CNAME record and set the target to yourdomain.com. This way, when the IP address of the root domain changes, you won't need to update the www record separately; www will automatically follow the target of the root domain.

Steps for Adding a CNAME Record

  • Add a new record in the DNS management section.
  • Select CNAME as the record type.
  • Type www, blog, or shop as the subdomain in the host field.
  • Enter the domain you want to redirect to in the target or value field.
  • Specify the TTL value and save the record.
  • Test the subdomain in a browser.

There is an important point to consider when using a CNAME record: Using CNAME for the root domain is not recommended or supported in most traditional DNS configurations. This is because the root domain needs to have other records like NS, SOA, and sometimes MX. Therefore, it is generally preferred to use an A record for the root domain and a CNAME record for subdomains. If CDNs, website builders, or SaaS platforms require special redirects, the values in the provider's documentation must be followed precisely.

How to Create an MX Record?

An MX record, which stands for Mail Exchange, determines which mail server will receive emails sent to your domain. Your website can be on one server while your emails can be functioning through another provider. This distinction is possible thanks to DNS. For example, while your site is hosted on Hostragons, you can use your emails through Google Workspace, Microsoft 365, or Hostragons corporate email infrastructure.

The Logic of Priority in MX Records

MX records contain a number called priority, which represents the order of preference for mail servers. A lower number indicates a higher priority. For instance, a server with a priority of 10 will be tried before a server with a priority of 20. If the primary mail server does not respond, the system may try the second record. This structure is crucial for email continuity.

Steps for Adding an MX Record

  • Obtain the MX server addresses provided by your email provider.
  • Check the existing MX records in the DNS management section.
  • Remove any old MX records that will not be used or adjust them according to the provider's recommendation.
  • Add a new MX record and usually set the host field as @.
  • Enter the mail server value and specify the priority value correctly.
  • If there are multiple MX records, add them all in the order recommended by your provider.
  • Test receiving and sending emails after saving.

The most common issue with MX records is having mixed records for multiple email providers at the same time. For instance, if old hosting mail records remain alongside new Google Workspace records, some emails may be directed to the wrong server. When migrating corporate email, it’s good practice to create a transition plan, set up mailboxes in advance, and make the DNS change during off-peak hours. If you want to manage your email infrastructure alongside hosting, you can check Hostragons Corporate Email Solutions.

How to Create a TXT Record?

A TXT record is used to publish text-based information in DNS. In modern domain management, TXT records are especially important for verification and security purposes. Google Search Console, Microsoft 365, Meta Business, various advertising platforms, and SSL verification processes may ask you to add a TXT record. Additionally, email security requires SPF, DKIM, and DMARC records to be published in TXT format.

Why are SPF, DKIM, and DMARC Important?

SPF specifies which servers can send emails on behalf of your domain. DKIM ensures that sent emails are verified with a cryptographic signature. DMARC informs recipient servers how to act based on SPF and DKIM results. When these three are correctly configured, the chances of your emails ending up in the spam folder decrease, and protection against misuse of your domain for fraudulent sending increases.

Steps for Adding a TXT Record

  • Copy the TXT value provided by your verification or email provider.
  • Add a new TXT record in the DNS management section.
  • Enter the host as specified by the provider; for the root domain use @, for DKIM use values like selector._domainkey.
  • Paste the TXT value completely.
  • Save the record and re-check it with a verification tool.
  • Ensure that there is not more than one SPF record for the same domain.

A small character error in TXT records can cause verification to fail. In particular, spaces, colons, and include statements must be written correctly in SPF records. Publishing two separate v=spf1 records for the same root domain is erroneous; instead, allowed senders should be combined into a single SPF record. For example, if you use both hosting mail and an email marketing tool, you should define two include values in one line instead of having two separate SPF records.

The Difference Between Changing Nameservers and Changing DNS Records

The Difference Between Changing Nameservers and Changing DNS Records

When making DNS settings, changing nameservers is often confused with changing DNS records. Nameservers determine which servers manage the DNS records for your domain. DNS records, on the other hand, are the specific redirects like A, CNAME, MX, TXT that are defined on those nameservers. Therefore, if you change nameservers, you are changing the address of DNS management; if you change the A record, you are only updating the web redirect target.

For example, your domain may be registered with a different company while your hosting is with Hostragons. In this case, you can use one of two methods. In the first method, you convert the nameserver addresses of the domain to Hostragons nameservers, and manage all DNS records from the Hostragons panel. In the second method, you continue using the DNS panel of your current domain provider, only redirecting the A record to the Hostragons hosting IP address. Which method is more appropriate depends on where your email infrastructure is located and whether you want to consolidate management in one panel.

How Long Does DNS Propagation Take?

In most cases, DNS changes begin to take effect within a few minutes to a few hours; however, updating all caches worldwide can take up to 24 to 48 hours. This duration can vary depending on TTL, internet service provider caching, browser DNS cache, and record types. While many changes become visible within 5-60 minutes today, considering a 48-hour window for critical migrations is a safe approach.

To test the propagation process, you can check from different networks. Mobile internet, a different browser, incognito mode, or online DNS query tools are helpful. If your computer shows old records, you may need to clear the DNS cache. Additionally, if you are using a CDN or firewall, not only DNS but also CDN cache and SSL configurations should be checked. If you are experiencing issues on the SSL side, SSL Certificate Installation and HTTPS Redirection Guide content can be useful.

Example DNS Configuration for Linking a Domain to Hosting

For users who want to launch a new site, the typical configuration is quite straightforward. First, determine which DNS panel will manage the domain. Then acquire the hosting IP address, add an A record for the root domain, create a CNAME record for www, and complete MX and TXT records if email will be used.

  • Root domain: A record, host @, value hosting IP address.
  • www subdomain: CNAME record, host www, value yourdomain.com.
  • Mail server: MX record, host @, value your email provider's server address.
  • SPF: TXT record, host @, value your email provider's SPF line.
  • DKIM: TXT record, host as per the provider's selector value, value DKIM key.
  • DMARC: TXT record, host _dmarc, value policy line.

This configuration is a general example; the values for each hosting and email provider may differ. In your Hostragons hosting panel, you can see the server IP address, mail service information, and necessary redirects. If you are starting a WordPress, corporate site, or e-commerce project, resources like WordPress Hosting Setup, Domain Forwarding with cPanel, and Website Migration Guide can help you complete the process.

Common Mistakes and Solutions in DNS Settings

DNS errors often stem from seemingly small mistakes that have a significant impact. The first mistake is using the wrong IP address. If an old A record remains when changing hosting packages or moving servers, the site will continue to show the old server. The solution is to check the updated IP address in the hosting panel and update the DNS record accordingly.

The second common mistake is the overlap of CNAME and A records on the same host. Defining both A and CNAME for a subdomain is invalid in many DNS systems. For example, if you are using CNAME for www, you should not add an A record for the same www host. The third mistake is forgetting to update SPF, DKIM, and DMARC records while changing MX records or leaving records from the old provider. This can negatively affect email deliverability.

The fourth mistake is using incorrect characters in verification TXT records. If there are line breaks, spaces, or missing parts during copy-paste, Google, Microsoft, or other services may fail to complete verification. The fifth mistake is continuously changing records without waiting for DNS propagation. It is more accurate to wait a reasonable time after saving a record, test from different networks, and proceed with one variable at a time.

DNS Tips for Security and Performance

DNS is not only important for redirection but also for security and performance. Ensure that your domain is locked and that you use a strong password and two-factor authentication in your domain management panel. Unauthorized DNS changes can lead to your site being redirected to another server or interruptions in your emails. Keeping your domain ownership email up to date is also critical for transfer and recovery processes.

On the performance side, keeping unnecessary DNS records clear and using the correct TTL values simplifies management. Short TTL can be preferred for frequently changing records, while longer TTL may be suitable for stable records. If you are using a CDN, you should set up CNAME or custom DNS configurations according to the provider's instructions. You may also plan AAAA records if you want IPv6 support; however, the main focus of this guide is on A, CNAME, MX, and TXT records.

For email security, it is recommended to publish at least SPF and DKIM records and gradually implement DMARC policy if possible. Initially, a monitoring mode for DMARC can be used, and after reviewing the reports, a stricter policy can be established. This approach helps raise the security level without accidentally blocking legitimate email traffic.

Quick Implementation Summary Step by Step

When making DNS settings, the following short flow will suffice for most website launch scenarios. First, check which nameservers your domain is using. If DNS management is in the Hostragons panel, perform the operations from the same panel; if with a different provider, do so from the relevant provider's DNS screen. Obtain your hosting IP address and create an A record for the root domain. Add a CNAME record for www. If using email, define the MX records and necessary TXT records. Finally, check that your SSL certificate covers the correct domains and that HTTPS redirection is active.

While implementing this flow, it is a good professional habit to note every change and create a rollback plan, especially for live projects. While DNS adjustments for a small blog can be completed in 10-15 minutes, planning may take more time for corporate emails and projects with multiple subdomains. The key is to use the correct record types for their intended purpose and patiently test the propagation process.

Frequently Asked Questions

Do changes to DNS settings make the site open immediately?

Most DNS changes start to appear within a few minutes to a few hours; however, full propagation worldwide can take up to 24-48 hours. TTL values, service provider caching, and browser caching can affect this duration.

What is the difference between an A record and a CNAME record?

An A record directs a domain directly to an IPv4 address. A CNAME record links a subdomain as an alias to another domain. Generally, an A record is used for the root domain, while CNAME records are used for subdomains like www.

Is an MX record sufficient for email?

An MX record is necessary to receive emails; however, for reliable sending, SPF, DKIM, and DMARC TXT records are usually required as well. These records reduce the risk of spam and make it harder for your domain to be used for fraudulent sending.

Is it better to change nameservers or change the A record?

Changing nameservers is appropriate if you want to move all DNS management to a new provider. If you only want to redirect your website to a new hosting IP address, changing the A record may be sufficient. The location of your email infrastructure affects this decision.

What happens if I add an incorrect DNS record?

An incorrect DNS record can prevent your site from loading, stop the www address from working, block emails from being delivered, or cause verification processes to fail. Backing up existing records before changes and testing each change individually is the safest method.

Conclusion

DNS settings are the core configuration that correctly connects your domain with web hosting, email, SSL, and verification services. The A record links your website to an IP address, the CNAME links subdomains to their target domains, the MX directs emails to the mail server, and the TXT connects verification and security information to the relevant services. If you choose the correct record type and enter the values carefully, domain management can become secure, quick, and sustainable.

If you want to consolidate domain, hosting, email, and SSL management within a single ecosystem, you can explore Hostragons solutions and get technical support when needed to complete your DNS configuration more securely.

Share this article:

Hostragons Team

Up-to-date guides from our expert team on hosting, servers, and domain names. Let's find the right solution for your project together.

Contact Us