firedns.h: always make ipv6 members available in state struct
[rofl0r-firedns.git] / examples / fdnsmx.c
blob558a71c60305b38f365a7a2c185b2e2c5b1c556b
1 #include <stdio.h>
2 #include <string.h>
3 #include "../include/firedns.h"
5 int main(int argc, char **argv) {
6 char *result;
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 result = firedns_resolvemx(d, argv[1]);
19 if (result != NULL) {
20 printf("%s\n",result);
21 return 0;
24 return 1;