If your an avid linux user, then you probably know what Proftp is. Proftp is a service which allows users (including yourself) to ftp into your server.

After a recent server upgrade, the daemon which runs proftp (proftpd) gave me some errors on restart. When I restarted proftp, I received the following error printed to the screen:
IPv6 getaddrinfo 'home.ben-herman.com' error: Name or service not known

As you can see from the above error message, the server uses a domain name ‘ben-herman.com’. The server is located on the subdomain home.ben-herman.com. Don’t try to access it though, as I have it securely protected from the rest of the world.

The tricky part was that although I received an error every time the daemon started, proftp was still able to run. However it ran very slow. Alternatively, if there was an IPv4 problem, proftp would not have been able to start. I explain this in more detail towards the end of the post.

It took me a bit of figuring out, but eventually I solved it with a simple line of text.

This particular server runs ubuntu, if you are running a different flavor of linux, the path to your host file maybe different.

Here’s what you should do if you run into the same problem:

1) vi hosts **(my path is /etc/hosts)

2) add the line (without quotes) “::1 localhost home.ben-herman.com localhost” **(Be sure to change home.ben-herman.com to whatever the domain of your server is)**

3) save your hosts file, and voila! You’re done. Simply issue a restart command for proftpd, and you’re all set.

The reason that this fixes the problem is because previously we had not fully set the IPv6 settings in the hosts file. The standard line of “www.xxx.y.zzz home.ben-herman.com home” which you would have had set correctly to get this far, accommodates the IPv4 settings. By having the “::1” instead of the IP address, you are letting linux know that the following setting is for IPv6, not IPv4. Had you received an error about IPv4, proftpd would not have started, and the issue would have most likely resided in the beginning of your hosts file.

I hope this was helpful, and if you have any linux questions feel free to contact me through the contact form on Mad Fish Info website.

Thanks for Reading, -Ben