I’m trying to set up different nameservers for different subdomains of my domain.
domain.com is registered at crazydomains.com
In Crazydomains, I set bjorn.ns.cloudflare.com and surina.ns.cloudflare.com as the nameservers for domain.com
In Cloudflare, I have domain.com set up as a site.
In Cloudflare, I have setup subdomains for in.domain.com and mail.domain.com along with MX and TXT records for third-party email services etc…
I now want to set up a wordpress website on my Namecheap hosting. For this, I’m instructed to change the nameservers for domain.com to Namecheap’s nameservers.
How can I set domain.com to point to Namecheap’s nameservers and have in.domain.com and mail.domain.com pointing to Cloudflare’s nameservers?
There’s no reason you need to use their nameservers just to use their hosting, and lots of reasons you shouldn’t do that.
When you add a domain to Namecheap hosting, they have the option to validate your control of the domain by adding a DNS record, or by creating a file on your website, instead of changing the nameservers.
The direct answer to your question is that you can’t really delegate the root domain without delegating the subdomains with it, because DNS is hierarchical. You could delegate a subdomain (like www) to another nameserver, if they let you set up a subdomain on their end, but again, this isn’t the best way to do it and you should prefer to just add the necessary DNS entries at Cloudflare.