Commit Graph

53 Commits

Author SHA1 Message Date
ume
0c85b38216 Introduce $RA_SERVER to set default whois server.
Requested by:	nork
Reviewed by:	nork
MFC after:	1 week
2014-06-25 15:39:08 +00:00
kevlo
27b04cbc6f The whois() function is called in a loop so make sure we close the
socket to the whois server before returning.

Obtained from:	OpenBSD
2014-01-04 15:51:52 +00:00
ed
dc00e03576 Mark global functions and/or variables in whois(1) static where possible.
This allows compilers and static analyzers to more thorough analysis.
2011-11-06 18:50:33 +00:00
joel
29af67e52c Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
edwin
ee2386e553 Make whois capable of searching for IPv6 addresses just like it can
do for IPv4 addresses without having to explicetly specify that the
ARIN server should be used to get the initial information

PR:		bin/128725
Submitted by:	"Matt D. Harris" <mdh_lists@yahoo.com>
MFC after:	1 week
2010-01-14 10:56:54 +00:00
edwin
ea698e4843 Remove -d option, whois.nic.mil doesn't exist anymore.
PR:		bin/142507
Submitted by:	Dan Mahoney <danm@prime.gushi.org>
MFC after:	1 week
2010-01-14 10:40:54 +00:00
dougb
e0ede152d0 The 6bone was decommissioned on 6/6/06, so remove references to it. 2009-10-03 02:37:21 +00:00
ache
1104f500b1 Use proper type cast for ctype macro 2007-04-14 14:32:48 +00:00
phk
53becc06fe Make DK-HOSTMASTER show contact info for .dk domains.
Submitted by:	Søren Hansen <shan@soeren-hansen.dk>
2007-01-19 08:13:17 +00:00
jhay
8873885f5e Add AfriNIC as a RIR.
PR:		80421
Submitted by:	Adrian Frith <adrian at frith.homelinux.org>
MFC after:	6 days
2006-01-23 13:49:39 +00:00
charnier
45f96a1a02 Reduce compiler warning: variable might be used uninitialized, by giving
an initial value.
2005-05-29 15:49:53 +00:00
ceri
d0eb6b1f7e Add a -k flag for querying whois.krnic.net (the National Internet
Development Agency of Korea) which hold details of IP address
allocations within Korea.

Approved by:	bms
2004-12-11 13:14:07 +00:00
mbr
17cdeacd68 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
2004-08-25 15:34:44 +00:00
bms
a425dc3a68 Add -b to usage.
Pointed out by:	ceri
Pointy hat to:	bms
2004-06-14 19:29:37 +00:00
bms
1598e7b423 Add whois.abuse.net to whois(1).
Submitted by:	ceri (with cleanups)
2004-06-14 17:30:46 +00:00
bms
d01943f8ff Add whois.iana.org to the whois(1) utility, under the -I option.
PR:		bin/48914
Submitted by:	James Raftery
2004-06-14 14:03:10 +00:00
ache
2973509c1f Back out .SU workaround - people at whois-servers.net set up
su.whois-servers.net
2003-06-29 23:56:31 +00:00
ache
d847b7379e While there is no su.whois-servers.net, use fallback to
ru.whois-servers.net for su domain or country
2003-06-24 15:08:24 +00:00
eivind
0eaa0a5cbf Add support for identifying NORID (norwegian top level registry) handles.
Reviewed by:	mike (with slight changes based on feedback afterwards)
2003-03-25 17:00:03 +00:00
mike
16b05986d0 Fix style bugs in previous commit. 2003-02-24 17:10:32 +00:00
roberto
63438f7ba7 The newly appointed .org registrar has a pecular output format so
whois doesn't follow the link to the authoritative registrar. Fix it.

PR:             bin/47770
Submitted by:   Alain Thivillon <at@rominet.net>
MFC after:	    7 days
2003-01-31 21:57:10 +00:00
mike
4ae3d74b87 Add support for the Latin American and Caribbean IP address Regional
Registry (LACNIC) with the -l option and support for recursive IP
address searches.

PR:		44448
Submitted by:	David Wolfskill <david@catwhisker.org>
MFC after:	1 week
2002-11-10 16:58:56 +00:00
mike
705073e549 ARIN has annoyingly started using caps when referencing
whois.apnic.net.  To properly receive hints for recursive IP searches,
we convert a buffer to lowercase before searching for magic words.

PR:		42834
Submitted by:	Andre Albsmeier <andre.albsmeier@mchp.siemens.de> (mostly)
X-MFC-After:	re approval
2002-09-18 07:51:46 +00:00
mike
4232c22913 Leave the `copyright' variable exposed, since the main purpose of it
is to put a copyright in the object file.

Submitted by:	bde
2002-03-07 10:06:00 +00:00
kris
b2cbfe0830 Mark a function as __printflike()
MFC after:	1 week
2002-02-04 02:12:49 +00:00
mike
c41b30278b Use new ID scheme.
Fix a bug that caused .br domains to be queried twice, by only
recursively following ARIN referrals when querying ARIN.

PR:		34291
MFC after:	7 days
2002-02-03 07:35:32 +00:00
mike
d43f783040 Add support for Brazilian IP Addresses. Example `whois 200.236.70.0'.
PR:	30676
2001-12-08 21:22:42 +00:00
mike
3997cf6e35 Remove some EOL whitespace. Update usage() to current reality. 2001-10-17 16:28:12 +00:00
mike
2abcf6c606 o Treat a buffer as a non-NUL terminated string, because the whois
server may not return a new line character on the final line.
o Remove the whois.networksolutions.com fallback code, which is no
  longer needed.
o Instead of determining a hostname by terminating it when we see
  whitespace, only allow hostname characters and terminate the string
  when it's not such a character.
o Add a small optimization in a for loop.

PR:		30968
Reviewed by:	-audit
MFC after:	4 days
2001-10-12 17:39:36 +00:00
mike
ee03551b7f o Move APNIC flag from -p to -A. Since, -p is usually associated
with specifying a port.
o Add the -p flag for specifying a port.  (PR: 28790)  This is
  useful for querying rwhois servers.  Example:
    whois -h rwhois.exodus.net -p rwhois 216.136.180.0
o Add the -c flag which allows one to get the same whois server
  that would normally be determined if no arguments were specified.
  (Concept based on work by phantom, requested by ache)  Example:
    whois -c ru TCNET-MNT-RIPN
o Deprecate -R flag in favour of -c ru.

PR:		28790
Reviewed by:	-audit, ache, phantom
2001-08-05 19:37:12 +00:00
mike
f322ed6873 Fix a bug I introduced in Rev. 1.21 that prevented 'whois test' from
working.

Reviewed by:	des
Approved by:	des
2001-07-22 18:23:24 +00:00
mike
567548e3b8 o Add phantom's gethostinfo() function to reduce duplicated code.
o Increase readability by creating a wrapper for asprintf(3).
o Cast isdigit(3) argument to unsigned char for future locale
  changes.

Submitted by:	phantom
Reviewed by:	-audit, des
Approved by:	des
2001-07-20 16:44:44 +00:00
mike
c13f900ffc Re-write the logic that finds the whois server to query.
[This fixes a bug where one would type 'whois foo.bar.'
and get an error because of the trailing period.]

PR:		28880
Approved by:	des
2001-07-17 20:40:41 +00:00
dd
c42db86ef3 Implement recursive IP address searches based on the results of a
query to ARIN.

PR:		28426
Submitted by:	Mike Barcroft <mike@q9media.com>
2001-06-27 23:06:47 +00:00
des
dadeb6dc97 Stylify, ANSIfy, silence warnings, plug a memory leak, don't assume the
server is well-behaved wrt. line endings.

PR:		bin/28082
Submitted by:	Mike Barcroft <mike@q9media.com>
2001-06-22 01:52:37 +00:00
ume
8888e65159 Do retry next entry in addrinfo during connect.
MFC after:	1 week
2001-06-01 13:43:20 +00:00
phk
ffbd616b16 Direct queries for IP numbers to ARIN. It would be nice if we could
send them to APNIC/RIPE intelligently, but we can't at this time so
fallback to ARIN and depend on them telling the user where to look.

Maybe we need a .whoisrc file...

PR:		24707
Submitted by:	Mike Barcroft mike@q9media.com
MFC after:	1 week
2001-05-28 21:37:29 +00:00
kris
9520faa817 Enable whois queries over IPv6
Obtained from:	KAME
2000-07-07 07:52:21 +00:00
joe
a5c97eab80 Add braces ({}) to all the places that they're missing. 1999-12-06 21:18:32 +00:00
joe
d754df9726 Added a -6 option to lookup information using the whois.6bone.net
database.

PR:		misc/10803 misc/10804
1999-12-05 22:43:36 +00:00
ache
9f9ea4099c Change -i host to whois.networksolutions.com 1999-12-03 16:56:57 +00:00
ache
28edb56949 purity change for name length checking code 1999-11-17 20:51:35 +00:00
ache
3620b449a5 Merge with OpenBSD whois (with bugfixes missed there)
New features are:
Automatic lookup using *.whois-servers.net
Recursive lookup using Registrar's name
Fallback to InterNIC for non-domains
-m for RADB database
-Q to turn recursion/fallback off

Obtained from:	OpenBSD
1999-11-17 19:11:51 +00:00
ache
64b85dd45e Change default to whois.crsnic.net - new Central Shared Registry for domains
Move InterNIC to -i option
1999-11-09 09:01:38 +00:00
peter
3b842d34e8 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ache
c97188153a Add -R for .RU domains 1999-02-02 01:49:14 +00:00
wollman
27a9da7374 Update the -d flag to use the new .MIL NIC address (from PR 9802)
and add a -g flag to use the new .GOV NIC.  Also convert the
SEE ALSO reference into a proper bibliographic one.

PR:	9802 (in part)
1999-02-01 19:22:27 +00:00
peter
0b9db54b14 #include <arpa/inet.h> 1998-06-12 12:55:46 +00:00
wollman
929ade011c Make it more convenient to query NICs other than InterNIC. Explain in the
man page what each database contains.
1998-02-19 19:07:50 +00:00
charnier
19da442f11 Use err(3). 1997-08-26 11:16:08 +00:00