Pointing a Domain to a Server: A, AAAA and CNAME Guide
Point your domain to a server: A, AAAA, CNAME, MX and TXT record types, DNS propagation time, testing with dig/nslookup, and common mistakes.
What are nameservers, how to change NS at your registrar, propagation time, checking with whois/dig, and common registrar interfaces guide.
Changing nameservers (NS) allows you to move your domain's DNS management from one provider to another. This is required when switching to Cloudflare, using a custom DNS server, or changing hosting providers. In this guide, you'll learn what nameservers are, how to change them, and how to monitor the process.
A nameserver (NS) is the authoritative DNS server that answers DNS queries for a domain. At least two nameservers must be defined for each domain (primary and backup).
# Query current nameservers
dig example.com NS +short
# Example output:
# ns1.cloudflare.com.
# ns2.cloudflare.com.
# Check with whois
whois example.com | grep -i nameserver
Root DNS Servers (.)
↓
TLD Servers (.com, .net, .org)
↓
Authoritative Nameservers (ns1.example.com)
↓
Domain Records (A, CNAME, MX...)
When a user accesses example.com:
Obtain nameserver addresses from your new DNS provider. Examples:
# Cloudflare
ns1.cloudflare.com
ns2.cloudflare.com
# Google Cloud DNS
ns-cloud-a1.googledomains.com
ns-cloud-a2.googledomains.com
# AWS Route 53
ns-1234.awsdns-12.com
ns-5678.awsdns-34.net
ns-9012.awsdns-56.org
ns-3456.awsdns-78.co.uk
Note all DNS records before changing nameservers:
# List all DNS records
dig example.com ANY
# Check important records separately
dig example.com A
dig example.com AAAA
dig example.com MX
dig example.com TXT
dig example.com CNAME
Before changing nameservers, transfer all DNS records to the new DNS provider. Otherwise, email, website, and other services may stop working.
Create all records at the new DNS provider before changing nameservers:
# Records to create in new DNS panel:
@ A 203.0.113.50
www A 203.0.113.50
mail A 203.0.113.50
@ MX 10 mail.example.com.
@ TXT "v=spf1 ip4:203.0.113.50 ~all"
Nameserver changes can take longer than regular DNS changes:
This depends on the TTL value of the old nameservers and ISP cache policies.
# Check nameserver change
dig example.com NS +short
# Check from specific DNS servers
dig @8.8.8.8 example.com NS +short
dig @1.1.1.1 example.com NS +short
dig @9.9.9.9 example.com NS +short
# Find authoritative NS
dig example.com NS +authority
# Check propagation status
for dns in 8.8.8.8 1.1.1.1 9.9.9.9 208.67.222.222; do
echo -n "$dns: "
dig @$dns example.com NS +short
done
# whois query
whois example.com
# Filter nameserver lines
whois example.com | grep -i "name server\|nameserver\|nserver"
# 1. Verify nameservers are updated
dig example.com NS +short
# 2. Check A record resolves
dig example.com A +short
# 3. Check MX record
dig example.com MX +short
# 4. Test website access
curl -I https://example.com
# 5. Verify email MX record
dig example.com MX
nslookup -type=MX example.com
# Check old NS TTL value
dig example.com NS
# Wait for the TTL value
# Query TLD server directly
dig @a.gtld-servers.net example.com NS
A record may be missing at new DNS provider:
# Check A record via new NS
dig @ns1.newdns.com example.com A
MX record may not have been transferred to new DNS provider:
# Check MX record
dig @ns1.newdns.com example.com MX
When switching to Cloudflare, SSL mode may be incorrectly set. Check Cloudflare SSL/TLS settings.
# 1. Add domain in Cloudflare
# 2. Cloudflare automatically scans existing DNS records
# 3. Manually add missing records
# 4. Enter Cloudflare's NS addresses at your registrar
# Verify Cloudflare NS
dig example.com NS +short
# Expected: ns1.cloudflare.com, ns2.cloudflare.com
During nameserver changes, don't delete records at the old DNS provider. Keep records active at both providers until propagation is complete. You can remove old records after propagation is done.
Changing nameservers is the primary way to move domain DNS management. Back up your DNS records before the change, create records at the new provider, then make the NS change at your registrar. Monitor the propagation process with dig and whois tools. Be patient — full propagation can take 24-48 hours.
Nameserver changes typically propagate within 12-24 hours, but can take up to 48-72 hours in some cases. This depends on the TTL value of the old nameservers and ISP cache policies.
During propagation, some users may reach the old DNS server and others the new one. If you create all records at the new DNS provider beforehand, downtime is minimized. However, brief access issues may still occur.
At least two nameservers are required (primary and backup). Some TLDs require a minimum of two NS. Adding more NS provides redundancy.
You can see current nameservers with 'dig example.com NS +short'. Check propagation status by querying from different DNS servers (8.8.8.8, 1.1.1.1). The whatsmydns.net site also shows worldwide propagation.
Yes, if you don't create MX records at the new DNS provider, email will stop working. Before the change, transfer all MX, SPF, and DKIM records to the new provider.
Point your domain to a server: A, AAAA, CNAME, MX and TXT record types, DNS propagation time, testing with dig/nslookup, and common mistakes.
What is a PTR record, how it affects email deliverability and security, how to set it up in the REXE panel, verification with dig -x, and common issues.
Historical stats with vnstat, real-time monitoring with iftop, per-process bandwidth with nethogs, nload usage, and interpreting results.