summaryrefslogtreecommitdiff
path: root/whois.c
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2017-08-22 16:50:32 +0200
committerMarco d'Itri <md@linux.it>2017-08-22 16:50:32 +0200
commit46faeee41e15aaff2e67705e063bc57dbb21321e (patch)
tree31226a6768a68c163cee697113d491dd9dfa8daf /whois.c
parent4f374d16b0ca0b10495a773dc8af04189f01394c (diff)
downloadwhois-46faeee41e15aaff2e67705e063bc57dbb21321e.tar.gz
Disable recursion for queries like "nameserver name.example.com"
Or else the program would return an error because no registrar whois server is returned by the registry.
Diffstat (limited to 'whois.c')
-rw-r--r--whois.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/whois.c b/whois.c
index 75eeca8..53829b6 100644
--- a/whois.c
+++ b/whois.c
@@ -835,6 +835,10 @@ char *query_crsnic(const int sock, const char *query)
is queried */
if (state == 0 && strneq(buf, " Domain Name:", 15))
state = 1;
+ if (state == 0 && strneq(buf, " Server Name:", 15)) {
+ referral_server = strdup("");
+ state = 2;
+ }
if (state == 1 && strneq(buf, " Registrar WHOIS Server:", 26)) {
for (p = buf; *p != ':'; p++); /* skip until the colon */
for (p++; *p == ' '; p++); /* skip the spaces */