1

I have a example.com domain which points to a server, and also I have created a subdomain with A Record for it like sub.example.com to point it to another server.

Now I want to manage all subdomains of sub.example.com like sub2.sub.example.com to be managed with the second server. How should I do that? I dont want to put another A record in Godaddy for sub2.sub, I just want to say all subdomains of sub.example.com should be resolved on the second server

FYI: I have Virtualmin on the second server, so there is a DNS server installed with it to resolve incoming requests.

Thanks in advance

2
  • Do you mean "resolved to the second server" or do you mean "resolved using records provided by the second server"? Commented Aug 15, 2019 at 15:19
  • @grawity resolved using records provided by the second server Commented Aug 15, 2019 at 15:20

1 Answer 1

2

You're trying to create a delegation, which uses NS records. Create an NS record pointing to a name that has A/AAAA records which point to the new DNS server:

myserver.domain.com.    AAAA  2001:db8::1
myserver.domain.com.    A     192.0.2.1

sub.domain.com.         NS    myserver.domain.com.

Delegation covers all subdomains and the name itself. All A/AAAA queries for sub.domain.com. (and any other record types) will actually be resolved using the second server.

This means that you should also remove all other records for sub.domain.com. from the parent zone – instead, add them to the child zone (the second server).

Other variants

NS records are allowed to point at a nameserver name that's covered by the delegation itself, but when doing so, those A/AAAA records must be duplicated between both the parent and child domains (they become "glue records").

For example, this is valid:

mysrv.sub.domain.com.   A    192.0.2.1   ; needs to exist on both zones!
sub.domain.com.         NS   mysrv.sub.domain.com.

This is probably also valid but I would not recommend doing it:

sub.domain.com.         A    192.0.2.1   ; needs to exist on both zones!
sub.domain.com.         NS   sub.domain.com.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .