This support includes doing the standards recommended following of alias-form records in-zone and adding those to the additional section.
Apart from that, there's the PowerDNS special for "autohints".
+.. _svc-autohints:
+
Automatic hints
---------------
PowerDNS can automatically fill in ``ipv4hint`` and ``ipv6hint`` parameters in SVCB records based on A and AAAA records already present in the zone.
+This can be enabled by setting :ref:`setting-svc-autohint` to 'yes'.
+
Consider the following zone content::
example.com IN HTTPS 0 www.example.com
It will emit a warning when there are no hints to be found::
[warning] HTTPS record for no-ipv6.example.org has automatic IPv6 hints, but no AAAA-record for the target at no-ipv6.example.org exists.
+
+When autohints exist but are disabled
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+When :ref:`setting-svc-autohint` is not enabled, the parameter is dropped when its value is ``auto``.
Turn on supermaster support. See :ref:`supermaster-operation`.
+.. _setting-svc-autohints:
+
+``svc-autohints``
+-----------------
+
+- Boolean
+- Default: no
+
+Whether or not to enable IPv4 and IPv6 :ref:`autohints <svc-autohints>`.
+
.. _setting-tcp-control-address:
``tcp-control-address``
#include "misc.hh"
#include "query-local-address.hh"
#include "trusted-notification-proxy.hh"
+#include "packethandler.hh"
#include <thread>
::arg().set("max-generate-steps", "Maximum number of $GENERATE steps when loading a zone from a file")="0";
::arg().setSwitch("upgrade-unknown-types","Transparently upgrade known TYPExxx records. Recommended to keep off, except for PowerDNS upgrades until data sources are cleaned up")="no";
+ ::arg().setSwitch("svc-autohints", "Transparently fill ipv6hint=auto ipv4hint=auto SVC params with AAAA/A records for the target name of the record (if within the same zone)")="no";
::arg().setSwitch("consistent-backends", "Assume individual domains are not divided over backends. Send only ANY lookup operations to the backend to reduce the number of lookups")="no";
DNSPacket::s_udpTruncationThreshold = std::max(512, ::arg().asNum("udp-truncation-threshold"));
DNSPacket::s_doEDNSSubnetProcessing = ::arg().mustDo("edns-subnet-processing");
+ PacketHandler::s_SVCAutohints = ::arg().mustDo("svc-autohints");
PC.setTTL(::arg().asNum("cache-ttl"));
PC.setMaxEntries(::arg().asNum("max-packet-cache-entries"));
AtomicCounter PacketHandler::s_count;
NetmaskGroup PacketHandler::s_allowNotifyFrom;
set<string> PacketHandler::s_forwardNotify;
+bool PacketHandler::s_SVCAutohints{false};
extern string s_programname;
// Process auto hints
auto rrc = getRR<SVCBBaseRecordContent>(rec->dr);
DNSName target = rrc->getTarget().isRoot() ? rec->dr.d_name : rrc->getTarget();
- if (rrc->autoHint(SvcParam::ipv4hint)) {
+ if (rrc->autoHint(SvcParam::ipv4hint) && s_SVCAutohints) {
auto hints = getIPAddressFor(target, QType::A);
if (hints.size() == 0) {
rrc->removeParam(SvcParam::ipv4hint);
} else {
rrc->setHints(SvcParam::ipv4hint, hints);
}
+ } else {
+ rrc->removeParam(SvcParam::ipv4hint);
}
- if (rrc->autoHint(SvcParam::ipv6hint)) {
+ if (rrc->autoHint(SvcParam::ipv6hint) && s_SVCAutohints) {
auto hints = getIPAddressFor(target, QType::AAAA);
if (hints.size() == 0) {
rrc->removeParam(SvcParam::ipv6hint);
} else {
rrc->setHints(SvcParam::ipv6hint, hints);
}
+ } else {
+ rrc->removeParam(SvcParam::ipv6hint);
}
}
int trySuperMasterSynchronous(const DNSPacket& p, const DNSName& tsigkeyname);
static NetmaskGroup s_allowNotifyFrom;
static set<string> s_forwardNotify;
+ static bool s_SVCAutohints;
static const std::shared_ptr<CDNSKEYRecordContent> s_deleteCDNSKEYContent;
static const std::shared_ptr<CDSRecordContent> s_deleteCDSContent;