After commiting 400 rows of domain rndc exits with 1 and rndc does not reload. Even if I Commit againg it does not update.
I've changed commit.php and now it's working very well.
Here is what I've got in my file in "rebuild":
if (isset($rebuild)) {
$confres = $dbconnect->query("SELECT name FROM zones ORDER BY name");
is_error($confres);
$cout = "";
while($conf = $confres->fetchrow()) {
$cout .= "zone \"" . $conf[0] . "\" {
type master;
file \"" . $_CONF['path'] . preg_replace('/\//','-',$conf[0]) . "\";
};\n\n";
}
$fd = fopen($_CONF['conf'],"w");
fwrite($fd, $cout);
fclose($fd);
$cmd = $_CONF['namedcheckconf'] . " " . $_CONF['conf'] . " > /dev/null";
system($cmd, $exit);
if ($exit != 0) { die($_CONF['namedcheckconf'] . " exit status " . $exit); }
$dbconnect->disconnect(); # <<-------- there was a "#" at the beginning of the line which i've deleted
$cmd = $_CONF['rndc'] . " reload > /dev/null";
system($cmd, $exit);
if ($exit != 0) { die($_CONF['rndc'] . " exitt status " . $exit); }
# start of my injection
$dbconnect = DB::connect($dsn);
if(DB::isError($dbconnect)) {
die("Database error: " . DB::errorMessage($dbconnect));
}
# end of my injection
}
my Modified file
I am unclear on the issue. Please retest with 0.4.8.1. If you feel there is still an issue, please open a new ticket with some additional detail (e.g., please provide the output of 'rndc reload' as run from the shell).
The 0.4.8.1 version of commit.php does not individually check records any more and may work better if your DNS zones have many records.
I have the same issue and it is permission related. The apache user can't access the rndc.key Particularly if you are getting reports of DNS service being down it is because it can't execute rndc.
To debug I edited commit.php
$cmd = $_CONF['rndc'] . " reload 2>&1 ";
$res = system($cmd, $exit);
if ($exit != 0) { die($_CONF['rndc'] . " $res hit reload exit status " . $exit)
I got this.
rndc: error: open: /etc/bind/rndc.key: permission denied rndc: could not load rndc configuration /usr/sbin/rndc rndc: could not load rndc configuration exit status 1
I recommend that you commit that code so we have better rndc error reporting.
Last edit: Zeronanoseconds 2015-02-17