Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

invalid IPv6 address

I got the Error Message:

Error occurs in downloading files from ftp Server : ftp://speedtest.tele2.net: invalid IPv6 address

from this lines:

String serverAddress = "ftp://speedtest.tele2.net";
FTPClient ftp = new FTPClient();
ftp.connect(serverAddress);

I dont got a clue what to do about that?

The only advices i got are about this System Propertys, but that didnt solved the problem.

java.net.preferIPv4Stack -> true
java.net.preferIPv6Addresses -> true

Anyone got Advices or Refereces? Thank you very much!

like image 524
AbsolutBeginner Avatar asked Oct 25 '16 12:10

AbsolutBeginner


2 Answers

The site has both IPv6 and IPv4 addresses

$ dig AAAA speedtest.tele2.net -> 2a00:800:1010::1
$ dig A speedtest.tele2.net    -> 90.130.70.73

IPv6 is usually preferred if available. But while the server can be reached at the IPv4 address port 21 it cannot be reached at the IPv6 address, i.e. a inconsistent setup of FTP and DNS.

The error message from Java is confusing since it is actually not the IPv6 address which is bad but it fails to connect to this address.

like image 57
Steffen Ullrich Avatar answered Nov 20 '22 02:11

Steffen Ullrich


Try to use address without "ftp://"

String serverAddress = "speedtest.tele2.net";
like image 38
Salvador One Avatar answered Nov 20 '22 00:11

Salvador One