Sql-server – AlwaysOn Listener and DNS

availability-groupsdnssql server

We have two DNS servers which replicate entried between them and we recently had a DNS issue where some of the listener addresses were removed from one of the servers only.

At that point some of our connections to AlwaysOn started to fail. My question is, if he SQL server is configured with both DNS servers then shouldn't it have found the entry in the DNS server that still had the entry, or is this something specific to how SQL works?

Best Answer

This is how DNS works with multiple servers the client will ask the servers in a round-robin fashion. if an entry is removed from one of the DNS servers the client will get Non-existent domain as an answer from that server and will not query the other.

Here you can get an overview but it boils down to this

  • The DNS Client service queries the DNS servers in the following order:

    1. The DNS Client service sends the name query to the first DNS server on the preferred adapter’s list of DNS servers and waits one second for a response.
    2. If the DNS Client service does not receive a response from the first DNS server within one second, it sends the name query to the first DNS servers on all adapters that are still under consideration and waits two seconds for a response.
    3. If the DNS Client service does not receive a response from any DNS server within two seconds, the DNS Client service sends the query to all DNS servers on all adapters that are still under consideration and waits another two seconds for a response.
    4. If the DNS Client service still does not receive a response from any DNS server, it sends the name query to all DNS servers on all adapters that are still under consideration and waits four seconds for a response.
    5. If it the DNS Client service does not receive a response from any DNS server, the DNS client sends the query to all DNS servers on all adapters that are still under consideration and waits eight seconds for a response.