[dns-operations] is there a diagnostic tool to obtain delegated ns?

Mark Andrews marka at isc.org
Fri Sep 12 02:13:00 UTC 2014

In message <5411CB74.8090605 at easydns.com>, "Mark E. Jeftovic" writes:
> I'm going to be open sourcing a php class I wrote awhile back that we
> use internally for finding the delegated nameservers for a specified domain.
> This is distinct from "host -C" or doing a type=ns query because while
> those will look at what are *thought* to be the NS records for the
> domain (as reported by the nameservers themselves), it is not uncommon
> to be at variance from what's actually delegated into the roots.
> The class is just a wrapper that steps through dig +trace, but before I
> clean this up, etc I'm wondering if we re-invented a wheel somewhere
> along the line.
> Is there already any tool specifically outputs the authoritative
> nameservers as they are delegated in the rootzone for a domain?
> - mark

The following will work for any zone w/o a embedded period in a label.

zone="$1" parent="$1" ns=
while test -z "$ns" -a -n "$parent"
        parent=`expr "X$zone" : '^[^.]*.\(.*\)'`
        ns=`dig +short ns -q "$parent"`
        for s in $ns
                dig +noall -q "$zone" soa "@$s" +authority
) | awk '{print $5}' | sort -ui

> -- 
> Mark E. Jeftovic <markjr at easydns.com>
> Founder & CEO, easyDNS Technologies Inc.
> +1-(416)-535-8672 ext 225
> Read my blog: http://markable.com
> _______________________________________________
> dns-operations mailing list
> dns-operations at lists.dns-oarc.net
> https://lists.dns-oarc.net/mailman/listinfo/dns-operations
> dns-jobs mailing list
> https://lists.dns-oarc.net/mailman/listinfo/dns-jobs
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: marka at isc.org

More information about the dns-operations mailing list