Dnsip integration: Make refresh time configurable

Monitoring changes to your external IP address is valuable, especially when using multiple gateways, such as:

  • A primary gateway (e.g., fiber or satellite)
  • One or more backup gateways (e.g., LTE modem)

The current DnsIp Integration implementation enforces a 120-second interval between external IP address fetches.

Making this interval configurable via the UI or YAM would enable timely actions, such as sending notifications or alerts when the internet connection degrades.

The combination of DNS caching and the fixed 2-minute delay causes significant lag in detecting changes, delaying alerts.

Allowing a shorter fetch interval would enable faster, more actionable alerts.

Not going to happen.

This interval is so a large number of people can use the integration without abusing the API.

I’m not quite sure what you mean by “abusing the API.”

The integration is super lightweight: It just makes a simple DNS request, like:

dig +short <HOSTNAME> @<DNS_SERVER>

DNS servers are designed to handle a ton of requests without breaking a sweat. For instance, even a small DNS provider like ClouDNS processes up to 750,000 queries per second!

So, even if every Home Assistant user queried the same DNS server every second (which would likely be limited by HA’s own response time anyway), it wouldn’t put any real strain on the remote DNS server. No worries about overwhelming it, unless someone’s launching a DDoS attack with thousands of bots, which is a whole different story!