Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2518

Dns resolver only uses first DNS server.

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 2.10.3
    • 2.7.3
    • Connectivity
    • all

    Description

      when connecting, the c# client uses the System.DnsClient.LookupClient to resolve srv records.

      When you have multiple dns servers configured, it only uses the first.

      This is the default behavior of the LookupClient.

      Correct way to do it would be something like:

      var lookupClient = new LookupClient();
       
      foreach (var dnsserver in lookupClient.NameServers)
      {
          var response = lookupClient.Query("_mongodb._tcp." + host, QueryType.SRV, QueryClass.IN);
          if (!response.HasError)
              break;
      }
      

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            basiep Bas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: