Wild IPv6 Conflict with Name Resolution

tux.jpg

Over the course of the last few days, I've been having problems with getting a certain hostname resolved on my linux workstations at work. Basically, everything was fine until I tried to reference the host chatcentral and then apps like traceroute would hang for 20 sec and then work normally. Ping worked just fine, however. Very odd.

This first came up when I was trying to connect to this host with a simple C++ and Java socket connection. We did the migration to MindAlign recently, and I had written native connection clients to the MindAlign system and when switching over on my development workstation it appeared that the connection was hanging - in reality it was timing out on the hostname resolution. I didn't give it 20 sec, and thought "Hey, it's dead". I figured that when I was using different machines things worked fine, so I did the rest of the migration on those machines. But it was still bothering me, so I came back to it.

What I found with a little bit of Googling was that IPv6 was getting in the way of the normal host name resolution chain. If I put the machine into my /etc/hosts file then all was fast and well. But if I didn't want that, I needed to do something to get rid of the timeouts. With the help of a local Unix admin, we realized that the timeout was on the name lookup for IPv6. From there, it was a simple Google to see that the solution was to add the following line to /etc/modprobe.conf:

    alias ipv6 off

After a reboot, this fixed the problem.

Interestingly, this doesn't seemingly disable IPv6 as ifconfig -a still shows the IPv6 address for eth0, so I'm not sure exactly what's happening, but in this case, where the folks didn't put the hostname in the primary YP server, this really helps.