Unify DOMAINS and HOSTNAMES into a single TARGETS config #10

Closed
opened 2026-02-20 05:04:45 +01:00 by clawbot · 0 comments
Collaborator

Currently users must manually split their DNS names into two env vars:

  • DNSWATCHER_DOMAINS for apex domains
  • DNSWATCHER_HOSTNAMES for subdomains

This is unnecessary since dnswatcher already needs the Public Suffix List to determine the parent domain for NS lookups. It should accept a single list and classify automatically:

  • DNSWATCHER_TARGETS=example.com,www.example.com,api.example.org
  • Use the PSL (golang.org/x/net/publicsuffix) to determine: is this an apex domain (eTLD+1) or a hostname under one?
  • Apex domains get NS monitoring
  • Hostnames get per-NS record monitoring
  • Both get port and TLS checks

This simplifies configuration and eliminates a source of user error (putting an apex in HOSTNAMES or vice versa).

Deprecate DNSWATCHER_DOMAINS and DNSWATCHER_HOSTNAMES in favor of DNSWATCHER_TARGETS. Keep the old vars working for backwards compat but log a deprecation warning.

Also use publicsuffix.EffectiveTLDPlusOne() in the resolver's parentDomain() function instead of the current naive 2-label split (which breaks for .co.uk, .com.au, etc.).

Currently users must manually split their DNS names into two env vars: - `DNSWATCHER_DOMAINS` for apex domains - `DNSWATCHER_HOSTNAMES` for subdomains This is unnecessary since dnswatcher already needs the Public Suffix List to determine the parent domain for NS lookups. It should accept a single list and classify automatically: - `DNSWATCHER_TARGETS=example.com,www.example.com,api.example.org` - Use the PSL (`golang.org/x/net/publicsuffix`) to determine: is this an apex domain (eTLD+1) or a hostname under one? - Apex domains get NS monitoring - Hostnames get per-NS record monitoring - Both get port and TLS checks This simplifies configuration and eliminates a source of user error (putting an apex in HOSTNAMES or vice versa). Deprecate `DNSWATCHER_DOMAINS` and `DNSWATCHER_HOSTNAMES` in favor of `DNSWATCHER_TARGETS`. Keep the old vars working for backwards compat but log a deprecation warning. Also use `publicsuffix.EffectiveTLDPlusOne()` in the resolver's `parentDomain()` function instead of the current naive 2-label split (which breaks for `.co.uk`, `.com.au`, etc.).
sneak was assigned by clawbot 2026-02-20 05:04:45 +01:00
sneak closed this issue 2026-02-20 09:05:00 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/dnswatcher#10
No description provided.