I have 2 AWS accounts, let's say account A and B. In account A i have registered domain name: abc.com, I want to create subdomain like dev.abc.com in account B. As of now i have created hosted zone dev.abc.com in account B and copied the NS values to hosted zone in account A(by creating record set for NS). But when i try to dig domain name:
dig abc.com ns (i get NS records in answer section, status as NOERROR)
Output:
QUESTION SECTION:
abc.com. IN NS
ANSWER SECTION:
abc.com. 15045 IN NS ns-xxx.awsdns-xx.net.
abc.com. 15045 IN NS ns-xxxx.awsdns-xx.org.
abc.com. 15045 IN NS ns-xxxx.awsdns-xx.co.uk.
abc.com. 15045 IN NS ns-xxx.awsdns-xx.com.
dig dev.abc.com (i get status as NXDOMAIN).
Output:
QUESTION SECTION:
dev.abc.com. IN NS
AUTHORITY SECTION:
dev.abc.com. 621 IN SOA ns-xxx.awsdn
I checked the values of NS are correct in account A for dev.abc.com , but still get NXDOMAIN. Now i'm thinking if this issue is coming because my AWS accounts are not the part of AWS Organizations.
No it is not necessary for 2 accounts to be part of AWS organisations.
I was able to resolve it, i checked the NS values in registered domain were not matching the NS values of Hosted zone. Now i'm able to get correct NS values for subdomain as well using dig command.