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?
DNS Made Easy lets you assign different nameservers to any of your subdomains. This means you will be using two providers at the same time: one at the root level and one at the subdomain level.
At a minimum, you'll need two DNS servers for each Internet domain you have. You can have more than two for a domain but usually three is tops unless you have multiple server farms where you would want to distribute the DNS lookup load. It's a good idea to have at least one of your DNS servers at a separate location.
Yes, without a problem, this is one of the basic functions of DNS. On the DNS server for example.com, you define the IP for dev.example.com, and that the NS for dev.example.com is dev.example.com, and on dev.example.com you define all the sub-names of dev.example.com.
You sure can. For example, where I work, we have 4 name servers, 2 hosted with one DNS host, one hosted by us, and the other one hosted by a second external DNS host.
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).
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With