This example uses the normal gethostbyname call to resolve the host name:
#include <nsapi.h> int my_dns_func(pblock *pb, Session *sn, Request *rq) { char *host = pblock_findval("dns-host", rq->vars); struct hostent *hostent; hostent = gethostbyname(host); // replace with custom DNS implementation dns_set_hostent(hostent, sn, rq); return REQ_PROCEED; } |