From a065151c1b79ce3a4a75eab0c1be4b85859486cd Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Tue, 6 Jun 2006 13:11:29 +0000 Subject: [PATCH] Send EDNS part --- dns.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dns.c b/dns.c index b29cf07..c1e874b 100644 --- a/dns.c +++ b/dns.c @@ -215,6 +215,7 @@ dns_query(int fd, int id, char *host, int type) header->ra = 0; header->qdcount = htons(1); + header->arcount = htons(1); p = buf + sizeof(HEADER); p += host2dns(host, p, strlen(host)); @@ -222,6 +223,14 @@ dns_query(int fd, int id, char *host, int type) PUTSHORT(type, p); PUTSHORT(C_IN, p); + // EDNS0 + *p++ = 0x00; //Root + PUTSHORT(0x0029, p); // OPT + PUTSHORT(0x1000, p); // Payload size: 4096 + PUTSHORT(0x0000, p); // Higher bits/ edns version + PUTSHORT(0x8000, p); // Z + PUTSHORT(0x0000, p); // Data length + peerlen = sizeof(peer); len = p - buf;