firedns.h: always make ipv6 members available in state struct
[rofl0r-firedns.git] / examples / fdnstxtlist.c
blobc4b320f2611cc4abc6ca8df6c4ee5510aad41dc7
1 #include <stdio.h>
2 #include <string.h>
3 #include "../include/firedns.h"
5 int main(int argc, char **argv) {
6 struct firedns_txtlist *iter;
7 firedns_state dns, *d = &dns;
9 if (argc != 2) {
10 fprintf(stderr,"usage: %s <hostname>\n",argv[0]);
11 return 2;
14 firedns_init(d);
15 firedns_add_servers_from_resolv_conf(d);
17 iter = firedns_resolvetxtlist(d, argv[1]);
19 if (iter == NULL)
20 return 1;
22 while (iter != NULL) {
23 printf("%s\n",iter->txt);
24 iter = iter->next;
27 return 0;