서버에서 wget-1.16
완료하는 데 8분이 소요됩니다 .
$ wget http://http.debian.net/debian/dists/stable/Release -O -
--2017-06-12 23:44:40-- http://http.debian.net/debian/dists/stable/Release [4693/5569]
Resolving http.debian.net (http.debian.net)... 2001:4f8:1:c::15, 2605:bc80:3010:b00:0:deb:166:202, 2001:610:1908:b000::148:14, ...
Connecting to http.debian.net (http.debian.net)|2001:4f8:1:c::15|:80... failed: Connection timed out.
Connecting to http.debian.net (http.debian.net)|2605:bc80:3010:b00:0:deb:166:202|:80... failed: Connection timed out.
Connecting to http.debian.net (http.debian.net)|2001:610:1908:b000::148:14|:80... failed: Connection timed out.
Connecting to http.debian.net (http.debian.net)|140.211.166.202|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://cdn-fastly.deb.debian.org/debian/dists/stable/Release [following]
--2017-06-12 23:51:02-- http://cdn-fastly.deb.debian.org/debian/dists/stable/Release
Resolving cdn-fastly.deb.debian.org (cdn-fastly.deb.debian.org)... 2a04:4e42:3::204, 151.101.12.204
Connecting to cdn-fastly.deb.debian.org (cdn-fastly.deb.debian.org)|2a04:4e42:3::204|:80... failed: Connection timed out.
Connecting to cdn-fastly.deb.debian.org (cdn-fastly.deb.debian.org)|151.101.12.204|:80... connected.
...
IPv6 주소를 사용하여 연결을 시도하고 있기 때문입니다. curl-7.38.0
동일한 시스템에서 즉각적인 응답. IPv4 주소를 사용하기 때문입니다. 도메인을 다르게 구문 분석합니까? 그들은 어떻게 했나요? wget
IPv4 주소를 사용하는 방법은 무엇입니까 ?
UPD
$ ip a
...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether d8:cb:8a:37:cf:57 brd ff:ff:ff:ff:ff:ff
inet 188.40.99.4/26 brd 188.40.99.63 scope global eth0
valid_lft forever preferred_lft forever
inet6 2a01:4f8:100:738b::2/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::dacb:8aff:fe37:cf57/64 scope link valid_lft forever preferred_lft forever
$ ip route
default via 188.40.99.1 dev eth0
10.0.0.0/24 dev br0 proto kernel scope link src 10.0.0.1
188.40.99.0/26 via 188.40.99.1 dev eth0
188.40.99.0/26 dev eth0 proto kernel scope link src 188.40.99.4
답변1
curl
그리고 wget
도메인을 확인하기 위해 다른 메커니즘을 사용하지 마십시오(사용 중인 getaddrinfo()
). 그러나 curl
IPv6 연결 상태가 좋지 않은 경우 사용자 환경을 개선하기 위해 빠른 대체 알고리즘이 구현되었습니다.
알고리즘은 RFC 6555(Happy Eyeballs)에 자세히 설명되어 있습니다.https://www.rfc-editor.org/rfc/rfc6555
이에 따르면 curl/lib/connect.h
시간 초과는 200ms로 설정됩니다.https://github.com/curl/curl/blob/a8e523f086c12e7bb9acb18d1ac84d92dde0605b/lib/connect.h#L43
curl
둘 다 IPv4 또는 IPv6에 각각 강제로 연결하는 / 옵션을 wget
지원합니다 .-4
-6