This is not quite the way @Candide writes that there is no event in DNS . In particular, for notification of change.
If you manage a DNS server, you can configure it to send NOTIFY messages to you as a client. Such messages (not guaranteed, but most often) are sent whenever the authoritative DNS server wants the slave servers to update the contents of the zone. Then you could respond to them as you prefer. Most DNS server implementations seem to send NOTIFY messages to the listed name servers by default, but can also be configured to send them to other hosts (for example, in BIND 9 this is done using the also-notify {} directive in the zone configuration) .
I'm not sure how you implement it; NOTIFY is part of the DNS protocol, so you should essentially write a limited-purpose DNS server implementation in order to listen and execute these messages. At the very least, you will need to control port 53 on UDP and TCP (I'm sure that notifications are almost always sent to UDP in practice, but the standard also allows TCP transport), sort any NOTIFY messages received.
In addition, since they are not guaranteed, you also need a backup mechanism.
Whether this is a viable option depends entirely on the situation.
source share