EnableDNSLookup
- Last Updated: September 20, 2021
- 1 minute read
- DataDirect Connectors
- JDBC
- MongoDB 6.1
- Documentation
Purpose
Specifies whether the driver performs a DNS lookup to discover member nodes of a cluster when connecting. If the driver discovers cluster nodes in the specified domain, the driver will attempt to connect to an available node.
Valid Values
true | false
Behavior
If set to true, at connection, the driver performs a DNS lookup on the host specified by the ServerName property. When a domain is specified by ServerName, the driver will attempt to discover the nodes of a cluster, then connect to an available node. If you are not connecting to a clustered environment, the driver will connect to the server specified by ServerName.
If set to false, the driver does not attempt to perform a DNS lookup at connection. Instead, it will connect directly to the host specified by the ServerName property. Specify this value if you are not connecting to clustered environment.
Notes
- Setting EnableDNSLookup to
truedoes not prohibit you from connecting to a non-clustered environment; however, the driver will still perform the lookup at connection. To improve connection time, you can disable the lookup (EnableDNSLookup=false) if you are not connecting to a clustered environment.
Data Source Methods
public Boolean getEnableDnsLookup()
public void setEnableDnsLookup(Boolean)
Default Value
true
Data Type
Boolean