-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
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.