% December 2002
# NAME
-**pdns_control** - Contreol the PowerDNS nameserver
+**pdns_control** - Control the PowerDNS nameserver
# SYNOPSIS
**pdns_control** [*OPTION*]... *COMMAND*
# COMMANDS
+bind-add-zone *DOMAIN* *FILENAME*
+: When using the bindbackend, add a zone. This zone is added in-memory and served
+ immediately. Note that this does not add the zone to the bind-config file.
+ *FILENAME* must be an absolute path.
+
+bind-domain-status [*DOMAIN*...]
+: When using the bindbackend, list status of all domains. Optionally, append
+ *DOMAIN*s to get the status of specific zones.
+
+bind-list-rejects
+: When using the bindbackend, get a list of all rejected domains.
+
+bind-reload-now *DOMAIN* [*DOMAIN*...]
+: When using the bindbackend, immediately reload *DOMAIN* from disk.
+
ccounts
: Show the content of the cache.
BB2DomainInfo bbd;
if(safeGetBBDomainInfo(domainname, &bbd))
return "Already loaded";
+
+ if (!boost::starts_with(filename, "/") && ::arg()["chroot"].empty())
+ return "Unable to load zone " + domainname.toStringRootDot() + " from " + filename + " as the filename is not absolute.";
+
+ struct stat buf;
+ if (stat(filename.c_str(), &buf) != 0)
+ return "Unable to load zone " + domainname.toStringRootDot() + " from " + filename + ": " + strerror(errno);
+
Bind2Backend bb2; // createdomainentry needs access to our configuration
bbd=bb2.createDomainEntry(domainname, filename);
bbd.d_filename=filename;
cleandig ns1.addzone.com A
cleandig ns1.test.com A
-$PDNSCONTROL --config-name=bind --socket-dir=. --no-config bind-add-zone addzone.com zones/addzone.com
+$PDNSCONTROL --config-name=bind --socket-dir=. --no-config bind-add-zone addzone.com ${PWD}/zones/addzone.com
$PDNSCONTROL --config-name=bind --socket-dir=. --no-config purge addzone.com
sleep 1
-$PDNSCONTROL --config-name=bind --socket-dir=. --no-config bind-add-zone addzone.com zones/addzone.com
+$PDNSCONTROL --config-name=bind --socket-dir=. --no-config bind-add-zone addzone.com ${PWD}/zones/addzone.com
sleep 1
cleandig ns1.addzone.com A
cleandig ns1.test.com A