watcher: follow a watched name's CNAME for port and TLS checks (closes #203)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
When a watched name's nameservers answer with a CNAME and no address, the DNS check follows every target they gave with ResolveIPAddresses and saves all addresses found as cnameAddresses in the hostname state, so nameservers disagreeing on the target do not change them between checks. Port and TLS checks use them. A change, also from or to none, is notified as a CNAME address change; the first check from a state file without them sends none. When a target cannot be followed, or none of the name's nameservers answered, the last check's addresses are kept. The domain check now runs the hostname check for the apex instead of a copy of it. Model: opus-5-5
This commit was merged in pull request #209.
This commit is contained in:
@@ -53,8 +53,13 @@ type NameserverRecordState struct {
|
||||
}
|
||||
|
||||
// HostnameState holds per-nameserver monitoring state for a hostname.
|
||||
// CNAMEAddresses holds the sorted addresses at the end of the name's
|
||||
// CNAME chain, found when its nameservers answered with a CNAME and no
|
||||
// address; it is empty otherwise. It is nil when they are not known: a
|
||||
// state file written before it existed loads with it nil.
|
||||
type HostnameState struct {
|
||||
RecordsByNameserver map[string]*NameserverRecordState `json:"recordsByNameserver"`
|
||||
CNAMEAddresses []string `json:"cnameAddresses"`
|
||||
LastChecked time.Time `json:"lastChecked"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user