Networking Properties (original) (raw)
System Properties
See Network System Propertiesfor a list of system properties used to alter the mechanisms and behavior of the various classes of the [java.net](../../../api/java/net/package-summary.html)
package.
JDK Implementation-Specific Properties
These properties may not be supported in future releases.
sun.net.inetaddr.ttl
This is a Oracle JDK private system property that corresponds tonetworkaddress.cache.ttl
. It takes the same value and has the same meaning, but can be set as a command-line option. However, the preferred way is to use the security propertynetworkaddress.cache.ttl
.sun.net.inetaddr.negative.ttl
This is a Oracle JDK private system property that corresponds tonetworkaddress.cache.negative.ttl
. It takes the same value and has the same meaning, but can be set as a command-line option. However, the preferred way is to use the security propertynetworkaddress.cache.negative.ttl
.sun.net.client.defaultConnectTimeout
(default:-1
)sun.net.client.defaultReadTimeout
(default:-1
)
These properties specify the default connect and read timeout, respectively, for the protocol handler used byjava.net.URLConnection
.sun.net.client.defaultConnectTimeout
specifies the timeout (in milliseconds) to establish the connection to the host. For example for HTTP connections, it is the timeout when establishing the connection to the HTTP server. For FTP connections, it is the timeout when establishing the connection to FTP servers.sun.net.client.defaultReadTimeout
specifies the timeout (in milliseconds) when reading from input stream when a connection is established to a resource.sun.net.http.retryPost
(default:true
)
It determines if an unsuccessful HTTP POST request will be automatically resent to the server. Unsuccessful in this case means the server did not send a valid HTTP response or anIOException
occurred.
JNDI DNS Service Provider Settings
These properties may not be supported in future releases.
sun.net.spi.nameservice.provider.<n>=<default|dns,sun|...>
Specifies the name service provider that you can use. By default, the JDK will use the system configured name lookup mechanism, such asfile
,nis
, etc. You can specify your own by setting this option.<n>
takes the value of a positive number. It indicates the precedence order. A smaller number takes higher precedence over a bigger number. Aside from the default provider, the JDK includes a DNS provider nameddns,sun
.
Providers are chained, which means that if a lookup on a provider fails, the next provider in the list is consulted to resolve the name.sun.net.spi.nameservice.nameservers=<server1_ipaddr,server2_ipaddr ...>
You can specify a comma-separated list of IP addresses that point to the DNS servers you want to use. If thesun.net.spi.nameservice.nameservers property
is not defined, then the provider will use any name servers already configured in the platform DNS configuration.sun.net.spi.nameservice.domain=<domainname>
This property specifies the default DNS domain name, for instance,eng.example.com
. If thesun.net.spi.nameservice.domain
property is not defined then the provider will use any domain or domain search list configured in the platform DNS configuration.