Jump to content

java.net.UnknownHostException: libraries.minecraft.net


Dyp1xy

Recommended Posts

Downloading library from https://libraries.minecraft.net/commons-io/commons-io/2.4/commons-io-2.4.jar
java.net.UnknownHostException: libraries.minecraft.net
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:560)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:666)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:531)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:636)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:378)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1241)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1127)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1661)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1585)
at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:529)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:308)
at net.minecraftforge.installer.DownloadUtils.getConnection(DownloadUtils.java:243)
at net.minecraftforge.installer.DownloadUtils.download(DownloadUtils.java:184)
at net.minecraftforge.installer.DownloadUtils.download(DownloadUtils.java:174)
at net.minecraftforge.installer.DownloadUtils.downloadLibrary(DownloadUtils.java:159)
at net.minecraftforge.installer.actions.Action.downloadLibraries(Action.java:89)
at net.minecraftforge.installer.actions.ServerInstall.run(ServerInstall.java:114)
at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:128)

forge-1.19.2-43.2.4-installer, i did something wrong? i strongly believe that the problem is the minecraft site this time, but did not found anything supporting this view

Link to comment
Share on other sites

In order to root out one of the more common issues, we'll need to see your hosts file. Here's the steps to getting this file.

1) Press the Win + R key on your keyboard.

2) Paste the following into the prompt that opens: notepad %windir%\system32\drivers\etc\hosts

3) Use Ctrl+A to select everything in the file, then Ctrl+C into the textbox to post to this thread.

Link to comment
Share on other sites

Just now, ChampionAsh5357 said:

Isn't your host address supposed to be 127.0.0.1?

i think it's because 127.0.0.1 is reserved for loopback only, gonna change it real quick and see if there's a difference

 

edit: nop, no difference, same error tho

Edited by Dyp1xy
Link to comment
Share on other sites

$ ping libraries.minecraft.net
ping: libraries.minecraft.net: Name or service not known

but

ping minecraft.net
PING minecraft.net (108.158.145.65) 56(84) bytes of data.
64 bytes from server-108-158-145-65.gru3.r.cloudfront.net (108.158.145.65): icmp_seq=1 ttl=247 time=11.1 ms
64 bytes from 65.145.158.108.in-addr.arpa (108.158.145.65): icmp_seq=2 ttl=247 time=11.4 ms

 

Link to comment
Share on other sites

i disabled ipv6 and tried, same error, then forced ipv4 with "IPV4 is required for this connection" option, nothing changed. I strongly believe my network or my pc is causing it, gonna try it on another pc on the same network and see the result

Edited by Dyp1xy
Link to comment
Share on other sites

Just now, ChampionAsh5357 said:

Currently throwing this over to the discord to see if they have any new ideas since I've run out. One of them suggested seeing if your Java version is out of date (e.g. at least latest Java 8 for the launcher, but recommended Java 17 since that's what 1.19.2 uses).

First thing i tried, using openjdk 19 and 8, gonna try openjdk 17 and see if there's any difference, this is kinda frustrating, i searched the error and tried a lot of things, including changing environmental variables of HOSTNAME and all, i have no idea what the fuck is the problem and already has passed 9 days (not full time trying to solve but still annoying).

Link to comment
Share on other sites

Just now, Dyp1xy said:

nop, tried with openjdk 11, 17, 8 and 19, i think it could be my router for some reason blocking the connection

 

btw, it's not OS problem, i tried on the Windows i have on dual boot

Edited by Dyp1xy
Link to comment
Share on other sites

Ok i have no idea what is the problem tbh, but i found a solution that i should had done earlier, i connected to a VPN and tried again, everything worked, server successfully installed.

i thought it could be regional block, but i reside in Brazil, maybe problem is the mirror?

Edited by Dyp1xy
Link to comment
Share on other sites

9 minutes ago, Dyp1xy said:

i thought it could be regional block, but i reside in Brazil, maybe problem is the mirror?

Potentially? Though usually the vpn infers there's something wrong with the traffic between the two, so I don't know. You would need to verify that the network isn't the issue using a separate network before then.

  • Like 1
Link to comment
Share on other sites

16 hours ago, ChampionAsh5357 said:

Potentially? Though usually the vpn infers there's something wrong with the traffic between the two, so I don't know. You would need to verify that the network isn't the issue using a separate network before then.

yeah, words cannot describe my confusion, i tested installing on a pc in my workplace, two blocks away, and works fine, my router fucked up? idk, just in case it happens to future people:

 

use a vpn to install, and stop using when you start the server.

Link to comment
Share on other sites

  • 4 months later...

HI there! I know this is a dead thread, but I wanted to throw in my 2 cents since this is the thread which popped up when i searched for the issue. 

I was having this exact issue- unable to download a file via the launcher, cant ping libraries.minecraft.net, but could ping minecraft.net.

Turns out the DNS server my computer was automagically getting assigned was borked. What fixed it was:

  1. going to my 'network connections' in control panel
  2. right clicking the adapter I'm using (wifi, in my case), and selecting properties
  3. click the IPV4 property, then select the properties button
  4. In this screen, select the 'use the following DNS server addresses' radio button, then enter the following 2 DNS server IDs without the quotes
    1.      "1.1.1.1" - thats the BetterDNS IP
    2.      "8.8.8.8" - thats Google's DNS address
  5. after applying these settings, i was immediately able to ping libraries.minecraft.net, and the launcher could download all necessary files to launch mincraft, and the forge version i wanted

 

eklztwj.png0e2AVU2.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.