list zones

Phil Mayers p.mayers at imperial.ac.uk
Tue Aug 3 09:55:13 UTC 2010


On 03/08/10 10:39, Mihamina Rakotomandimby wrote:
> Manao ahoana, Hello, Bonjour,
>
> Without grepping the configuration files from the system shell, is it
> possible to lists all the master zones on a running bind9? What tool
> with?

How about this:

# add this to named.conf
statistics-channels {
  inet * port 987 allow { localhost; };
};

# put this in a "zones.xsl" file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="isc/bind/statistics">
<xsl:for-each select="views/view">
<xsl:for-each select="zones/zone">
zone <xsl:value-of select="name"/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

# get the stats and render to text
wget -O stats.xml http://localhost:987/
xsltproc zones.xsl stats.xml



More information about the bind-users mailing list