0

We have a cluster SQL Server and we use a SRV DNS entry to locate the service (i.e sql.mycompany.com).

MyCompany.com_tcp_http Service Location (SRV) [0][0][1433]sql.Mycompany.com

Now, how I can use the .NET SQLConnection to use this dns name (instead of the server name/IP)? Any ideas?
Should I use System.Net.Dns to translate it first?

David Ansermot
  • 6,052
  • 8
  • 47
  • 82
No hay Problema
  • 853
  • 1
  • 10
  • 14

1 Answers1

-1

A .NET SQLConnection will not look up SRV records, only A records.

So yes, you will need to query your SRV record using System.Net.Dns yourself, parse and use the result in your connection string.

nos
  • 223,662
  • 58
  • 417
  • 506