mirror of
https://github.com/rfc1036/whois.git
synced 2026-08-01 07:20:13 +00:00
Do not request domain results for name server queries
If there is more than one dot in the query string then it can only be a name server, so do not restrict the results to domains only.
This commit is contained in:
parent
46faeee41e
commit
9777e2aa77
8
whois.c
8
whois.c
@ -816,11 +816,17 @@ char *query_crsnic(const int sock, const char *query)
|
||||
int hide = hide_discl;
|
||||
char *referral_server = NULL;
|
||||
int state = 0;
|
||||
int dotscount = 0;
|
||||
|
||||
temp = malloc(strlen("domain ") + strlen(query) + 2 + 1);
|
||||
*temp = '\0';
|
||||
|
||||
if (!strpbrk(query, "=~ "))
|
||||
/* if this has more than one dot then it is a name server */
|
||||
for (p = (char *) query; *p != '\0'; p++)
|
||||
if (*p == '.')
|
||||
dotscount++;
|
||||
|
||||
if (dotscount == 1 && !strpbrk(query, "=~ "))
|
||||
strcpy(temp, "domain ");
|
||||
strcat(temp, query);
|
||||
strcat(temp, "\r\n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user