//会优先查询解析%windir%\system32\drivers\etc\hosts中静态dns表
//一个域名可对应多个IP hostent->h_addr_list ==> 是int*型指针数组, NULL结尾
//填写域名或ip地址字符串会自动识别
//也可用127.0.0.1 取出本机主机名 //取本机所有ip地址
char szLocName[];
::gethostname(szLocName, sizeof szLocName);
hostent* pHostent = ::gethostbyname(szLocName); //取指定域名的ip地址
char* pStrUrl = "www.xxx.com";
hostent* pHostent = ::gethostbyname(pStrUrl); //取指定域名的ip地址
char* pStrUrl = "202.101.172.35";
hostent* pHostent = ::gethostbyname(pStrUrl);