Code Monkey home page Code Monkey logo

Comments (6)

pvalsecc avatar pvalsecc commented on June 30, 2024

Why would that impact us? We are using OpenJDK.
And have a look at that: https://bugs.openjdk.java.net/browse/JDK-7167189

from docker-tomcat-logback.

Niemi avatar Niemi commented on June 30, 2024

Thanks for your reply. i tried similar code and both cases works:
#---------# user@721f1dde2d33:/usr/local/tomcat$ java -Dsun.net.inetaddr.ttl=1 GetIpAddress www.cnn.com/151.101.1.67 www.cnn.com/151.101.65.67 www.cnn.com/151.101.129.67 www.cnn.com/151.101.193.67 www.cnn.com/151.101.1.67 www.cnn.com/151.101.65.67 www.cnn.com/151.101.129.67 www.cnn.com/151.101.193.67 www.cnn.com/151.101.1.67 www.cnn.com/151.101.65.67 www.cnn.com/151.101.129.67 www.cnn.com/151.101.193.67 www.cnn.com/151.101.1.67 www.cnn.com/151.101.65.67 www.cnn.com/151.101.129.67 www.cnn.com/151.101.193.67 #---------# user@721f1dde2d33:/usr/local/tomcat$ java -Dnetworkaddress.cache.ttl=1 GetIpAddress www.cnn.com/151.101.1.67 www.cnn.com/151.101.65.67 www.cnn.com/151.101.129.67 www.cnn.com/151.101.193.67 www.cnn.com/151.101.1.67 www.cnn.com/151.101.65.67 www.cnn.com/151.101.129.67 www.cnn.com/151.101.193.67 www.cnn.com/151.101.1.67 www.cnn.com/151.101.65.67 www.cnn.com/151.101.129.67 www.cnn.com/151.101.193.67 www.cnn.com/151.101.1.67 www.cnn.com/151.101.65.67 www.cnn.com/151.101.129.67 www.cnn.com/151.101.193.67 www.cnn.com/151.101.1.67 www.cnn.com/151.101.65.67 www.cnn.com/151.101.129.67 www.cnn.com/151.101.193.67 #---------# user@721f1dde2d33:/usr/local/tomcat$ java -version openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment (build 11.0.2+9-Debian-3bpo91) OpenJDK 64-Bit Server VM (build 11.0.2+9-Debian-3bpo91, mixed mode, sharing)

from docker-tomcat-logback.

pvalsecc avatar pvalsecc commented on June 30, 2024

networkaddress.cache.ttlis not a system property. It's a security property. So you cannot pass it with a -D, but must be modified in <java-home>/lib/security/java.security.
Maybe it's taken from the JAVA_OPTS variable?

from docker-tomcat-logback.

Niemi avatar Niemi commented on June 30, 2024

JAVA_OPTS has not any similar options. It is not an issue, we cant just close it. Thanks.
user@721f1dde2d33:/usr/local/tomcat$ env |grep "JAVA_" && fgrep -r "ttl" /docker-java-home/lib/security/ || echo "not found" JAVA_HOME=/docker-java-home JAVA_VERSION=11.0.1 JAVA_DEBIAN_VERSION=11.0.1+13-2~bpo9+1 not found

from docker-tomcat-logback.

pvalsecc avatar pvalsecc commented on June 30, 2024

I don't understand your commands. Here is what I see:

root@cd613fee7558:/etc/java-11-openjdk/security# grep ttl java.security 
#networkaddress.cache.ttl=-1
networkaddress.cache.negative.ttl=10

So it's not set in the java.security file. But, we have that:

# env | grep ttl
JAVA_OPTS=-Dsun.net.inetaddr.ttl=30

from docker-tomcat-logback.

Niemi avatar Niemi commented on June 30, 2024

I set wrong path for fgrep. for now the output is the same:

user@721f1dde2d33:/usr/local/tomcat$ env |grep "JAVA_" && fgrep -r "ttl" /etc/java-11-openjdk/security/java.security || echo "not found"
JAVA_HOME=/docker-java-home
JAVA_VERSION=11.0.1
JAVA_DEBIAN_VERSION=11.0.1+13-2~bpo9+1
#networkaddress.cache.ttl=-1
networkaddress.cache.negative.ttl=10

So, if ttl is set to 10 seconds, then as i understand DNS Resource Record will be cached for 10 seconds.

For my code, i tried both parameters -Dsun.net.inetaddr.ttl=1 and -Dnetworkaddress.cache.ttl=1 got different IP addresses on output.

for (int i=1; i<25; i++ ) {
for (InetAddress ipAddress : inetAddresses) {
System.out.println(ipAddress);
}
Thread.sleep(1000);

from docker-tomcat-logback.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.