Can anyone point me in the right direction, is there currently a way to convert Hostname (DNS name) to an IP Address?
I may have to take code like this and convert it into a blueprint function library or something.
If anyone still sees this, can you help me convert this code to work with Blueprints?
hostent * record = gethostbyname(argv[1]);
if(record == NULL)
{
printf("%s is unavailable
", argv[1]);
exit(1);
}
in_addr * address = (in_addr * )record->h_addr;
string ip_address = inet_ntoa(* address);
IPAddr dst_ip = ::inet_addr( ip_address.c_str() );