From e322f5cd4d74c174ffecdb1d825fd96d64fb7508 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Sun, 30 Oct 2016 14:39:09 +0100 Subject: [PATCH] Use "domain" instead of "=" for default verisign-grs queries To ignore the name server names spam. --- whois.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/whois.c b/whois.c index 7f01582..7c987ae 100644 --- a/whois.c +++ b/whois.c @@ -814,9 +814,11 @@ char *query_crsnic(const int sock, const char *query) char *referral_server = NULL; int state = 0; - temp = malloc(strlen(query) + 1 + 2 + 1); - *temp = '='; - strcpy(temp + 1, query); + temp = malloc(strlen("domain ") + strlen(query) + 2 + 1); + + if (!strpbrk(query, "=~ ")) + strcpy(temp, "domain "); + strcat(temp, query); strcat(temp, "\r\n"); fi = fdopen(sock, "r");