I have been taught that DNS resolvers work backwards from the top-level domain, checking for child nameservers at each level.
The resolver doesn't so much check for nameservers at each level, rather it gets redirected at (potentially) each delegation.
Consider the case where our recursive resolver hasn't got any records cached but knows of the root zone.
A client asks the question c.b.a.example.com. IN A
, the resolver does not know who is authoritative for c.b.a.example.com.
, b.a.example.com.
, ..., example.com.
or com.
. It does know who is authoritative for .
(the root zone) though.
The resolver asks a root nameserver c.b.a.example.com. IN A
, but since the root nameservers aren't authoritative for com.
, they would reply something along the lines of com. IN NS ...
to state the nameservers which are authoritative for com.
. The resolver goes on to ask one of those nameservers the same question of c.b.a.example.com. IN A
, which might return another delegation of example.com. IN NS ...
.
It's not the case that each label in a name corresponds to a delegation, after all, it could be the case that c.b.a.example.com.
is in the example.com.
zone, such that when the resolver asks a nameserver authoritative for example.com.
the question c.b.a.example.com. IN A
, it can answer c.b.a.example.com. IN A ...
(unless of course it delegates, at say a.example.com.
).
It's expected that each delegation increases resolution time (possibly not in the case where a server might be authoritative for multiple of those delegations), but this doesn't necessarily mean that more labels lead to increased resolution times.
As for glue records, they are not authoritative. Hypothetically, if example.com.
had a nameserver ns1.example.com.
with an A record also in the com.
zone as a glue record, we may still ask ns1.example.com.
for its own A record(s), since for client queries we should ask an authoritative nameserver for the answer.