0

I want to test the REST API on my server with domain blazingsocket.tk

I set up HTTP Request test using JMeter on my local, below is the configuration:

  • Protocol: http
  • Servername or IP: blazingsocket.tk
  • Port: 80

And this is what I received: Non HTTP response code:java.net.UnknownHostException

I changed the "servername or IP" to my server public IP then it works.

I turned off the firewall on server, nginx web server -> No help.

Web browser and postman are able to resolve the hostname so I don't think DNS had any problem.

Could you explain why?

1 Answers1

0

The only reason I can think of is that Java is trying to match DNS hostname with the IP address using IPv6 stack and fails somewhere somehow.

The solutions are in:

  1. Update Java to the most recent version
  2. Force Java to use IPv4 stack, i.e. run JMeter like:

    ./jmeter -Djava.net.preferIPv4Stack=true ....
    

    if it helps you can make the change permanent by adding the next line to system.properties file (lives in "bin" folder of your JMeter installation)

    java.net.preferIPv4Stack=true 
    

    JMeter restart will be required to pick the property up

References:

Dmitri T
  • 551
  • 2
  • 2