Without this code on lines 79 to 91: if (!success && !pfx[0]) { /* * Looking at /etc/jwhois.conf, some whois servers use * "domain = DOMAIN", "DOMAIN ID <DOMAIN>" * and "domain=DOMAIN_WITHOUT_LAST_COMPONENT" * formats, but those are rare. * (There are a few even more contrived ones.) * We are trying only "domain DOMAIN", the typical one. */ pfx = "domain "; bufpos = 0; goto again; } whois.c starts working for IP address queries without affecting domain name queries as the user can specify this prefix on the command line.