I have a dedicated server running on subdomain. I want to configure subdomains as DNS. Basically, I use example.com as my main company domain.
I will, probably have more than one dedicated server and want them to be s1
, s2
etc.
I redirected server.example.com
to another DNS provider via NS entries
server.example.com NS ns1.hostingcompany.example.com
server.example.com NS ns2.hostingcompany.example.com
And there I setup following entries:
servers.example.com NS ns1.hostingcompany.example.com.
servers.example.com NS ns2.hostingcompany.example.com.
s1.servers.example.com NS ns1s1.servers.example.com.
s1.servers.example.com NS ns2s1.servers.example.com.
ns1s1.servers.example.com A 192.0.2.1
ns2s1.servers.example.com A 192.0.2.2
s1.servers.example.com A 192.0.2.1
But, servers.example.com
does not have A record. I skipped it, as I wanted only to use it as grouping DNS entry.
Everything seems to work, except my local bind server in company. It does not recognize s1.servers.example.com
and any of subdomains. When I switch to google DNS it seems to work fine.
Question is, if this setup is proper and will work?
Note: Maybe I don't understand how NS entries work, as far as I understand is when NS server exists in domain entry, pointing to other DNS server it's considered "Don't ask me, ask another server" and A records are not needed in this chain.
Unless I am seriously mistaken, I see two problems here.
The first one is trivial. I am writing this answer a few hours after you have posted the question. This means that the new DNS configuration might not yet have propagated through the whole DNS system. Depending on the various TTL entries in the domain's configuration, this may take a day. A typical stage in this process is that some DNS servers already serve new information, while others serve old information.
The second one is your configuration. I cannot see why you have the following entries:
As far as I have understood your question,
s1.servers.example.com
is not a subdomain, but just a host. But you are treating it like a subdomain in that you explicitly delegate it to a name server. This is very unusual, and you should probably leave away that four lines. The basic structure should be like this:Tell the world which name servers are responsible / authoritative for resolving all names which are in the
servers.example.com
namespace. You have done this by the first two lines you have posted in your code box.Then just add entries (A records) for all your hosts to those name servers' configuration. Unless those name servers replicate each other, you should add the respective entries to both of them. You have done this for
s1
by the last line you have posted in your second code box.There should be nothing more to do. Personally, I would add an additional entry for
servers.example.com
itself, perhaps just pointing it tos1.servers.example.com
, because experience shows that people will try that host name and will be worried if it can't be resolved.A record is not mandatory in general but it is good to have it there at least to keep hint how to reach it in case of subdomain (you need to know where is ns1.sub.example.com which is handling example.com - you know what was first chicken or egg ? / you can't ask for ns1.sub.example.com in case you don't know about example.com yet :-) ).
There have to be SOA (Start Of zone Authority) records and it is quite common to have at least NS (Name Server) record. Technically NS is needed for delegation related to other subdoamain as "important" NS record for the zone is located in upper zone (in case you ask for NS you are at the end asking directly on the zone, but to reach it you are using NS from upper zone).
For imagination let assume this structure (example.com, example.net and 192.0.2.0/24 is for documentation purpose and the rest is real in DNS system - of course reduced to one of the many records...):
In this example there is consistent information for NS delegation for example.com in the zone directly and in the upper zone.
In case it would differ it is not an issue but for looking for the authoritative server the one from upper zone (com.) will be used but in case of regular recursion the record from zone directly will be returned... So something else than what is technically used can be shown. This may be an issue in case you migrating the zone to other DNS server - until former DNS server is up all is OK and looks good but once it is powered off the zone is not reachable...
The "upper" zone is maintained through the registrar (usually some web form) but the zone directly (your zone) is maintained anywhere you point the NS record (registrar server, third side server or your own DNS server).
To see the record in upper zone you can use this command (in case of example.com so com.'s DNS server):
To get the content of the zone example.com you can use (asking e.g. public google DNS server):
In case the delegation is working in general but not on premises I guess you have locally defined DNS zone for example.com (e.g. to get internal IP instead of public one) so even you have made NS delegation for subdomain your local instance of DNS zone example.com have no idea about that - you need to add it also there.
Next to it you don't need extra NS delegation for each subdomain. In case you don't need extra subdomain DNS server even "main" DNS server can hanle it.
This is valid content of the zone for example.com
In case you need delegation just servers "level" may be enough:
So in case you don't need extra DNS server for some special purpose directly on s1.servers.example.com this record from the question is not really needed:
You configuration is correct, except the:
Since you delegated the domain
s1.servers.example.com
to other name servers, its their job to define this entry. An exception constitute the glue records, which must be in the parent zone. You can use them to give a more rational name to the delegated nameservers: