3 #include "../include/firedns.h"
5 int main(int argc
, char **argv
) {
6 struct firedns_txtlist
*iter
;
7 char *spfrecord
= NULL
;
8 firedns_state dns
, *d
= &dns
;
11 fprintf(stderr
,"usage: %s <hostname>\n",argv
[0]);
16 firedns_add_servers_from_resolv_conf(d
);
18 iter
= firedns_resolvetxtlist(d
, argv
[1]);
23 while (iter
!= NULL
) {
24 if (strncmp(iter
->txt
,"v=spf1 ",7) == 0) {
25 if (spfrecord
!= NULL
)
27 spfrecord
= iter
->txt
;
32 if (spfrecord
== NULL
)
35 printf("%s\n",spfrecord
);