replace gethostbyname with gethostbyname2

Debian bug: #305062