존재하는 도메인에 gethostbyname 시에 NULL값이 나올경우

puaxx의 이미지

srv_host=gethostbyname("opendic.naver.com");

srv_host 값이 NULL이 나오네요 몇번을 해봐도 마찬가지루요..왜 그렇죠?

dotri의 이미지

man page wrote:
The gethostbyname() and gethostbyaddr() functions return the hostent structure or a NULL pointer if an error occurs. On error, the h_errno variable holds an error number. When non-NULL, the return value may point at static data, see the notes below.