SOARecordManager
class SOARecordManager implements SOARecordManagerInterface (View source)
Service class for managing SOA records
Constants
| MAX_SERIAL |
Zone serials are 32-bit unsigned values (RFC 1982). |
Methods
Constructor
Get SOA record content for Zone ID
Get SOA Serial Number
Replace a literal "[SERIAL]", "[UNIXTIME]" or "[COUNTER]" in the serial field of a submitted SOA record with a numeric value. The subsequent updateSOASerial() bump (see EditRecordController) then advances the value, preserving RFC 1982 monotonicity even if today's serial has already been incremented several times.
Get Next Date
Get Next Serial
Update SOA record
Set SOA serial in SOA content
Return SOA record with incremented serial number
Update SOA serial
Details
__construct(PDO $db, ConfigurationManager $config, DnsBackendProvider|null $backendProvider = null)
Constructor
string
getSOARecord(int $zone_id)
Get SOA record content for Zone ID
static string|null
getSOASerial(string $soa_rec)
Get SOA Serial Number
static string
expandSerialPlaceholder(string $newContent, string $oldContent)
Replace a literal "[SERIAL]", "[UNIXTIME]" or "[COUNTER]" in the serial field of a submitted SOA record with a numeric value. The subsequent updateSOASerial() bump (see EditRecordController) then advances the value, preserving RFC 1982 monotonicity even if today's serial has already been incremented several times.
The resolved value never drops below the existing serial - slaves only transfer when the serial increases, so a format switch cannot rewind it.
static string
getNextDate(string $curr_date)
Get Next Date
int|string
getNextSerial(int|string $curr_serial)
Get Next Serial
Zone transfer to zone slave(s) will occur only if the serial number of the SOA RR is arithmetically greater that the previous one (as defined by RFC-1982).
The serial should be updated, unless:
-
the serial is set to "0", see http://doc.powerdns.com/types.html#id482176
-
set a fresh serial ONLY if the existing serial is lower than the current date
-
update date in serial if it reaches limit of revisions for today or do you think that ritual suicide is better in such case?
"This works unless you will require to make more than 99 changes until the new date is reached - in which case perhaps ritual suicide is the best option." http://www.zytrax.com/books/dns/ch9/serial.html
bool
updateSOARecord(int $domain_id, string $content)
Update SOA record
static string
setSOASerial(string $soa_rec, string $serial)
Set SOA serial in SOA content
string
getUpdatedSOARecord(string $soa_rec)
Return SOA record with incremented serial number
bool
updateSOASerial(int $domain_id)
Update SOA serial
Increments SOA serial to next possible number