I'm having trouble with bind9 to configure the following dns setup:
I want to delegate a zone to a remote dns server. But I want to delegate a sub-zone of that zone to a different dns server.
Example:
project.example.com
-> to dns serverdns1
prd.project.example.com
-> to dns serverdns2
For obvious reasons, I don't want to delegate everything to dns1
and then delegate prd.project.example.com
to dns2
. I could go deeper into the details (dns1
needs dynamic subdomains such as dev
, hotfix1
etc.) but I don't think they would help right now.
I was able to successfully set up this solution with cloudflare and with aws route53. But bind does not work as expected. It keeps delegating everything (for example test.prd.project.example.com
) to dns1
.
What am I missing?
Here is the simplified zone file:
$ORIGIN example.com.
$TTL 300
@ IN SOA dns.example.com. ( 2021020506 3600 720 1209600 3600 )
IN NS dns.example.com.
dns IN A 1.2.3.4
$ORIGIN project.example.com.
$TTL 60
@ IN NS ns-1.awsdns-1.net.
IN NS ns-1.awsdns-1.co.uk.
$ORIGIN prd.project.example.com.
$TTL 60
@ IN NS ns-2.awsdns-2.net.
IN NS ns-2.awsdns-2.co.uk.