TODO: gethostbyname_r, reading header Host:, robustness