Curl with ipv6 not working by default

It is not a problem with resolving IPv6 addresses. That name resolution is working fine because curl reports that it cannot reach network 2800:3f0:4001:806::1005; this shows that the name translation did succeed. This is different than an error in name lookup:

 $ curl -6 http://does.not.exist.foo.
 curl: (6) Couldn't resolve host 'does.not.exist.foo.'

In order to reach an IPv6 address, you need to have a route to the destination address and very few connections have any IPv6 connectivity at all. On the machine I'm writing this, I have almost no v6 routes at all:

$ route -A inet6
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
fe80::/64                      ::                         U    256 0     0 wlan0
ff00::/8                       ::                         U    256 0     0 wlan0

which says you I know how to reach my local network and nothing more. Contrast this with my IPv4 routes

$ route -n 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0
…

which shows I've got one very critical bit of routing information. I know how to get to anywhere that I don't have an explicit route to by handing the packet to my default router at 192.168.1.1.

Your name resolution is working just fine. You do need an IPv6 route to the destination network and too few places provide that facility yet.

Tags:

Ubuntu

Curl

Ipv6