I am trying to get both the IPv4 and IPv6 value of a URL, say 'stackoverflow.com' for example.
Ideally returning the same results as dig stackoverflow.com A stackoverflow.com AAAA +short
I currently have the following, but for me it is only returning the IPv4 address
struct hostent *host_entry = gethostbyname("stackoverflow.com");
char *buff;
buff = inet_ntoa(*((struct in_addr *)host_entry->h_addr_list));