I suspect the host's IP address in DNS doesn't match the value in /etc/hosts. In the original post, I assume that the hostname -i IP address was the correct one, is that right? In that case, if there is no /etc/FT_HOSTS file, then I am confused.
If you really wanted to get to the bottom of it, you could have run
> strace ./ft_gethostbyname <hostname>
and compare the search path for the name resolution against that of
> strace hostname -i
and see where they diverge. They should be indentical if you have no FT_HOSTS file.