How to tell if a DNS record is a top-level zone

By querying for the SOA of a DNS record, we can determine if the answer is the top level-zone or not.

Using the host command, set the query option to return the SOA record. If an answer is returned, the record is part of the top-level zone:

[email protected]:~ $ host -t soa has SOA record 2012476365 10800 3600 2419200 900

Sub-domains can be top level zones:

[email protected]:~ $ host -t soa has SOA record 2776394 10800 3600 2419200 900

If there is no SOA record, the DNS entry is a standard record and not a top-level domain:

[email protected]:~ $ host -t soa has no SOA record

comments powered by Disqus