aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/whois
diff options
context:
space:
mode:
authorMartin Blapp <mbr@FreeBSD.org>2004-08-25 15:34:44 +0000
committerMartin Blapp <mbr@FreeBSD.org>2004-08-25 15:34:44 +0000
commitbe460b946701ac04fb0e99bbb014a9facbaf9989 (patch)
tree2c6eb3f69434abe3d319ee7bc937cc7ee6895188 /usr.bin/whois
parent64215f652a7c148979694d9355eb21f9718141ce (diff)
downloadsrc-be460b946701ac04fb0e99bbb014a9facbaf9989.tar.gz
src-be460b946701ac04fb0e99bbb014a9facbaf9989.zip
Add special case for the german whois nameserver. Without the
'-T dn,ace -C US-ASCII' option one does only get: $ whois nic.de domain: nic.de status: connect More information available on: http://www.denic.de/en/domains/technik/denic_whois-server/index.html MFC: 3 days
Notes
Notes: svn path=/head/; revision=134294
Diffstat (limited to 'usr.bin/whois')
-rw-r--r--usr.bin/whois/whois.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index a5be865231ec..def4fdf58c1f 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$");
#define BNICHOST "whois.registro.br"
#define NORIDHOST "whois.norid.no"
#define IANAHOST "whois.iana.org"
+#define GERMNICHOST "de.whois-servers.net"
#define DEFAULT_PORT "whois"
#define WHOIS_SERVER_ID "Whois Server: "
#define WHOIS_ORG_SERVER_ID "Registrant Street1:Whois Server:"
@@ -291,7 +292,11 @@ whois(const char *query, const char *hostname, int flags)
sfo = fdopen(s, "w");
if (sfi == NULL || sfo == NULL)
err(EX_OSERR, "fdopen()");
- fprintf(sfo, "%s\r\n", query);
+ if (strcmp(hostname, GERMNICHOST) == 0) {
+ fprintf(sfo, "-T dn,ace -C US-ASCII %s\r\n", query);
+ } else {
+ fprintf(sfo, "%s\r\n", query);
+ }
fflush(sfo);
nhost = NULL;
while ((buf = fgetln(sfi, &len)) != NULL) {