Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1476

mongodb+srv doesn't work with a fully qualified DNS name

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.0
    • Affects Version/s: 1.1.4
    • Component/s: None
    • None

      A DNS name is fully qualified if the name ends with a dot.

      We expected that a fully qualified DNS name would work with mongo-go-driver, in the same way that an unqualified name would:

      mongodb+srv://internal.mongos-main.svc.svc.our.company.tld./?valid=opts
      

      Unfortunately, we get an error in this case:

      error parsing uri: Domain suffix from SRV record not matched input domain
      

      The SRV record is indeed valid:

      ; <<>> DiG 9.10.6 <<>> SRV _mongodb._tcp.internal.mongos-main.svc.our.company.tld.
      ;; global options: +cmd
      ;; Got answer:
      ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60004
      ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 13, ADDITIONAL: 3
      
      ;; OPT PSEUDOSECTION:
      ; EDNS: version: 0, flags:; udp: 4096
      ;; QUESTION SECTION:
      ;_mongodb._tcp.internal.mongos-main.svc.our.company.tld. IN SRV
      
      ;; ANSWER SECTION:
      _mongodb._tcp.internal.mongos-main.svc.our.company.tld. 5 IN SRV 0 50 27017 internal-796c7f96b7-kdjqf.internal.mongos-main.svc.our.company.tld.
      _mongodb._tcp.internal.mongos-main.svc.our.company.tld. 5 IN SRV 0 50 27017 internal-796c7f96b7-k488c.internal.mongos-main.svc.our.company.tld.
      
      ;; ADDITIONAL SECTION:
      internal-796c7f96b7-kdjqf.internal.mongos-main.svc.our.company.tld. 5 IN A 10.1.1.148
      internal-796c7f96b7-k488c.internal.mongos-main.svc.our.company.tld. 5 IN A 10.1.1.83
      

      And the driver does otherwise work if we drop the trailing dot.

            Assignee:
            Unassigned Unassigned
            Reporter:
            wesley.spikes@gmail.com Wesley Spikes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: