Added IPv6 support to cshrc.
Added IPv6 support to bashrc.
Don't re-order the output from getaddrinfo, the sysadmin may have configured this via gai.conf.
Try all IPv4 & IPv6 addresses until one works.