[CDRIVER-2556] mongodb+srv not following CNAME records Created: 18/Mar/18  Updated: 27/Oct/23  Resolved: 12/Apr/18

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jeroen Ooms [X] Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

When looking up the TXT record, mongo-c-driver does not follow CNAME records. Is this intentional or overlooked? For example I have the following CNAME:

CNAME mongo.opencpu.org -> cluster0-84vdt.mongodb.net

However connecting to mongodb+srv://cluster0-84vdt.mongodb.net/test does not work. Manually looking up the TXT record with dig or host works fine:

host -t txt mongo.opencpu.org
mongo.opencpu.org is an alias for cluster0-84vdt.mongodb.net.
cluster0-84vdt.mongodb.net descriptive text "authSource=admin&replicaSet=Cluster0-shard-0"



 Comments   
Comment by April Schoffer [ 13/Jan/20 ]

CNames were prohibited here: https://github.com/mongodb/specifications/commit/3c1ff124ce47fa7b5d97b336028e575efd0e3d1e

Comment by A. Jesse Jiryu Davis [ 12/Apr/18 ]

We'll reopen if the linked SPEC ticket is resolved and requires a change to libmongoc behavior.

Comment by A. Jesse Jiryu Davis [ 22/Mar/18 ]

Waiting for a design decision.

Comment by A. Jesse Jiryu Davis [ 18/Mar/18 ]

Interesting, thanks for reporting this. The mongodb+srv URI feature is specified here, but we don't specify whether to follow CNAMEs or not:

https://github.com/mongodb/specifications/blob/master/source/initial-dns-seedlist-discovery/initial-dns-seedlist-discovery.rst

I'll begin a discussion among my colleagues about what the intended behavior is.

Comment by Jeroen Ooms [X] [ 18/Mar/18 ]

Sorry typo in the above. Connecting to mongodb+srv://mongo.opencpu.org/test does not work.

Generated at Wed Feb 07 21:15:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.