watcher: follow a watched name's CNAME for port and TLS checks (closes #203)
check / check (push) Failing after 2m23s

When a watched name's nameservers answer with a CNAME and no address,
the DNS check asks ResolveIPAddresses for the name, which looks it up
again and follows the chain, and saves the addresses at its end in the
hostname state as cnameAddresses. The port and TLS checks use them.
Before, only the A and AAAA records in the answers were used, so a
CNAME into another zone got no port or TLS checks. When following
fails, the addresses the last check saved 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 is contained in:
2026-10-01 23:47:49 +00:00
parent 11ce1b249b
commit 3472c8f4c1
7 changed files with 177 additions and 28 deletions
+4
View File
@@ -53,8 +53,12 @@ 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.
type HostnameState struct {
RecordsByNameserver map[string]*NameserverRecordState `json:"recordsByNameserver"`
CNAMEAddresses []string `json:"cnameAddresses,omitempty"`
LastChecked time.Time `json:"lastChecked"`
}