ZoneSyncService
class ZoneSyncService (View source)
Synchronizes zone metadata between the PowerDNS API and the local zones table.
In API mode, zones created directly in PowerDNS (outside Poweradmin) won't appear in the local zones table. This service reconciles the two by:
- Adding missing zones (present in API but not locally)
- Removing orphaned zones (present locally but deleted from API)
- Updating cached metadata (zone_type, zone_master) when changed
Constants
| private LAST_SYNC_KEY |
|
Methods
No description
Run sync only if enough time has passed since the last sync.
Synchronize zones from PowerDNS API with local zones table.
Details
__construct(PDO $db, DnsBackendProvider $backendProvider, int $syncInterval = 300, LoggerInterface|null $logger = null)
No description
array|null
syncIfStale(bool $withDnssec = false)
Run sync only if enough time has passed since the last sync.
array
sync(bool $withDnssec = false)
Synchronize zones from PowerDNS API with local zones table.
On success, records the completion time in the session so that an immediately following syncIfStale() call (e.g. from the redirected request after a manual sync) will skip rather than re-run the full reconciliation.