Different name servers for different subdomains

openwonk picture openwonk · Dec 14, 2017 · Viewed 18.1k times · Source

Let's say I have a website example.com which I bought via a common domain registry nomcheap.com.

I want all traffic to a specific subdomain app.example.com to go to name server ns1.appserver.com so I can serve a specific user app.

I also want all other traffic (www.example.com, hello.example.com, *.example.com, etc.) to go to a different name server from a different provider ns1.squaresites.com so I can serve a general website (think something like a commerce Wordpress site).

None of the name servers are provided by the original domain registry nomcheap.com.

Is this possible? If so, any suggestions on how?

Answer

Lanexbg picture Lanexbg · Dec 14, 2017

To point a subdomain to a name servers you need to create an NS record for the subdomain:

app.example.com NS ns1.appserver.com

This will make all queries go to ns1.appserver.com

*.example.com NS ns1.squaresites.com

The second record should catch all subdomains that don't have their own records (of any kind).