[JAVA-4018] Driver should ignore NXDomain DNS errors for TXT record lookup Created: 17/Feb/21  Updated: 28/Oct/23  Resolved: 15/Mar/22

Status: Closed
Project: Java Driver
Component/s: Configuration
Affects Version/s: None
Fix Version/s: 4.5.1

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
Related
Case:
Backwards Compatibility: Minor Change
Documentation Changes: Needed

 Description   

When presented with a mongodb+srv-schemed connection string, the driver looks up in DNS any TXT records associated with the host. If none are found, the driver correctly does not throw an exception. However, if the DNS server returns an NXDomain error (error code 3, "Non-Existent Domain), JNDI throws a java.naming.NameNotFoundException, the driver catches it, and throws a com.mongodb.MongoConfigurationException.

The expected behavior is that NXDomain errors are also ignored.



 Comments   
Comment by Jeffrey Yemin [ 23/Mar/22 ]

FYI, 4.5.1 has been released with a fix for this issue.

Comment by Githook User [ 15/Mar/22 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Ignore NXDomain errors when looking up a TXT record (#890)

JAVA-4018
Branch: 4.5.x
https://github.com/mongodb/mongo-java-driver/commit/e9833b31c389d45e0c23cb36beb38c1ad80e1e92

Comment by Githook User [ 15/Mar/22 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Ignore NXDomain errors when looking up a TXT record (#890)

JAVA-4018
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/47fec07b36dc831bd368d63376147c4f4690ff5a

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