This is similar to what exists in ircd, but instead of request ID's, we return struct dns_query pointers (that are freed by the DNS callback, so you don't have to worry about their lifecycle management).