On Tue, Jan 10, 2017 at 6:52 AM, Mark Andrews <ma...@isc.org> wrote:

>
> Use named-checkconf to get the list of master and slave zones from
> named.conf then transfer them all and extract the CNAME ownername
> that matches.
>
> named-checkconf -p |
> awk '$1 == "zone" { zone = $2; next; }
> $1 == "type" && ( $2 == "slave;" || $2 == "master;" ) { print zone }' |
> sed -e 's/^"//' -e 's/"$//' |
> dig axfr -f - |
> awk -v VSERVER=${VSERVER} '$4 == "CNAME" && $5 == VSERVER { print $1 }'
>
> --
> Mark Andrews, ISC
>
> I think this is a very interesting solution because:
- named-checkconf and dig format in a standard way, so it is easy to parse
- since DNS holds the data in ram, this avoids reading the files from disk,
so it could be much faster (unless the pipes | write to disk)

-- 
Bob Harold
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to