We use DNS health checks for this, Route53 and CLoudFlare have this but it comes at a n additional cost.