Different name servers for different subdomains
Asked Answered
B

2

31

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?

Backward answered 14/12, 2017 at 7:14 Comment(3)
In registrar control panel, enter main (root) domain name servers. In main domain name server, add NS records for subdomain name servers.Nydia
Thanks for info, will try this week... Wish folks would leave comment on why they are down-voting honest questionBackward
Probably because it is borderline offtopicNydia
T
42

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).

Treadle answered 14/12, 2017 at 11:52 Comment(5)
and when there needs to have ns1,ns2 and ns3 (three nameservers) what to do? DNS ZONE EDITOR has only 1 field when adding NS/A/CNAME recordSharisharia
Can't you add three different records one at a time?Treadle
To further clarify, should the name servers be ns1.d1.com, ns2.d1.com, ns1.d2.com, ns2.d2.com? Or should they be ns1, ns2, ns3, ns4?Banas
For me (namecheap.com registrar) it only worked when I had the subdomain "app" as the value, not the full subdomain "app.example.com"Damaraland
I have a doubt , suppose in registrar, example.com points to some name server. In that name server, app.example.com is pointing its NS to ns1.appserver.com. does that means during dns resolution, it will go from root -> TLD -> name server -> then see that app.example.com wants us to go to ns1.appserver.com -> ns1.appserver.comwill now have an A for app.example.com ?Udine
P
6

Delegating name server DNS responses can be done was the answer by @Lanexbg describes.

Realize that chaining your DNS lookups this way adds more time to DNS resolution and adds another potential point of failure in the resolution process. If the parent's name servers are down, they won't able to deliver the NS records to tell the client's resolver to continue the lookup process through a delegated name server.

Consider if using DNS "A" or "CNAME" records at the parent's DNS server would be acceptable alternative.

For more detail on how DNS resolution is delegated see this answer on serverfault.com:

Palpitate answered 11/3, 2022 at 19:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.