summaryrefslogtreecommitdiffstats
path: root/usr.bin/whois
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>2003-03-25 17:00:03 +0000
committereivind <eivind@FreeBSD.org>2003-03-25 17:00:03 +0000
commit0eaa0a5cbf85bca581ad2df748007fa58620a798 (patch)
tree29b2f07e33752c92b18c2caaddcd592ee09c14c8 /usr.bin/whois
parent9285b790038b53cc8da52cf4c50042abc8bfa701 (diff)
downloadFreeBSD-src-0eaa0a5cbf85bca581ad2df748007fa58620a798.zip
FreeBSD-src-0eaa0a5cbf85bca581ad2df748007fa58620a798.tar.gz
Add support for identifying NORID (norwegian top level registry) handles.
Reviewed by: mike (with slight changes based on feedback afterwards)
Diffstat (limited to 'usr.bin/whois')
-rw-r--r--usr.bin/whois/whois.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index a67158b..729c2e2 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
#define QNICHOST_TAIL ".whois-servers.net"
#define SNICHOST "whois.6bone.net"
#define BNICHOST "whois.registro.br"
+#define NORIDHOST "whois.norid.no"
#define DEFAULT_PORT "whois"
#define WHOIS_SERVER_ID "Whois Server: "
#define WHOIS_ORG_SERVER_ID "Registrant Street1:Whois Server:"
@@ -203,6 +204,12 @@ choose_server(char *domain)
*pos = '\0';
if (*domain == '\0')
errx(EX_USAGE, "can't search for a null string");
+ if (strlen(domain) > sizeof("-NORID")-1 &&
+ strcasecmp(domain + strlen(domain) - sizeof("-NORID") + 1,
+ "-NORID") == 0) {
+ s_asprintf(&retval, "%s", NORIDHOST);
+ return (retval);
+ }
while (pos > domain && *pos != '.')
--pos;
if (pos <= domain)
OpenPOWER on IntegriCloud