Sample Header Ad - 728x90

WGet fails to download with an IPv6 address

0 votes
1 answer
584 views
When I try to download something with WGet, usually it fails if the domain name is translated to an IPv6 address. That happens more often when there's a link redirection. For example: $ wget --inet6-only Image --2022-11-13 10:27:05-- Image Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8001::154, 2606:50c0:8000::154, 2606:50c0:8003::154, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8001::154|:443... --- $ wget --inet6-only https://download.docker.com/linux/centos/9/x86_64/stable/Packages/docker-ce-20.10.21-3.el9.x86_64.rpm --2022-11-13 10:32:52-- https://download.docker.com/linux/centos/9/x86_64/stable/Packages/docker-ce-20.10.21-3.el9.x86_64.rpm Resolving download.docker.com (download.docker.com)... 2600:9000:21ed:e000:3:db06:4200:93a1, 2600:9000:21ed:2e00:3:db06:4200:93a1, 2600:9000:21ed:7000:3:db06:4200:93a1, ... Connecting to download.docker.com (download.docker.com)|2600:9000:21ed:e000:3:db06:4200:93a1|:443... In the first example, the raw.githubusercontent.com name is resolved to 2606:50c0:8001::154, 2606:50c0:8000::154, 2606:50c0:8003::154. Then, WGget tries to connect to this IP and nothing else happens, just freezes. No download is made. The same happens to the second example, download.docker.com. When I force an IPv4 connection, it downloads the content successfully. $ wget --inet4-only Image --2022-11-13 10:28:16-- Image Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.108.133, 185.199.110.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 24872 (24K) [image/png] Saving to: ‘ebay.png’ ebay.png 100%[==================================================================================>] 24.29K --.-KB/s in 0.005s 2022-11-13 10:28:16 (4.48 MB/s) - ‘ebay.png’ saved [24872/24872] --- $ wget --inet4-only https://download.docker.com/linux/centos/9/x86_64/stable/Packages/docker-ce-20.10.21-3.el9.x86_64.rpm --2022-11-13 10:34:35-- https://download.docker.com/linux/centos/9/x86_64/stable/Packages/docker-ce-20.10.21-3.el9.x86_64.rpm Resolving download.docker.com (download.docker.com)... 52.84.83.27, 52.84.83.65, 52.84.83.79, ... Connecting to download.docker.com (download.docker.com)|52.84.83.27|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 21654080 (21M) [binary/octet-stream] Saving to: ‘docker-ce-20.10.21-3.el9.x86_64.rpm’ docker-ce-20.10.21-3.el9.x86_64.rpm 100%[==================================================================================>] 20.65M 27.3MB/s in 0.8s 2022-11-13 10:34:36 (27.3 MB/s) - ‘docker-ce-20.10.21-3.el9.x86_64.rpm’ saved [21654080/21654080] Why is WGet failing with IPv6?
Asked by markfree (425 rep)
Nov 13, 2022, 01:45 PM
Last activity: Feb 1, 2025, 11:40 AM