Stuff
public text v1 · immutablestd::string dns(std::string a){
struct hostent *host;
WSADATA wsaData;
if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) {
return "Winsock failed to start up... what did you expect?";
}
if ((host=gethostbyname(a.c_str())) == NULL) { // get the host info
return "Could not get to host for some reason.";
}
return std::string(inet_ntoa(*((struct in_addr *)host->h_addr)));
}