Skip to content

Commit

Permalink
Merge pull request #5826 from pieterlexis/jpmens-issues-edition-2017
Browse files Browse the repository at this point in the history
Fix some of the issues found by @jpmens
  • Loading branch information
pieterlexis committed Oct 18, 2017
2 parents 09dc11d + 4b72bcf commit 10049ae
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
15 changes: 13 additions & 2 deletions docs/dnssec/modes-of-operation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ not required to be rectified on the master.

Signatures and Hashing is similar as described in :ref:`dnssec-online-signing`.

.. _dnssec-modes-bind-mode:

BIND-mode operation
-------------------

Expand All @@ -168,6 +170,9 @@ To use this mode, add
``pdnsutil create-bind-db /var/db/bind-dnssec-db.sqlite3``. Then,
restart PowerDNS.

.. note::
This sqlite database is different from the database used for the regular :doc:`SQLite 3 backend <../backends/generic-sqlite3>`.

After this, you can use ``pdnsutil secure-zone`` and all other pdnsutil
commands on your BIND zones without trouble.

Expand All @@ -187,8 +192,8 @@ In hybrid mode, keying material and zone records are stored in different
backends. This allows for 'bindbackend' operation in full DNSSEC mode.

To benefit from this mode, include at least one database-based backend
in the 'launch' statement. The :doc:`SQLite 3 backend <../backends/generic-sqlite3>` probably complements BIND mode
best, since it does not require a database server process.
in the :ref:`setting-launch` statement. See the :doc:`backend specific documentation <../backends/index>`
on how to initialize the database and backend.

.. warning::
For now, it is necessary to execute a manual SQL 'insert'
Expand All @@ -197,3 +202,9 @@ best, since it does not require a database server process.
statement::

insert into domains (name, type) values ('powerdnssec.org', 'NATIVE');

The :doc:`SQLite 3 backend <../backends/generic-sqlite3>` probably complements BIND mode best, since it does not require a database server process.

.. note::
The sqlite3 database must be created using the normal schema for this backend.
The database created with ``pdnsutil create-bind-db`` will not work in this backend.
6 changes: 6 additions & 0 deletions docs/manpages/pdnsutil.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ ZONE MANIPULATION COMMANDS

create-zone *ZONE*
Create an empty zone named *ZONE*.
create-slave-zone *ZONE* *MASTER* [*MASTER*]..
Create a new slave zone *ZONE* with masters *MASTER*. All *MASTER*\ s
need to to be IP addresses with an optional port.
change-slave-zone-master *ZONE* *MASTER* [*MASTER*]..
Change the masters for slave zone *ZONE* to new masters *MASTER*. All
*MASTER*\ s need to to be IP addresses with an optional port.
check-all-zones
Check all zones for correctness.
check-zone *ZONE*
Expand Down
6 changes: 6 additions & 0 deletions modules/bindbackend/bindbackend2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,12 @@ void Bind2Backend::loadConfig(string* status)
i!=domains.end();
++i)
{
if (!(i->hadFileDirective)) {
L<<Logger::Warning<<d_logprefix<<" Zone '"<<i->name<<"' has no 'file' directive set in "<<getArg("config")<<endl;
rejected++;
continue;
}

if(i->type == "")
L<<Logger::Notice<<d_logprefix<<" Zone '"<<i->name<<"' has no type specified, assuming 'native'"<<endl;
if(i->type!="master" && i->type!="slave" && i->type != "native" && i->type != "") {
Expand Down
2 changes: 2 additions & 0 deletions pdns/bindparser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ void BindParser::setVerbose(bool verbose)

void BindParser::commit(BindDomainInfo DI)
{
DI.hadFileDirective = (DI.filename != "");

if(DI.filename[0]!='/')
DI.filename=d_dir+"/"+DI.filename;

Expand Down
1 change: 1 addition & 0 deletions pdns/bindparserclasses.hh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public:
vector<string> masters;
set<string> alsoNotify;
string type;
bool hadFileDirective;

dev_t d_dev;
ino_t d_ino;
Expand Down
6 changes: 6 additions & 0 deletions pdns/pdnsutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2877,6 +2877,12 @@ try
string kind = cmds[2];
vector<string> meta(cmds.begin() + 3, cmds.end());

DomainInfo di;
if (!B.getDomainInfo(zone, di)){
cerr << "No such zone in the database" << endl;
return false;
}

if (!B.setDomainMetadata(zone, kind, meta)) {
cerr << "Unable to set meta for '" << zone << "'" << endl;
return 1;
Expand Down

0 comments on commit 10049ae

Please sign in to comment.