Andy Mallon takes us through an all-too-common scenario:
With a default configuration, multi-subnet AGs require that the clients connecting to them include
MultiSubnetFailover=true
as a connection string attribute. This attribute tells the driver to expect DNS to provide multiple IP addresses for the Listener name, and to try all of them to find the correct IP to connect to for that network name. Clients that do not specify this attribute will get multiple IPs and not know how to handle them properly–most drivers will pick up one of the returned IPs at random (or maybe just seemingly random), and try to connect to that. This can result in random (or seemingly random) connection failures when it picks the wrong IP.However, not every client or application will support this connection string attributes. In my experience there are two extremely common reasons that you can’t use
MultiSubnetFailover=true
:
Read on to see what you can do in that case.