class SupermasterManager (View source)

Service class for managing PowerDNS supermasters

Methods

__construct(PDO $db, ConfigurationManager $config, DnsBackendProvider|null $backendProvider = null)

Constructor

bool
addSupermaster(string $master_ip, string $ns_name, string $account)

Add Supermaster

bool
deleteSupermaster(string $master_ip, string $ns_name)

Delete Supermaster

array
getSupermasters()

Get All Supermasters

array
getSupermasterInfoFromIp(string $master_ip)

Get Supermaster Info from IP

bool
supermasterExists(string $master_ip)

Check if Supermaster IP address exists

bool
supermasterIpNameExists(string $master_ip, string $ns_name)

Check if Supermaster IP Address and NS Name combo exists

bool
updateSupermaster(string $old_master_ip, string $old_ns_name, string $new_master_ip, string $new_ns_name, string $account)

Update Supermaster

array
getSlaveServerIPs()

Get distinct slave server IP addresses

static bool
validateAccount(string $account)

Validate Account is valid string

Details

__construct(PDO $db, ConfigurationManager $config, DnsBackendProvider|null $backendProvider = null)

Constructor

Parameters

PDO $db

Database connection

ConfigurationManager $config

Configuration manager

DnsBackendProvider|null $backendProvider

DNS backend provider (auto-created if null)

bool addSupermaster(string $master_ip, string $ns_name, string $account)

Add Supermaster

Add a trusted supermaster to the global supermasters table

Parameters

string $master_ip

Supermaster IP address

string $ns_name

Hostname of supermasterfound in NS records for domain

string $account

Account name used for tracking

Return Value

bool

true on success

bool deleteSupermaster(string $master_ip, string $ns_name)

Delete Supermaster

Delete a supermaster from the global supermasters table

Parameters

string $master_ip

Supermaster IP address

string $ns_name

Hostname of supermaster

Return Value

bool

true on success

array getSupermasters()

Get All Supermasters

Gets an array of arrays of supermaster details

Return Value

array

supermasters detail [master_ip,ns_name,account]s

array getSupermasterInfoFromIp(string $master_ip)

Get Supermaster Info from IP

Retrieve supermaster details from supermaster IP address

Parameters

string $master_ip

Supermaster IP address

Return Value

array

array of supermaster details

bool supermasterExists(string $master_ip)

Check if Supermaster IP address exists

Parameters

string $master_ip

Supermaster IP

Return Value

bool

true if exists, otherwise false

bool supermasterIpNameExists(string $master_ip, string $ns_name)

Check if Supermaster IP Address and NS Name combo exists

Parameters

string $master_ip

Supermaster IP Address

string $ns_name

Supermaster NS Name

Return Value

bool

true if exists, false otherwise

bool updateSupermaster(string $old_master_ip, string $old_ns_name, string $new_master_ip, string $new_ns_name, string $account)

Update Supermaster

Update a trusted supermaster in the global supermasters table

Parameters

string $old_master_ip

Original supermaster IP address

string $old_ns_name

Original hostname of supermaster

string $new_master_ip

New supermaster IP address

string $new_ns_name

New hostname of supermaster

string $account

Account name used for tracking

Return Value

bool

true on success

array getSlaveServerIPs()

Get distinct slave server IP addresses

Return Value

array

List of unique slave server IP addresses

static bool validateAccount(string $account)

Validate Account is valid string

Parameters

string $account

Account name alphanumeric and ._-

Return Value

bool

true is valid, false otherwise