gethostbyname(3)を使うアプリのホスト名解決にrootの無い人が任意のhostsファイルを使えるの知らんかった。HOSTALIASES環境変数にhostsファイルへのパスを設定しておく。
gethostbyname(3)
> The gethostbyname() function returns a structure of type hostent for the given host name. ... If name doesn't end in a dot and the environment variable HOSTALIASES is set, the alias file pointed to by HOSTALIASES will first be searched for name (see hostname(7) for the file format).