Sql-server – Multi-Subnet Network Setup

availability-groupssql server

We currently have a 4 Node cluster used for our Availability Groups. 2 nodes in local data center and 2 nodes in remote data center.

Currently the 2 nodes local are Synchronous and the 2 remote nodes are ASynchronous.

They are setup in a multi-subnet network.

We are wanting to make one of the remote nodes Synchronous so that we can manually failover to the remote data center to run production traffic.

Our testing turned up a network issue that we did not think about.

We use DNS aliases to connect to the listener. (ex. product.company.com) that resolves to the primary through the listener IP address. When we failover manually to the remote node the listener IP stays in the local subnet IP.

My question is how can we configure our DNS Alias to automatically resolve to the remote listener to hit the remote as primary with either CNAME or other DNS options.

Below is a crude diagram I tried to work up.

enter image description here

Best Answer

how can we configure our DNS Alias to automatically resolve to the remote listener to hit the remote as primary with either CNAME or other DNS options

So you don't want to configure applications to connect to the AG Listener's Hostname?

If you use a CNAME pointing to the Listener hostname, it should always return both IP addresses, and clients will handle picking between the IP addresses.