It's called a delegation.
And it's done by the DNS servers, not the HTTP servers. You do realize that there are two protocols and two distinct sets of servers here, right?
You imply that you already have a content DNS server publishing the DNS data for mytakeaway.com.
, which will include the A
and AAAA
resource records pointing to your HTTP content server(s).
You also imply that the ordering system service provider provides both DNS service and HTTP service. Its servers publish the DNS data for ordering.mytakeaway.com.
, which will include the A
and AAAA
resource records pointing to its own HTTP content server(s).
You thus need your content DNS server delegate the subdomain ordering.mytakeaway.com.
from itself to the ordering system service provider's DNS servers, whose IP addresses the ordering system service has apparently already supplied you with.
That's done by simply setting up ns
resource records and a
(possibly aaaa
) resource records for the other half of the mapping, which should be in-bailiwick for best results:
;; mytakeaway.com. zone
ordering IN NS a.ns.ordering
ordering IN NS a.ns.ordering
a.ns.ordering IN A 10.53.0.1
a.ns.ordering IN A 10.53.0.2
b.ns.ordering IN A 10.53.1.1
Coördinate the in-bailiwick intermediate domain names with the ordering system service provider.
If the ordering system service provider has only provided you with intermediate domain names, and not the actual IP addresses, you'll be forced to use out-of-bailiwick delegation information. This causes more lookup traffic for the world, and runs a greater risk of breaking, since it requires extra (sometimes a great deal extra) back-end lookups for query resolution. Notice the lack of A
and AAAA
resource records. You haven't been told the IP addresses, and even if you had, no-one would trust your content DNS server if it published them, because of the out-of-bailiwick delegation information.
;; mytakeaway.com. zone
ordering IN NS ns1.example.net.
ordering IN NS ns1.example.net.
Of course, if things are not as you imply, and your ordering system service provider isn't providing content DNS service, then you simply need to have your own content DNS servers publish A
(and AAAA
) resource record sets for ordering.mytakeaway.com.
— no delegation required.
Best Answer
From the notes on another answer I realize this has already been figured out, but I thought it would be a good idea to outline the process for future people looking for an answer:
Register your domain (
example.com
)At the registrar, you will need to registrar your name servers with the names you want to use (
ns1.example.com
andns2.example.com
) along with the IP addresses of your DNS servers (preferably on different networks in different geographic locations)Set up your DNS servers at those IP addresses.
Set up the DNS servers to serve authoratatively for your domain name(s).
In your zone file, be sure to like
ns1.example.com
in the SOA record as the master name server.Ensure that you create
NS
records within the zone file using the same entries that you used at the registrar.Create
A
records for the hostnames used (ns1
andns2
) within the zone file for the domain.Take a vacation and hope you don't have to mess with it again. :)
If, in the future, you need to move a DNS server:
Set up the DNS server at the new location.
Change the
A
record entry with the new IP address.Update the name server registration at the registrar with the new IP address of the server.