Failover.CNAME: Fixed issue in GetAnswers() to select only A/AAAA type for health check monitoring.

This commit is contained in:
Shreyas Zare
2024-02-17 17:58:22 +05:30
parent dc5cb68f81
commit 9bb62a8eb9

View File

@@ -58,7 +58,14 @@ namespace Failover
private DnsResourceRecord[] GetAnswers(string domain, DnsQuestionRecord question, string zoneName, uint appRecordTtl, string healthCheck, Uri healthCheckUrl)
{
HealthCheckResponse response = _healthService.QueryStatus(domain, question.Type, healthCheck, healthCheckUrl, true);
DnsResourceRecordType healthCheckRecordType;
if (question.Type == DnsResourceRecordType.AAAA)
healthCheckRecordType = DnsResourceRecordType.AAAA;
else
healthCheckRecordType = DnsResourceRecordType.A;
HealthCheckResponse response = _healthService.QueryStatus(domain, healthCheckRecordType, healthCheck, healthCheckUrl, true);
switch (response.Status)
{
case HealthStatus.Unknown: