From e467d0f51a16b58022671540779e0b4549c8b692 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Tue, 18 May 2021 21:19:13 +0200 Subject: [PATCH] auth: use primary/seconday in pddns_control and s/zone/domain --- docs/manpages/pdns_control.1.rst | 42 ++++++++++++++++---------------- pdns/dynhandler.cc | 38 ++++++++++++++--------------- pdns/receiver.cc | 8 +++--- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/docs/manpages/pdns_control.1.rst b/docs/manpages/pdns_control.1.rst index 1a4e3bcc14..3857558813 100644 --- a/docs/manpages/pdns_control.1.rst +++ b/docs/manpages/pdns_control.1.rst @@ -27,36 +27,36 @@ Options Commands -------- -bind-add-zone *DOMAIN* *FILENAME* +bind-add-zone *ZONE* *FILENAME* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When using the BIND backend, 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-extended-status [*DOMAIN*...] +bind-domain-extended-status [*ZONE*...] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Output an extended status of all domains, containing much more information than -the simple domain status, like the number of records currently loaded, whether pdns -is master or slave for the domain, the list of masters, various timers, etc -Optionally, append *DOMAIN*\ s to get the status of specific zones. +Output an extended status of all zones, containing much more information than +the simple zone status, like the number of records currently loaded, whether pdns +is primary or secondary for the zone, the list of primaries, various timers, etc +Optionally, append *ZONE*\ s to get the status of specific zones. -bind-domain-status [*DOMAIN*...] +bind-domain-status [*ZONE*...] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -When using the BIND backend, list status of all domains. Optionally, -append *DOMAIN*\ s to get the status of specific zones. +When using the BIND backend, list status of all zones. Optionally, +append *ZONE*\ s to get the status of specific zones. bind-list-rejects ^^^^^^^^^^^^^^^^^ -When using the BIND backend, get a list of all rejected domains. +When using the BIND backend, get a list of all rejected zones. -bind-reload-now *DOMAIN* [*DOMAIN*...] +bind-reload-now *ZONE* [*ZONE*...] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -When using the BIND backend, immediately reload *DOMAIN* from disk. +When using the BIND backend, immediately reload *ZONE* from disk. ccounts ^^^^^^^ @@ -80,22 +80,22 @@ list Dump all statistics and their values in a comma separated list, equivalent to ``show *``. -list-zones [master,slave,native] +list-zones [primary,secondary,native] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Show a list of zones, optionally filter on the type of zones to show. -notify *DOMAIN* +notify *ZONE* ^^^^^^^^^^^^^^^ -Adds *DOMAIN* to the notification list, causing PowerDNS to send out -notifications to the nameservers of a domain. Can be used if a slave +Adds *ZONE* to the notification list, causing PowerDNS to send out +notifications to the nameservers of a zone. Can be used if a secondary missed previous notifications or is generally hard of hearing. Use -\* to notify for all domains. (Note that you may need to escape the +\* to notify for all zones. (Note that you may need to escape the \* sign in your shell.) -notify-host *DOMAIN* *ADDRESS* +notify-host *ZONE* *ADDRESS* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Same as above but with operator specified IP *ADDRESS* as @@ -128,7 +128,7 @@ Tell a running pdns\_server to quit. rediscover ^^^^^^^^^^ -Instructs backends that new domains may have appeared in the +Instructs backends that new zones may have appeared in the database, or, in the case of the BIND backend, in named.conf. reload @@ -147,10 +147,10 @@ respsizes Get a histogram of the response sizes. -retrieve *DOMAIN* [IP] +retrieve *ZONE* [IP] ^^^^^^^^^^^^^^^^^^^^^^ -Retrieve slave *DOMAIN* from its master. Done nearly immediately. +Retrieve secondary *ZONE* from its primary. Done nearly immediately. If IP is specified, then retrieval is forced from the specified IP. Port may be specified in AFI specific manner. diff --git a/pdns/dynhandler.cc b/pdns/dynhandler.cc index af77e142a8..a456464bcc 100644 --- a/pdns/dynhandler.cc +++ b/pdns/dynhandler.cc @@ -242,13 +242,13 @@ string DLNotifyRetrieveHandler(const vector&parts, Utility::pid_t ppid) extern CommunicatorClass Communicator; ostringstream os; if(parts.size()!=2 && parts.size()!=3) - return "syntax: retrieve domain [ip]"; + return "syntax: retrieve zone [ip]"; DNSName domain; try { domain = DNSName(parts[1]); } catch (...) { - return "Failed to parse domain as valid DNS name"; + return "Failed to parse zone as valid DNS name"; } ComboAddress master_ip; @@ -257,7 +257,7 @@ string DLNotifyRetrieveHandler(const vector&parts, Utility::pid_t ppid) try { master_ip = ComboAddress{parts[2], 53}; } catch (...) { - return "Invalid master address"; + return "Invalid primary address"; } override_master = true; } @@ -265,7 +265,7 @@ string DLNotifyRetrieveHandler(const vector&parts, Utility::pid_t ppid) DomainInfo di; UeberBackend B; if(!B.getDomainInfo(domain, di)) { - return " Domain '"+domain.toString()+"' unknown"; + return " Zone '" + domain.toString() + "' unknown"; } if (override_master) { @@ -274,13 +274,13 @@ string DLNotifyRetrieveHandler(const vector&parts, Utility::pid_t ppid) } if(!override_master && (di.kind != DomainInfo::Slave || di.masters.empty())) - return "Domain '"+domain.toString()+"' is not a slave domain (or has no master defined)"; + return "Zone '" + domain.toString() + "' is not a secondary zone (or has no primary defined)"; shuffle(di.masters.begin(), di.masters.end(), pdns::dns_random_engine()); const auto& master = di.masters.front(); Communicator.addSuckRequest(domain, master, SuckRequest::PdnsControl, override_master); - g_log<&parts, Utility::pid_t ppid) @@ -288,15 +288,15 @@ string DLNotifyHostHandler(const vector&parts, Utility::pid_t ppid) extern CommunicatorClass Communicator; ostringstream os; if(parts.size()!=3) - return "syntax: notify-host domain ip"; + return "syntax: notify-host zone ip"; if(!::arg().mustDo("primary") && !(::arg().mustDo("secondary") && ::arg().mustDo("secondary-do-renotify"))) - return "PowerDNS not configured as primary (master), or secondary (slave) with re-notifications"; + return "PowerDNS not configured as primary, or secondary with re-notifications"; DNSName domain; try { domain = DNSName(parts[1]); } catch (...) { - return "Failed to parse domain as valid DNS name"; + return "Failed to parse zone as valid DNS name"; } try { @@ -305,8 +305,8 @@ string DLNotifyHostHandler(const vector&parts, Utility::pid_t ppid) { return "Unable to convert '"+parts[2]+"' to an IP address"; } - - g_log<&parts, Utility::pid_t ppid) extern CommunicatorClass Communicator; UeberBackend B; if(parts.size()!=2) - return "syntax: notify domain"; + return "syntax: notify zone"; if(!::arg().mustDo("primary") && !(::arg().mustDo("secondary") && ::arg().mustDo("secondary-do-renotify"))) - return "PowerDNS not configured as primary (master), or secondary (slave) with re-notifications"; - g_log< domains; @@ -328,7 +328,7 @@ string DLNotifyHandler(const vector&parts, Utility::pid_t ppid) int total = 0; int notified = 0; for (const auto& di : domains) { - if (di.kind == DomainInfo::Master || di.kind == DomainInfo::Slave) { // MASTER and Slave if slave-renotify is enabled + if (di.kind == DomainInfo::Master || di.kind == DomainInfo::Slave) { // Primary and secondary if secondary-do-renotify is enabled total++; if(Communicator.notifyDomain(di.zone, &B)) notified++; @@ -343,7 +343,7 @@ string DLNotifyHandler(const vector&parts, Utility::pid_t ppid) try { domain = DNSName(parts[1]); } catch (...) { - return "Failed to parse domain as valid DNS name"; + return "Failed to parse zone as valid DNS name"; } if(!Communicator.notifyDomain(DNSName(parts[1]), &B)) return "Failed to add to the queue - see log"; @@ -384,9 +384,9 @@ string DLListZones(const vector&parts, Utility::pid_t ppid) ostringstream ret; int kindFilter = -1; if (parts.size() > 1) { - if (toUpper(parts[1]) == "MASTER" || toUpper(parts[1]) == "PRIMARY") + if (toUpper(parts[1]) == "PRIMARY" || toUpper(parts[1]) == "MASTER") kindFilter = 0; - else if (toUpper(parts[1]) == "SLAVE" || toUpper(parts[1]) == "SECONDARY") + else if (toUpper(parts[1]) == "SECONDARY" || toUpper(parts[1]) == "SLAVE") kindFilter = 1; else if (toUpper(parts[1]) == "NATIVE") kindFilter = 2; diff --git a/pdns/receiver.cc b/pdns/receiver.cc index 178f1bef80..9e04452fe1 100644 --- a/pdns/receiver.cc +++ b/pdns/receiver.cc @@ -592,8 +592,8 @@ int main(int argc, char **argv) DynListener::registerFunc("RPING",&DLPingHandler, "ping instance"); DynListener::registerFunc("QUIT",&DLRQuitHandler, "quit daemon"); DynListener::registerFunc("UPTIME",&DLUptimeHandler, "get instance uptime"); - DynListener::registerFunc("NOTIFY-HOST",&DLNotifyHostHandler, "notify host for specific domain", " "); - DynListener::registerFunc("NOTIFY",&DLNotifyHandler, "queue a notification", ""); + DynListener::registerFunc("NOTIFY-HOST", &DLNotifyHostHandler, "notify host for specific zone", " "); + DynListener::registerFunc("NOTIFY", &DLNotifyHandler, "queue a notification", ""); DynListener::registerFunc("RELOAD",&DLReloadHandler, "reload all zones"); DynListener::registerFunc("REDISCOVER",&DLRediscoverHandler, "discover any new zones"); DynListener::registerFunc("VERSION",&DLVersionHandler, "get instance version"); @@ -603,9 +603,9 @@ int main(int argc, char **argv) DynListener::registerFunc("RESPSIZES", &DLRSizesHandler, "get histogram of response sizes"); DynListener::registerFunc("REMOTES", &DLRemotesHandler, "get top remotes"); DynListener::registerFunc("SET",&DLSettingsHandler, "set config variables", " "); - DynListener::registerFunc("RETRIEVE",&DLNotifyRetrieveHandler, "retrieve slave domain", " []"); + DynListener::registerFunc("RETRIEVE", &DLNotifyRetrieveHandler, "retrieve slave zone", " []"); DynListener::registerFunc("CURRENT-CONFIG",&DLCurrentConfigHandler, "retrieve the current configuration", "[diff]"); - DynListener::registerFunc("LIST-ZONES",&DLListZones, "show list of zones", "[master|slave|native]"); + DynListener::registerFunc("LIST-ZONES", &DLListZones, "show list of zones", "[primary|secondary|native]"); DynListener::registerFunc("TOKEN-LOGIN", &DLTokenLogin, "Login to a PKCS#11 token", " "); DynListener::registerFunc("XFR-QUEUE", &DLSuckRequests, "Get all requests for XFR in queue"); -- 2.47.2