This commit fixes two issues:
- if the existing zone name is not empty we should use it, instead of
the zone domain
- if the zone domain has to be used, it should not include a final dot
// If oldZone failed to load its getRefresh() returns 0, protect against that
uint32_t refresh = std::max(refreshFromConf ? refreshFromConf : oldZone->getRefresh(), 10U);
DNSName zoneName = oldZone->getDomain();
- std::string polName = oldZone->getName().empty() ? oldZone->getName() : zoneName.toString();
+ std::string polName = !oldZone->getName().empty() ? oldZone->getName() : zoneName.toStringNoDot();
// Now that we know the name, set it in the logger
logger = logger->withValues("zone", Logging::Loggable(zoneName));