aboutsummaryrefslogtreecommitdiff
path: root/dnsq.c
diff options
context:
space:
mode:
Diffstat (limited to 'dnsq.c')
-rw-r--r--dnsq.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/dnsq.c b/dnsq.c
index 533e6af..9e89efe 100644
--- a/dnsq.c
+++ b/dnsq.c
@@ -10,6 +10,7 @@
#include "printpacket.h"
#include "parsetype.h"
#include "dns.h"
+#include "ip6.h"
#define FATAL "dnsq: fatal: "
@@ -24,14 +25,14 @@ void oops(void)
static struct dns_transmit tx;
-int resolve(char *q,char qtype[2],char servers[64])
+int resolve(char *q,char qtype[2],char servers[256])
{
struct taia stamp;
struct taia deadline;
iopause_fd x[1];
int r;
- if (dns_transmit_start(&tx,servers,0,q,qtype,"\0\0\0\0") == -1) return -1;
+ if (dns_transmit_start(&tx,servers,0,q,qtype,V6any) == -1) return -1;
for (;;) {
taia_now(&stamp);
@@ -47,7 +48,7 @@ int resolve(char *q,char qtype[2],char servers[64])
return 0;
}
-char servers[64];
+char servers[256];
static stralloc ip;
static stralloc fqdn;
@@ -73,9 +74,9 @@ int main(int argc,char **argv)
if (!*++argv) usage();
if (!stralloc_copys(&out,*argv)) oops();
- if (dns_ip4_qualify(&ip,&fqdn,&out) == -1) oops();
- if (ip.len >= 64) ip.len = 64;
- byte_zero(servers,64);
+ if (dns_ip6_qualify(&ip,&fqdn,&out) == -1) oops();
+ if (ip.len >= 256) ip.len = 256;
+ byte_zero(servers,256);
byte_copy(servers,ip.len,ip.s);
if (!stralloc_copys(&out,"")) oops();