C.5. Read/write master-capable backends

In order to be a useful master for a domain, notifies must be sent out whenever a domain is changed. Periodically, PDNS queries backends for domains that may have changed, and sends out notifications for slave nameservers.

In order to do so, PDNS calls the getUpdatedMasters() method. Like the getUnfreshSlaveInfos() function mentioned above, this should add changed domain names to the vector passed.

The following excerpt from the DNSBackend shows the relevant functions:

	  class DNSBackend {
	  public:
           /* ... */
	   virtual void getUpdatedMasters(vector<DomainInfo>* domains);
	   virtual void setNotifed(int id, u_int32_t serial);
           /* ... */
	 }
	

These functions all have a default implementation that returns false - which explains that these methods can be omitted in simple backends. Furthermore, unlike with simple backends, a slave capable backend must make sure that the 'DNSBackend *db' field of the SOAData record is filled out correctly - it is used to determine which backend will house this zone.

void getUpdatedMasters(vector<DomainInfo>* domains)

When called, the backend should examine its list of master domains and add any changed ones to the DomainInfo vector

bool setNotified(int domain_id, u_int32_t serial)

Indicate that notifications have been queued for this domain and that it need not be considered 'updated' anymore