Fallback to IPv4 if IPv6 fails

Fixes #181