[GODRIVER-1476] mongodb+srv doesn't work with a fully qualified DNS name Created: 27/Jan/20  Updated: 28/Oct/23  Resolved: 29/Jan/20

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: 1.1.4
Fix Version/s: 1.3.0

Type: Bug Priority: Major - P3
Reporter: Wesley Spikes Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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.



 Comments   
Comment by Divjot Arora (Inactive) [ 29/Jan/20 ]

Closing as the user PR has been merged.

Comment by Githook User [ 29/Jan/20 ]

Author:

{'username': 'SpikesDivZero', 'name': 'Spikes', 'email': 'wesley.spikes@gmail.com'}

Message: GODRIVER-1476: Support fully qualified SRV DNS names (#285)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/162084c8f92be9dab91a062bd169251c1fc3d560

Comment by Wesley Spikes [ 27/Jan/20 ]

PR for consideration: https://github.com/mongodb/mongo-go-driver/pull/285

Generated at Thu Feb 08 08:36:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.