If you're managing NS (Nameserver) Hosting, you need to log in to your DNS provider to edit MX and TXT records for your domain.
Before logging in, determine which NS hosting service is managing your DNS records.
Run this command in the terminal:
dig NS yourdomain.com +short
Example Output:
ns1.dnsprovider.com
ns2.dnsprovider.com
This tells you which DNS provider to log into (e.g., Cloudflare, Namecheap, GoDaddy, etc.).
Example NS Hosting Login Pages:
https://yourdomain.com/cpanelMX (Mail Exchange) records route emails to the correct mail server[citation:3].
Once logged in:
To set up Gmail, Zoho, or a custom mail server, add the correct MX record.
Example MX Records for Google Workspace (Gmail)
| Priority | Mail Server |
|---|---|
| 1 | ASPMX.L.GOOGLE.COM |
| 5 | ALT1.ASPMX.L.GOOGLE.COM |
| 5 | ALT2.ASPMX.L.GOOGLE.COM |
| 10 | ALT3.ASPMX.L.GOOGLE.COM |
| 10 | ALT4.ASPMX.L.GOOGLE.COM |
@ASPMX.L.GOOGLE.COMNow, email traffic is routed through the correct mail server.
TXT records store additional domain information, such as SPF, DKIM, and DMARC, which help authenticate emails and prevent spam[citation:5][citation:10].
SPF records prevent spammers from using your domain for email spoofing[citation:4].
Example SPF Record for Google Workspace:
v=spf1 include:_spf.google.com ~all
How to Add the SPF Record
@[citation:1][citation:7]v=spf1 include:_spf.google.com ~allDKIM signs outgoing emails to verify authenticity[citation:5][citation:10].
Example DKIM Record:
default._domainkey.yourdomain.com TXT "v=DKIM1; k=rsa; p=MIGfMA0GC..."
How to Add the DKIM Record
default._domainkey (or the selector provided by your email service)[citation:4]v=DKIM1; k=rsa; p=MIGfMA0GC... (the full key)DMARC protects against phishing and email fraud by defining a policy for handling emails that fail SPF or DKIM checks[citation:5][citation:10].
Example DMARC Record:
v=DMARC1; p=none; rua=mailto:reports@yourdomain.com
How to Add the DMARC Record
_dmarc[citation:5]v=DMARC1; p=none; rua=mailto:reports@yourdomain.comNow your domain is secured against email spoofing!
After adding records, verify that they are propagated correctly.
Run:
dig MX yourdomain.com +short
Expected Output (Example for Gmail MX Records):
1 ASPMX.L.GOOGLE.COM.
5 ALT1.ASPMX.L.GOOGLE.COM.
Run:
dig TXT yourdomain.com +short
Expected Output (Example for SPF):
"v=spf1 include:_spf.google.com ~all"
Or use an online tool:
| Issue | Possible Cause | Fix |
|---|---|---|
| Emails Not Being Received | MX record missing or incorrect | Add correct MX records with proper priority |
| SPF Check Fails | Incorrect SPF record syntax or multiple SPF records[citation:10] | Use correct syntax: v=spf1 include:_spf.google.com ~all and ensure only one SPF record exists |
| DKIM Validation Fails | Wrong DKIM key or incorrect host/subdomain | Copy full DKIM TXT value exactly; verify the host field (e.g., selector._domainkey) |
| Changes Not Taking Effect | DNS not fully propagated; cache issues[citation:3] | Wait for TTL to expire (can take 24-48 hours) & flush local DNS (ipconfig /flushdns on Windows) |
| Task | Steps |
|---|---|
| Log in to NS Hosting | Go to your DNS provider's login page and enter credentials |
| Find current nameservers | Use dig NS yourdomain.com +short |
| Edit MX records (for email routing) | Add Google/Zoho/mail server MX records with correct priority |
| Set up SPF, DKIM, DMARC (TXT records) | Add TXT records for email authentication; only one SPF record allowed |
| Verify MX/TXT changes | Use dig MX yourdomain.com and dig TXT yourdomain.com or online tools[citation:2][citation:3] |
| Troubleshoot issues | Use WhatsMyDNS to check record propagation and verify TTL/values[citation:3] |
Now your NS hosting is set up for email and security!