Skip to content

Commit 6e82a23

Browse files
cmousePeter van Dijk
authored andcommitted
Fix ordername for SOA record after update
1 parent 535f4e3 commit 6e82a23

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pdns/pdnssec.cc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,28 @@ int increaseSerial(const string& zone, DNSSECKeeper &dk)
616616
cerr<<"Backend did not replace SOA record. Backend might not support this operation."<<endl;
617617
return -1;
618618
}
619+
620+
if (sd.db->doesDNSSEC()) {
621+
NSEC3PARAMRecordContent ns3pr;
622+
bool narrow;
623+
bool haveNSEC3=dk.getNSEC3PARAM(zone, &ns3pr, &narrow);
624+
625+
if(haveNSEC3)
626+
{
627+
if(!narrow) {
628+
string hashed=toBase32Hex(hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rrs[0].qname));
629+
if(g_verbose)
630+
cerr<<"'"<<rrs[0].qname<<"' -> '"<< hashed <<"'"<<endl;
631+
sd.db->updateDNSSECOrderAndAuthAbsolute(sd.domain_id, rrs[0].qname, hashed, 1);
632+
}
633+
else {
634+
sd.db->nullifyDNSSECOrderNameAndUpdateAuth(sd.domain_id, rrs[0].qname, 1);
635+
}
636+
} else {
637+
sd.db->updateDNSSECOrderAndAuth(sd.domain_id, zone, rrs[0].qname, 1);
638+
}
639+
}
640+
619641
cout<<"SOA serial for zone "<<zone<<" set to "<<sd.serial<<endl;
620642
return 0;
621643
}

0 commit comments

Comments
 (0)