Change & Configure Nameservers Correctly (Cloudflare, Hosting & Domains)
Quick answer: Nameservers determine which DNS server manages your domain. When you change nameservers, DNS control moves to the new provider – all existing records at the old provider are ignored until you recreate them at the new provider.
What are nameservers?
Nameservers (NS) are the authoritative DNS servers for your domain. When someone visits your domain, the DNS resolver asks which nameservers manage it and fetches records from there.
Important: Nameservers are set at your domain registrar (where you bought the domain), not in the hosting panel – unless registrar and hosting are the same.
Change nameservers – step by step

- Document DNS records – screenshot or export all current A, MX, TXT, CNAME records
- Note new nameservers – e.g. NexoraHost or Cloudflare NS
- Log in at registrar – domain management → nameservers / DNS
- Enter nameservers – remove old NS, add new NS (minimum 2)
- Save & wait – propagation 15 min to 48 hrs
- Create DNS records at new provider – recreate all records!
- Test –
dig NS yourdomain.com +shortor whatsmydns.net
Verify nameservers
dig NS yourdomain.com +short
nslookup -type=NS yourdomain.com
dig yourdomain.com +shortSet up Cloudflare nameservers
- Add domain at cloudflare.com
- Cloudflare scans existing DNS records (verify!)
- Cloudflare shows 2 nameservers
- Enter these NS at registrar
- In Cloudflare: choose proxy mode (orange = CDN on, grey = DNS only)
Never proxy mail records! MX, SPF, DKIM always „DNS only“ (grey cloud).
→ Full guide: Cloudflare DNS guide
Common problems
Domain won't connect after NS change
- Cause: DNS records not created at new provider
- Fix: Recreate A, MX etc. at new DNS provider
Email broken after NS change
- Cause: MX, SPF, DKIM not migrated
- Fix: Recreate all mail DNS records → SPF/DKIM/DMARC guide
Cloudflare error 521/522/525
- 521: Server unreachable – check origin IP, firewall port 443
- 522: Connection timeout – server down or firewall blocks Cloudflare
- 525: SSL handshake failed – set Cloudflare SSL mode to „Full“