I'm trying to open query.yahooapis.com but curl is trying to use IPV6 even if I only have IPV4 enabled

1

When I try to call query.yahooapis.com with curl it's trying to use the ipv6 address but IPV6 is disabled on my computer

$ curl -v 'http://query.yahooapis.com/'
* Hostname was NOT found in DNS cache
*   Trying 98.137.200.255...
*   Trying 2001:4998:58:2201::1010...
* Immediate connect fail for 2001:4998:58:2201::1010: No route to host
*   Trying 2001:4998:58:2201::1010...
* Immediate connect fail for 2001:4998:58:2201::1010: No route to host
*   Trying 2001:4998:58:2201::1010...
* Immediate connect fail for 2001:4998:58:2201::1010: No route to host
*   Trying 2001:4998:58:2201::1010...
* Immediate connect fail for 2001:4998:58:2201::1010: No route to host

My ifconfig:

$ ifconfig en1
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether b0:34:95:f0:2c:46
        inet 192.168.0.13 netmask 0xffffff00 broadcast 192.168.0.255
        nd6 options=1<PERFORMNUD>
        media: autoselect
        status: active

I'm using Yosemite 10.10.2

Any idea of how to solve this problem?

Dimas Kotvan

Posted 2015-10-05T23:49:34.427

Reputation: 137

Answers

1

In your example curl tried to connect over IPv4 first and only starts trying IPv6 when that fails. I agree that in your case that isn't very useful (you really should find am ISP that offers IPv6) but I wouldn't consider it a problem either as it has already tried IPv4.

Sander Steffann

Posted 2015-10-05T23:49:34.427

Reputation: 4 169

1You are right, it was something related to my use of a VPN connection. When I killed the VPN it started to work again. Thanks – Dimas Kotvan – 2015-10-06T11:14:43.160

1

You can ask curl to use IPv4 explicitly:

curl -4 -v 'http://query.yahooapis.com/'

David Dai

Posted 2015-10-05T23:49:34.427

Reputation: 2 833