设置实际上在配置文件中。
OpenJDK 8
使用Docker映像openjdk:8,在没有安全管理器的情况下,该实现使用30秒。
/usr/local/openjdk-8/jre/lib/security/java.security
:
#
# The Java-level namelookup cache policy for successful lookups:
#
# any negative value: caching forever
# any positive value: the number of seconds to cache an address for
# zero: do not cache
#
# default value is forever (FOREVER). For security reasons,this
# caching is made forever when a security manager is set. When a security
# manager is not set,the default behavior in this implementation
# is to cache for 30 seconds.
#
# NOTE: setting this to anything other than the default value can have
# serious security implications. Do not set it unless
# you are sure you are not exposed to DNS spoofing attack.
#
#networkaddress.cache.ttl=-1
OpenJDK 11
使用Docker映像openjdk:11,实现与上面相同。
/usr/local/openjdk-11/conf/security/java.security
:
#
# The Java-level namelookup cache policy for successful lookups:
#
# any negative value: caching forever
# any positive value: the number of seconds to cache an address for
# zero: do not cache
#
# default value is forever (FOREVER). For security reasons,the default behavior in this implementation
# is to cache for 30 seconds.
#
# NOTE: setting this to anything other than the default value can have
# serious security implications. Do not set it unless
# you are sure you are not exposed to DNS spoofing attack.
#
#networkaddress.cache.ttl=-1
在其他一些版本中,它可以位于/ etc下,例如/etc/java-11-openjdk/security/java.security
本文链接:https://www.f2er.com/3151311.html