How to Add DNS Records (A, CNAME, MX, TXT) for Your Domain
DNS (Domain Name System) records control how your domain behaves on the internet. They determine where your website is hosted, which server handles your email, and how third-party services like Google Workspace, Zoho Mail, or verification tools connect to your domain. With Nairahost, you can manage DNS directly via cPanel or another DNS management interface.
Common Types of DNS Records
- A Record (Address Record)
Points a domain or subdomain to an IPv4 address (e.g. 192.0.2.1). This is typically used for your main website. - CNAME Record (Canonical Name)
Points one domain or subdomain to another domain name. Commonly used forwww.yourdomain.compointing toyourdomain.com. - MX Record (Mail Exchange)
Tells the internet which server handles email for your domain. - TXT Record
Stores text information. Often used for SPF, DKIM, DMARC, and verification with services like Google, Facebook, or email providers.
Where to Manage DNS
There are two main scenarios:
- Your domain uses Nairahost nameservers and DNS is managed inside the hosting control panel (for example, cPanel's Zone Editor).
- Your domain uses third-party nameservers (like Cloudflare or an external DNS provider), in which case you must add DNS records on that external platform instead.
If your domain is using Nairahost hosting with cPanel, make sure your nameservers are set to:
ns1.nairahost.cloudns2.nairahost.cloud
If you are using a Nairahost DirectAdmin server, ensure your nameservers are:
ns1.nairahost.com.ngns2.nairahost.com.ng
Step-by-Step: Adding DNS Records in cPanel (Zone Editor)
- Log in to cPanel.
Use the login link provided in your hosting welcome email or from your Nairahost client area. - Open the Zone Editor.
In cPanel, search for Zone Editor or DNS Zone Editor using the search bar, then click on it. - Select your domain.
If you have multiple domains, choose the one you want to manage and click Manage.
Adding an A Record
- Click on Add Record or Add A Record.
- In the Name field, enter the hostname (leave blank or use
@for the root domain, or use a subdomain likeblog). - In the TTL field, you can leave the default value.
- In the Record or Address field, enter the IP address of your server.
- Click Add Record or Save.
Adding a CNAME Record
- Click Add Record and choose CNAME.
- Enter the subdomain under Name, for example
www. - In the CNAME or Record field, enter the target domain, such as
yourdomain.com. - Save the record.
Adding an MX Record
MX records define where email for your domain should be delivered.
- Select Add Record and choose MX.
- Set the Priority (lower numbers mean higher priority, for example 0, 5, 10).
- Enter the mail server hostname, such as
mail.yourdomain.comor the one provided by your email provider. - Ensure mail.yourdomain.com has an A record pointing to your mail server IP if you are using your hosting as the mail server.
- Save the record.
Adding a TXT Record
TXT records are often used for SPF, Google verification, and other services.
- Choose Add TXT Record.
- Enter the hostname (often
@or a specific label given by the service). - Paste the exact text value provided (for example an SPF string or verification code).
- Save the record.
Propagation Time and Troubleshooting
DNS changes can take some time to propagate worldwide, usually within minutes but sometimes up to 24 hours. If your new record does not seem to work immediately:
- Double-check that there are no typos in hostnames or IP addresses.
- Ensure you don’t have conflicting records (for example, both an A and CNAME record for the same hostname).
- Confirm that your domain is using the correct nameservers.
- Use online DNS lookup tools to check whether your changes have propagated.
When to Contact Support
If you are setting up complex DNS configurations, migrating email to third-party providers, or not sure which records are required, you can reach out to Nairahost support with your specific requirements. Provide any documentation from the third-party service, and the support team can guide you on which records to add and where.
Proper DNS configuration is critical for your website, email, and online services to function correctly. Take your time, double-check entries, and don’t hesitate to ask for assistance when needed.