I’ve added more than 100 domains into my Cloudflare account. But recently I faced with a strange problem:
When I adding website to my account, the suggested nameservers is chan.ns.cloudflare.com NS2: wesley.ns.cloudflare.com (1)
But after this domain was added, Cloudflare said that those nameserver are invalid, and the correct nameservers is diva.ns.cloudflare.com NS2: trevor.ns.cloudflare.com (2)
After that, the suggested nameserver is (2), but after added domain with nameserver (2), Cloudflare said that it is invalid, the correct nameserver must be nameserver (1).
Below is two of my domains was facing this problem huyphi194.fun like30s.com
This is bad because I’ve to contact my customer again to ask them change the nameservers.
Is there any way to have a fixed nameservers for my account, or I can have any API to fetch the current nameserver connected to my account?
There was a recent change which it sounds ilke you’re being affected by. If they set the nameservers before you add the website/zone to your account, it will pick two other ones.
To prevent domain hijacking, you can no longer preset Cloudflare nameservers at your registrar before creating the respective zone in Cloudflare. If you preset your nameservers and then add the domain, your domain will be assigned a new pair of nameservers.
There was never a guarantee of what nameservers it will use without account custom nameservers. You should add the website/zone first, and tell the user to change to the nameservers it tells you. You can also this via the API as well: Cloudflare API Documentation. The alternative is Account Custom Nameservers (Biz or Ent required): Account custom nameservers · Cloudflare DNS docs, which are fixed.
Thankyou Chaika. Your answer helped me understand flow adding domain to Cloudflare.
You also mentioned “Account custom nameservers”, that means I can setup a custom nameservers (excample: demo1.ns.cloudflare.com, demo2.ns.cloudflare.com) and use it for all of my domains in the future. Is that correct? The documents told me that I can do that when “contacting the Cloudflare Support”, means here - Cloudflare community?