Compare commits

...

101 Commits

Author SHA1 Message Date
barbieri1982
54d60d8eba
Update tld_serv_list with .com.uy URL
correct URL for .com.uy extension:
https://nic.com.uy/consulta-whois
2026-07-25 19:36:51 +02:00
Marco d'Itri
28b04d45c9
Reset the time every time a line is read
This makes whois handle better very slow connections and big responses.
2026-07-25 19:26:35 +02:00
Marco d'Itri
1024386831
Debian changelog for 5.6.6 2026-02-16 02:46:59 +01:00
Marco d'Itri
5fb7fabaf9
whois.c: add the complete GPL notice 2026-02-16 02:46:44 +01:00
Marco d'Itri
59a8760c31
Update the text of the GPL 2026-02-16 02:46:44 +01:00
Marco d'Itri
db1c3e143d
mkpasswd: rename bcrypt-a and gost-yescrypt
Let's use the same names listed in libxcrypt's crypt(5).

I highly doubt that anybody uses these names, so I am not adding
compatibility aliases.
2026-02-16 02:46:44 +01:00
Marco d'Itri
9d8f93b3c2
mkpasswd: support the Chinese algorithms 2026-02-16 02:46:44 +01:00
Marco d'Itri
15883e61b2
mkpasswd: move the "national" algorithms
Keep them around the end of the list because they should never be
selected automatically or preferred.
2026-02-16 02:46:44 +01:00
Marco d'Itri
beb5f19182
Remove the .travel TLD server 2026-02-16 02:46:44 +01:00
Marco d'Itri
a30a99e232
Remove the .mobi TLD server 2026-02-16 02:46:44 +01:00
Marco d'Itri
78480971a3
Remove the .info TLD server 2026-02-16 02:46:44 +01:00
Marco d'Itri
db3ea2fc1a
Remove the .فلسطين (.xn--ygbi2ammx) TLD server
The new server for .ps does not appear to handle queries for this domain
too.
2026-02-16 02:46:44 +01:00
Marco d'Itri
3319487629
Update the .ps TLD server
For months the old server has been rejecting queries with a RST.
2026-02-16 02:46:44 +01:00
Marco d'Itri
431ed02783
Add the .mc TLD server 2026-02-16 02:46:44 +01:00
Marco d'Itri
33235c0517
make_version_h.pl: remove everything after ~ or +
Closes: #1120638
2026-02-16 02:46:31 +01:00
Marco d'Itri
d268ab6f58
Remove 3 new gTLDs which are no longer active 2026-02-16 01:39:05 +01:00
Marco d'Itri
e6bf9a53a1
Remove out of date documentation 2026-02-16 01:38:31 +01:00
Marco d'Itri
64c3426493
Debian changelog for 5.6.5 2025-10-13 03:37:26 +02:00
Marco d'Itri
8624550e4a
make_version_h.pl: ignore the salsa CI tags
These version numbers do not appear in any archive but are used
internally by the Salsa CI pipeline.
2025-10-13 03:37:03 +02:00
Marco d'Itri
9f37990fed
make_version_h.pl: refactoring 2025-10-13 03:37:03 +02:00
Marco d'Itri
a2bbd90c40
Enable the standard Salsa CI pipeline 2025-10-13 03:29:13 +02:00
Marco d'Itri
f5d4f95d76
Remove some leftovers of 6bone referral handling
The rest was removed in commit 3364fe47f2bc408c1faa2e3209448320cb928423.
2025-10-13 03:18:08 +02:00
Steven Maddox
173808dd26
Update the second level .uk TLD servers
Removed these as although they're registered directly by Nominet
they're not second level domains:
- .bl.uk
- .british-library.uk
- .nls.uk

Removed this as it has just been a normal registered domain since 2014
when direct .uk registrations opened up:
- .icnet.uk

Removed these as whilst not directly registered by Nominet and they do
pre-date the 2014 direct .uk registrations, they're also not second
level domains:
- .jet.uk
- .police.uk

Added this which was missing:
- .mil.uk
2025-10-13 03:12:08 +02:00
Marco d'Itri
5967760f56
Remove 1 new gTLD which is no longer active 2025-10-13 02:56:37 +02:00
Marco d'Itri
45dde46468
Add some large KRNIC networks
These networks have more specific records only in the KRNIC whois
database.
2025-10-13 02:46:08 +02:00
Marco d'Itri
71c87b5e30
Update the .co TLD server
The old server does not exist anymore.
2025-10-12 02:06:39 +02:00
Marco d'Itri
e0d2550f93
Remove the .pro TLD server 2025-09-22 00:55:29 +02:00
Marco d'Itri
24363dc033
Debian changelog for 5.6.4 2025-08-02 01:14:39 +02:00
Marco d'Itri
3364fe47f2
Remove referral handling for whois.6bone.net
6bone has been shut down 20 years ago and this specific referrals format
does not appear to be used anywhere else.
2025-08-02 00:52:12 +02:00
Marco d'Itri
4171b62cf9
data.h: remove the reference to the obsolete whois.ra.net 2025-08-02 00:41:15 +02:00
Marco d'Itri
6a5dc397fd
Update the .to TLD server
The old server does not work anymore.
2025-08-02 00:33:30 +02:00
Marco d'Itri
64ace856ec
Update the .cm TLD server
New alias of the same server.
2025-07-22 00:23:02 +02:00
Marco d'Itri
39900059a5
Move the repository to salsa 2025-07-22 00:12:57 +02:00
Marco d'Itri
434e384f32
Debian changelog for 5.6.3 2025-07-17 05:29:32 +02:00
Marco d'Itri
87296ebc30
Add the .мон (.xn--l1acc, Mongolia) TLD server 2025-07-05 01:18:55 +02:00
Marco d'Itri
5ec6843896
Add the .sr TLD server
Closes GitHub #190
2025-07-05 01:18:52 +02:00
Marco d'Itri
6e74da05d1
mkpasswd: use readpassphrase(3) if available 2025-06-21 01:34:43 +02:00
Marco d'Itri
b64054961d
Debian changelog for 5.6.2 2025-06-06 18:22:11 +02:00
Marco d'Itri
c16055893b
Remove 1 new gTLD which is no longer active 2025-06-06 18:17:41 +02:00
Marco d'Itri
be9c4cfa09
debian/control: Build-Depend on libcrypt-dev
Closes: #1106977
2025-06-02 00:17:24 +02:00
Marco d'Itri
cd6f08d336
debian/control: remove obsolete version constraints 2025-06-02 00:17:13 +02:00
Marco d'Itri
672575a1ae
Update the .in TLD server
And the other related IDN TLDs servers.

The old server is currently broken.
2025-06-02 00:09:16 +02:00
Marco d'Itri
e17d852900
Update the .post TLD server
Same IP, different name.
2025-06-02 00:03:17 +02:00
Marco d'Itri
e36fc3b773
Debian changelog for 5.6.1 2025-05-17 01:30:14 +02:00
Marco d'Itri
cc4b9c48e6
Correct the comment in servers_charset_list
This is about encodings, not character sets.
2025-05-17 01:28:31 +02:00
Marco d'Itri
d3b4365bd8
Add the encoding for whois.apnic.net 2025-05-17 01:28:31 +02:00
Marco d'Itri
aaf0baab25
Add the encoding for whois.afrinic.net 2025-05-17 01:20:16 +02:00
Marco d'Itri
9bb383ea03
Enable the UTF-8 encoding for whois.ripe.net 2025-05-17 01:06:47 +02:00
Marco d'Itri
f240aaf70e
Remove the charset for cwhois.cnnic.cn
Apparently this name has been retired, and is not used anymore by this
client.
2025-05-16 22:30:52 +02:00
Marco d'Itri
b0920c9748
Update the .mu TLD server
Same server, different name.
2025-05-06 01:22:23 +02:00
Marco d'Itri
980539ec23
Update the .gov TLD server
Same server, different name.
2025-05-06 01:21:15 +02:00
Marco d'Itri
d31347a39e
Update the .中國 (.xn--fiqz9s) TLD server
Same server, different name.
2025-05-06 01:21:06 +02:00
Marco d'Itri
f1d74f377f
Update the .中国 (.xn--fiqs8s) TLD server
Same server, different name.
2025-05-06 01:18:42 +02:00
Marco d'Itri
816f7adb8c
Remove the .jobs TLD server
Not accepting TCP connections, not in the IANA database anymore.
2025-05-06 01:15:16 +02:00
Marco d'Itri
f31128ed0d
Make sure to avoid trivial referral loops
In theory loops should not happen for domains, because recursion is
enabled only for the server names listed in server_referral_handlers[],
but better be safe than sorry.
2025-05-06 00:37:23 +02:00
Marco d'Itri
e30931d958
Use the last ReferralServer field found
Because we want to follow the referral for the most specific record
returned.

Closes GitHub #185.
2025-05-05 23:41:19 +02:00
Marco d'Itri
cf5fdb03e5
Add the .pg TLD server
Closes GitHub #184
2025-05-05 11:38:15 +02:00
Marco d'Itri
e7acab9014
Debian changelog for 5.6.0 2025-05-05 02:57:45 +02:00
Marco d'Itri
9b349a9c40
Add more missing SPDX license identifiers 2025-05-05 02:53:51 +02:00
Marco d'Itri
2753190967
Update the supported policy version 2025-05-05 02:53:06 +02:00
Marco d'Itri
b36474fc77
Refactoring 2025-05-05 02:38:03 +02:00
Marco d'Itri
e19e5d9f4f
Refactoring 2025-05-05 02:38:03 +02:00
Marco d'Itri
6ec5b9dd48
Implement following the APNIC pseudo-referrals
Closes GitHub #95
2025-05-05 02:38:03 +02:00
Marco d'Itri
8f5ef792d8
Refactoring 2025-05-05 02:38:03 +02:00
Marco d'Itri
b903b3679b
Refactoring 2025-05-05 02:38:02 +02:00
Marco d'Itri
5211801fe0
Refactoring 2025-05-05 02:38:02 +02:00
Marco d'Itri
c6f7ae9162
Fix some irrelevant memory leaks 2025-05-05 02:38:02 +02:00
Marco d'Itri
4a5357548d
Refactoring 2025-05-05 02:38:02 +02:00
Marco d'Itri
1a148ff7e4
Refactoring 2025-05-05 02:38:02 +02:00
Marco d'Itri
52c9e13eef
Refactoring 2025-05-05 02:38:02 +02:00
Marco d'Itri
b989176918
Accept bare hostnames for ARIN's ReferralServer field
Some networks have just a bare hostname with no protocol scheme
component.
2025-05-05 02:38:02 +02:00
Bjarni Ingi Gislason
cb1ce782a1
Clean up the man pages markup
Closes: #1036826
Closes: #1094208
2025-05-05 02:38:02 +02:00
Marco d'Itri
420fff7ee6
Do not mangle RADB queries with IDN processing 2025-05-04 00:41:16 +02:00
Marco d'Itri
4190279e0e
Add more hiding strings 2025-05-04 00:41:16 +02:00
Marco d'Itri
dc06d9972b
ip6_del_list: add 2410::/12 2025-05-04 00:41:16 +02:00
Marco d'Itri
fcc4958dc3
ip6_del_list: aggregate some entries 2025-05-04 00:41:16 +02:00
Marco d'Itri
f576fdcbff
Remove 7 new gTLDs which are no longer active 2025-05-04 00:41:16 +02:00
Marco d'Itri
8fc981f3c4
tld_serv_list: update some notes 2025-05-04 00:41:16 +02:00
Marco d'Itri
1a269128db
Add the .za TLD server 2025-05-04 00:41:16 +02:00
Marco d'Itri
49a99cbb2d
Add the .ad TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
f11eca950f
Update the .mobi TLD server
Closes GitHub #179
2025-05-04 00:41:15 +02:00
Marco d'Itri
88d18d6c32
Update the .info TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
1197daea75
Update the .vc TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
efd879dd7a
Update the .md TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
e7dcd8171b
Update the .lc TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
f802f15b26
Update the .gi TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
3f784bd664
Update the .ελ (.xn--qxam) TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
8d78134293
Update the .uy TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
efbcad34fa
Update the .pr TLD server
Closes GitHub #178
2025-05-04 00:41:15 +02:00
Marco d'Itri
4c93a190c0
Update the .pn TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
476c701c86
Update the .gw TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
0fa0351141
Update the .gr TLD server 2025-05-04 00:41:15 +02:00
Marco d'Itri
157ef53e06
Update the .gq TLD server
Port 43 always returns an unknown domain error after the demise of
Freenom.
2025-05-04 00:41:15 +02:00
Marco d'Itri
8280d56f16
Update the .bz TLD server
Closes GitHub #179
2025-05-04 00:41:15 +02:00
Marco d'Itri
2f1da4ff84
Update the .ao TLD server 2025-05-03 18:17:45 +02:00
Marco d'Itri
23f2636f88
Update the .გე (.xn--node, Georgia) TLD server
Port 43 does not work anymore.
2025-05-03 18:16:41 +02:00
Marco d'Itri
2c20d77516 Always check the values returned by fdopen(3) 2024-06-18 01:00:57 +02:00
Marco d'Itri
dc588f10ee Debian changelog for 5.5.23 2024-05-12 10:59:59 +02:00
Marco d'Itri
02ca11b4c7 Update the .新加坡 (.xn--yfro4i67o, Singapore) TLD server 2024-05-04 03:12:29 +02:00
Marco d'Itri
bc20dcc7e2 Update the .சிங்கப்பூர் (.xn--clchc0ea0b2g2a9gcd, Singapore) TLD server 2024-05-04 03:12:25 +02:00
Marco d'Itri
7e46b8cd50 Update the .sc TLD server 2024-05-04 03:06:27 +02:00
22 changed files with 522 additions and 434 deletions

View File

@ -2,7 +2,7 @@
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@ -304,8 +304,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., with this program; if not, see <https://www.gnu.org/licenses/>.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@ -329,8 +328,8 @@ necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker. `Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989 <signature of Moe Ghoul>, 1 April 1989
Ty Coon, President of Vice Moe Ghoul, President of Vice
This General Public License does not permit incorporating your program into This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may proprietary programs. If your program is a subroutine library, you may

View File

@ -26,12 +26,17 @@
/* which versions? */ /* which versions? */
# define HAVE_GETOPT_LONG # define HAVE_GETOPT_LONG
# define HAVE_GETADDRINFO # define HAVE_GETADDRINFO
# define HAVE_READPASSPHRASE
# define ENABLE_NLS # define ENABLE_NLS
# ifndef LOCALEDIR # ifndef LOCALEDIR
# define LOCALEDIR "/usr/local/share/locale" # define LOCALEDIR "/usr/local/share/locale"
# endif # endif
#endif #endif
#if defined OpenBSD
# define HAVE_READPASSPHRASE
#endif
/* needs unistd.h */ /* needs unistd.h */
#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L
# define HAVE_GETADDRINFO # define HAVE_GETADDRINFO
@ -41,6 +46,7 @@
#if defined __APPLE__ && defined __MACH__ #if defined __APPLE__ && defined __MACH__
# define HAVE_GETOPT_LONG # define HAVE_GETOPT_LONG
# define HAVE_GETADDRINFO # define HAVE_GETADDRINFO
# define HAVE_READPASSPHRASE
# define HAVE_BSDICRYPT # define HAVE_BSDICRYPT
#endif #endif

21
data.h
View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* /*
* RIPE-like servers. * RIPE-like servers.
* All of them do not understand -V2.0Md with the exception of RA and RIPN. * All of them do not understand -V2.0Md with the exception of RA and RIPN.
@ -15,10 +17,23 @@ const char *ripe_servers[] = {
"whois.ripn.net", "whois.ripn.net",
"whois.register.si", "whois.register.si",
"whois.nic.ir", "whois.nic.ir",
"whois.ra.net",
NULL NULL
}; };
struct server_referral_handler {
const char *name;
void (*handler)(char **referral_server, const char *buf);
};
const struct server_referral_handler server_referral_handlers[] = {
{ "whois.apnic.net", find_referral_server_apnic },
{ "whois.arin.net", find_referral_server_arin },
{ "whois.iana.org", find_referral_server_iana },
{ "\x04", find_referral_server_verisign },
{ "\x08", find_referral_server_recursive },
{ NULL, NULL }
};
const char *hide_strings[] = { const char *hide_strings[] = {
"The data in Networksolutions.com's WHOIS database", NULL, "The data in Networksolutions.com's WHOIS database", NULL,
/* Some registrars like .wang copied the first paragraph of this /* Some registrars like .wang copied the first paragraph of this
@ -33,7 +48,7 @@ const char *hide_strings[] = {
"Please register your domains at; http://www.", NULL, /* key-systems.net */ "Please register your domains at; http://www.", NULL, /* key-systems.net */
"%% NOTICE: Access to this information is provided", NULL, /* bookmyname.com */ "%% NOTICE: Access to this information is provided", NULL, /* bookmyname.com */
"NOTICE: Access to the domain name's information", NULL, /* CORE */ "NOTICE: Access to the domain name's information", NULL, /* CORE */
"The Data in MarkMonitor.com's", NULL, /* MarkMonitor */ "The data in MarkMonitors WHOIS", NULL, /* MarkMonitor */
"Corporation Service Company(c) (CSC) The Trusted Partner", "Register your domain name at", /* CSC */ "Corporation Service Company(c) (CSC) The Trusted Partner", "Register your domain name at", /* CSC */
"The data in Networksolutions.com's", NULL, /* Networksolutions */ "The data in Networksolutions.com's", NULL, /* Networksolutions */
"# Welcome to the OVH WHOIS Server", "", /* ovh */ "# Welcome to the OVH WHOIS Server", "", /* ovh */
@ -72,8 +87,10 @@ const char *hide_strings[] = {
"Access to .IN WHOIS information", NULL, /* in */ "Access to .IN WHOIS information", NULL, /* in */
"access to .in whois information", NULL, /* in registar */ "access to .in whois information", NULL, /* in registar */
"% Use of CIRA's WHOIS service is governed by the Terms of Use in its Legal", NULL, /* sx */ "% Use of CIRA's WHOIS service is governed by the Terms of Use in its Legal", NULL, /* sx */
"Terms of Use: Access to WHOIS information", NULL, /* vc */
"The Service is provided so that you may look", "We may discontinue",/*vu*/ "The Service is provided so that you may look", "We may discontinue",/*vu*/
"NeuStar, Inc., the Registry Administrator for .US", NULL, "NeuStar, Inc., the Registry Administrator for .US", NULL,
"; This data is provided ", NULL, /* whois.1api.net */
NULL, NULL NULL, NULL
}; };

81
debian/changelog vendored
View File

@ -1,3 +1,84 @@
whois (5.6.6) unstable; urgency=medium
* Added the .mc TLD server.
* Updated the .ps TLD server.
* Removed the .info, .mobi, .travel and .فلسطين (.xn--ygbi2ammx,
Palestinian Territory) TLD servers.
* Removed 3 new gTLDs which are no longer active.
* mkpasswd: added support the Chinese SM3-based hashing algorithms.
-- Marco d'Itri <md@linux.it> Mon, 16 Feb 2026 02:46:51 +0100
whois (5.6.5) unstable; urgency=medium
* Updated the .co TLD server.
* Added some large KRNIC networks.
* Updated the second level .uk TLD servers.
* Removed the .pro TLD server.
* Removed 1 new gTLD which is no longer active.
-- Marco d'Itri <md@linux.it> Mon, 13 Oct 2025 03:37:20 +0200
whois (5.6.4) unstable; urgency=medium
* Updated the .cm and .to TLD servers.
-- Marco d'Itri <md@linux.it> Sat, 02 Aug 2025 01:13:07 +0200
whois (5.6.3) unstable; urgency=medium
* Added the .sr and .мон (.xn--l1acc, Mongolia) TLD servers.
* Use readpassphrase(3) on OpenBSD and FreeBSD.
-- Marco d'Itri <md@linux.it> Thu, 17 Jul 2025 05:15:53 +0200
whois (5.6.2) unstable; urgency=medium
* Updated the .post and .in (and related IDN TLDs) TLD servers.
* Removed 1 new gTLDs which is no longer active.
* Build-Depend on libcrypt-dev. (Closes: #1106977)
-- Marco d'Itri <md@linux.it> Fri, 06 Jun 2025 18:22:04 +0200
whois (5.6.1) unstable; urgency=medium
* Added the .pg TLD server.
* Updated the .gov, .mu, .中国 (.xn--fiqs8s) and .中國 (.xn--fiqz9s)
TLD servers.
* Removed the .jobs TLD server.
* Added the encodings for whois.afrinic.net and whois.apnic.net.
* Enabled the UTF-8 encoding for whois.ripe.net.
* Use the last ReferralServer returned by the ARIN server instead of
the first, because we want to follow the referral for the most
specific record returned.
* Make sure to avoid trivial referral loops.
-- Marco d'Itri <md@linux.it> Sat, 17 May 2025 01:30:06 +0200
whois (5.6.0) unstable; urgency=medium
* Fixed the mangling of RADB queries with commands.
* Implemented the parsing of more variants of ARIN's ReferralServer
field.
* Implemented following the APNIC pseudo-referrals.
* Added the .ad and .za TLD servers.
* Updated the .ao, .bz, .gi, .gq, .gr, .gw, .lc, .md, .pn, .pr, .uy, .vc,
.info, .mobi, .ελ (.xn--qxam, Greece) and .გე (.xn--node, Georgia) TLD
servers.
* Added 2410::/12.
* Removed 7 new gTLDs which are no longer active.
* Cleaned up the markup of the man pages, courtesy of Bjarni Ingi
Gislason. (Closes: #1036826, #1094208)
-- Marco d'Itri <md@linux.it> Mon, 05 May 2025 02:57:37 +0200
whois (5.5.23) unstable; urgency=medium
* Updated the .sc, .新加坡 (.xn--yfro4i67o, Singapore) and .சிங்கப்பூர்
(.xn--clchc0ea0b2g2a9gcd, Singapore) TLD servers.
-- Marco d'Itri <md@linux.it> Sat, 04 May 2024 03:13:22 +0200
whois (5.5.22) unstable; urgency=medium whois (5.5.22) unstable; urgency=medium
* Fixed a segmentation fault with --no-recursion. * Fixed a segmentation fault with --no-recursion.

9
debian/control vendored
View File

@ -2,13 +2,14 @@ Source: whois
Section: net Section: net
Priority: standard Priority: standard
Maintainer: Marco d'Itri <md@linux.it> Maintainer: Marco d'Itri <md@linux.it>
Standards-Version: 4.6.2.0 Standards-Version: 4.7.2.0
Rules-Requires-Root: no Rules-Requires-Root: no
Build-Depends: debhelper-compat (= 13), gettext, pkgconf, Build-Depends: debhelper-compat (= 13), gettext, pkgconf,
bash-completion, bash-completion,
libidn2-dev (>= 2.0.3), libcrypt-dev,
Vcs-Git: https://github.com/rfc1036/whois.git libidn2-dev,
Vcs-Browser: https://github.com/rfc1036/whois Vcs-Git: https://salsa.debian.org/md/whois.git
Vcs-Browser: https://salsa.debian.org/md/whois
Package: whois Package: whois
Architecture: any Architecture: any

6
debian/salsa-ci.yml vendored Normal file
View File

@ -0,0 +1,6 @@
---
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml
variables:
SALSA_CI_IGNORED_BRANCHES: '^next$'

View File

@ -35,13 +35,12 @@
2003:0000::/18 ripe 2003:0000::/18 ripe
2400:0000::/20 whois.nic.or.kr 2400:0000::/20 whois.nic.or.kr
2400:0000::/12 apnic 2400:0000::/11 apnic
2600:0000::/12 arin 2600:0000::/12 arin
2610:0000::/23 arin 2610:0000::/23 arin
2620:0000::/23 arin 2620:0000::/23 arin
2630:0000::/12 arin 2630:0000::/12 arin
2800:0000::/12 lacnic 2800:0000::/12 lacnic
2A00:0000::/12 ripe 2A00:0000::/11 ripe
2A10:0000::/12 ripe
2C00:0000::/12 afrinic 2C00:0000::/12 afrinic

View File

@ -10,16 +10,20 @@
1.0.0.0/8 apnic 1.0.0.0/8 apnic
2.0.0.0/8 ripe 2.0.0.0/8 ripe
5.0.0.0/8 ripe 5.0.0.0/8 ripe
14.64.0.0/11 whois.nic.or.kr
14.0.0.0/8 apnic 14.0.0.0/8 apnic
24.132.0.0/14 ripe 24.132.0.0/14 ripe
27.176.0.0/13 whois.nic.or.kr
27.0.0.0/8 apnic 27.0.0.0/8 apnic
31.0.0.0/8 ripe 31.0.0.0/8 ripe
36.0.0.0/8 apnic 36.0.0.0/8 apnic
37.0.0.0/8 ripe 37.0.0.0/8 ripe
39.0.0.0/8 apnic 39.0.0.0/8 apnic
41.0.0.0/8 afrinic 41.0.0.0/8 afrinic
42.32.0.0/12 whois.nic.or.kr
42.0.0.0/7 apnic 42.0.0.0/7 apnic
46.0.0.0/8 ripe 46.0.0.0/8 ripe
49.8.0.0/14 whois.nic.or.kr
49.0.0.0/8 apnic 49.0.0.0/8 apnic
51.0.0.0/8 ripe 51.0.0.0/8 ripe
# whois -r -K -h whois.apnic.net -i admin-c IM76-AP # whois -r -K -h whois.apnic.net -i admin-c IM76-AP

View File

@ -18,7 +18,7 @@ while (<>) {
$b = "\\x03" if $b eq 'NONE'; $b = "\\x03" if $b eq 'NONE';
$b =~ s/^RECURSIVE\s+/\\x08" "/; $b =~ s/^RECURSIVE\s+/\\x08" "/;
$b = "\\x08$b" if $b eq 'whois.flexireg.net'; $b = "\\x08$b" if $b eq 'whois.flexireg.net';
$b = "\\x08$b" if $b eq 'whois.registry.in'; $b = "\\x08$b" if $b eq 'whois.nixiregistry.in';
$b = "\\x0C" if $b eq 'ARPA'; $b = "\\x0C" if $b eq 'ARPA';
$b = "\\x0D" if $b eq 'IP6'; $b = "\\x0D" if $b eq 'IP6';
print qq| "$a",\t"$b",\n|; print qq| "$a",\t"$b",\n|;

View File

@ -14,12 +14,17 @@ close($fh);
my ($ver) = $line =~ /^whois \s+ \( ( [^\)]+ ) \) \s+ \S+/x; my ($ver) = $line =~ /^whois \s+ \( ( [^\)]+ ) \) \s+ \S+/x;
die "Version number not found in $changelog!\n" if not $ver; die "Version number not found in $changelog!\n" if not $ver;
$ver =~ s/ ( ~bpo\d+\+\d+ | \+b\d+ | ~deb\d+.* | ubuntu\d+ | build\d+ | \+dyson\d+ ) $//x; $ver =~ s/ (
build\d+
| ubuntu\d+
| ~\S+
| \+\S+
) $//x;
# The version number must not deviate from this format or the -V option # The version number must not deviate from this format or the -V option
# to RIPE-like servers will break. If needed, update the previous regexp. # to RIPE-like servers will break. If needed, update the previous regexp.
# This may not be true anymore in 2019. # This may not be true anymore in 2019.
die "Invalid version number in $changelog!\n" die "Invalid version number in $changelog: '$ver'!\n"
unless $ver =~ /^ \d+\.\d+ ( \.\d+ )? $/x; unless $ver =~ /^ \d+\.\d+ ( \.\d+ )? $/x;
# This is the version number used in the help messages. # This is the version number used in the help messages.

View File

@ -12,28 +12,28 @@ encrypts the given password with the
libc function, using the given salt. libc function, using the given salt.
.SH OPTIONS .SH OPTIONS
.TP .TP
.BR \-S ", "\c .BR \-S " STRING\fR, \fP" \-\-salt= \fISTRING\fP
.BI \-\-salt= STRING
Use the Use the
.I STRING .I STRING
as salt. If it begins with as salt.
If it begins with
.I $ .I $
then it will be passed straight to then it will be passed straight to
.BR crypt (3) .BR crypt (3)
without any checks. without any checks.
.TP .TP
.BR \-R ", "\c .BR \-R " NUMBER\fR, \fP" \-\-rounds= \fINUMBER\fP
.BI \-\-rounds= NUMBER
Use Use
.I NUMBER .I NUMBER
rounds. This argument is ignored if the method chosen rounds.
does not support variable rounds. For the OpenBSD Blowfish method this is This argument is ignored if the method chosen
does not support variable rounds.
For the OpenBSD Blowfish method this is
the logarithm of the number of rounds. the logarithm of the number of rounds.
The behavior is undefined if this option is used without The behavior is undefined if this option is used without
.IR \-\-method . .IR \-\-method .
.TP .TP
.BR \-m ", "\c .BR \-m " TYPE\fR, \fP" \-\-method= \fITYPE\fP
.BI \-\-method= TYPE
Compute the password using the Compute the password using the
.I TYPE .I TYPE
method. method.
@ -47,20 +47,18 @@ If
begins and end with begins and end with
.I $ .I $
characters then the string is passed to characters then the string is passed to
.IR crypt_gensalt (3) .BR crypt_gensalt (3)
as-is. as-is.
.TP .TP
.B -5 .B \-5
Like Like
.IR \-\-method=md5crypt . .IR \-\-method=md5crypt .
.TP .TP
.B \-P \c .BI \-P " NUM\fR, \fP" \-\-password-fd= NUM
.IR NUM ", "\c
.BI \-\-password-fd= NUM
Read the password from file descriptor Read the password from file descriptor
.I NUM .I NUM
instead of using instead of using
.IR getpass (3). .BR getpass (3).
If the file descriptor is not connected to a tty then no other text If the file descriptor is not connected to a tty then no other text
than the hashed password is printed on stdout. than the hashed password is printed on stdout.
.TP .TP
@ -79,16 +77,16 @@ characters may not be read correctly.
.P .P
This program suffers of a bad case of featuritis. This program suffers of a bad case of featuritis.
.SH "SEE ALSO" .SH "SEE ALSO"
.IR passwd (1), .BR passwd (1),
.IR passwd (5), .BR passwd (5),
.IR crypt (3), .BR crypt (3),
.IR crypt (5), .BR crypt (5),
.IR crypt_gensalt (3), .BR crypt_gensalt (3),
.IR getpass (3). .BR getpass (3).
.SH AUTHOR .SH AUTHOR
.B mkpasswd .B mkpasswd
and this man page were written by Marco d'Itri and this man page were written by Marco d'Itri
.RI < md@linux.it > .RI < md@linux.it >
and are licensed under the terms of the GNU General Public License, and are licensed under the terms of the GNU General Public License,
version 2 or later. version 2 or later.
\" SPDX-License-Identifier: GPL-2.0-or-later .\" SPDX-License-Identifier: GPL-2.0-or-later

View File

@ -12,8 +12,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, see <https://www.gnu.org/licenses/>.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
*/ */
@ -47,6 +46,9 @@
#ifdef HAVE_GETTIMEOFDAY #ifdef HAVE_GETTIMEOFDAY
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#ifdef HAVE_READPASSPHRASE
#include <readpassphrase.h>
#endif
/* Application-specific */ /* Application-specific */
#include "version.h" #include "version.h"
@ -100,9 +102,6 @@ static const struct crypt_method methods[] = {
{ "md5", "$1$", 8, 8, 0, NULL }, { "md5", "$1$", 8, 8, 0, NULL },
#if defined XCRYPT_VERSION_NUM #if defined XCRYPT_VERSION_NUM
{ "yescrypt", "$y$", 0, 0, 1, "Yescrypt" }, { "yescrypt", "$y$", 0, 0, 1, "Yescrypt" },
#if XCRYPT_VERSION_NUM >= ((4 << 16) | 4)
{ "gost-yescrypt", "$gy$", 0, 0, 1, "GOST Yescrypt" },
#endif
{ "scrypt", "$7$", 0, 0, 1, "scrypt" }, { "scrypt", "$7$", 0, 0, 1, "scrypt" },
#endif #endif
#ifdef HAVE_BCRYPT_OBSOLETE #ifdef HAVE_BCRYPT_OBSOLETE
@ -111,7 +110,7 @@ static const struct crypt_method methods[] = {
#endif #endif
#ifdef HAVE_BCRYPT #ifdef HAVE_BCRYPT
{ "bcrypt", "$2b$", 22, 22, 2, "bcrypt" }, { "bcrypt", "$2b$", 22, 22, 2, "bcrypt" },
{ "bcrypt-a", "$2a$", 22, 22, 2, "bcrypt (obsolete $2a$ version)" }, { "bcrypt_a", "$2a$", 22, 22, 2, "bcrypt (obsolete $2a$ version)" },
#endif #endif
#if defined HAVE_SHA_CRYPT #if defined HAVE_SHA_CRYPT
/* http://people.redhat.com/drepper/SHA-crypt.txt */ /* http://people.redhat.com/drepper/SHA-crypt.txt */
@ -138,6 +137,13 @@ static const struct crypt_method methods[] = {
#endif #endif
{ "descrypt", "", 2, 2, 0, { "descrypt", "", 2, 2, 0,
N_("standard 56 bit DES-based crypt(3)") }, N_("standard 56 bit DES-based crypt(3)") },
#if XCRYPT_VERSION_NUM >= ((4 << 16) | 5)
{ "sm3crypt", "$sm3$", 0, 0, 1, "ShangMi 3" },
{ "sm3_yescrypt", "$sm3y$", 0, 0, 1, "ShangMi 3 Yescrypt" },
#endif
#if XCRYPT_VERSION_NUM >= ((4 << 16) | 4)
{ "gost_yescrypt", "$gy$", 0, 0, 1, "GOST Yescrypt" },
#endif
#if defined FreeBSD || defined XCRYPT_VERSION_NUM #if defined FreeBSD || defined XCRYPT_VERSION_NUM
{ "nt", "$3$", 0, 0, 0, "NT-Hash" }, { "nt", "$3$", 0, 0, 0, "NT-Hash" },
#endif #endif
@ -387,11 +393,21 @@ int main(int argc, char *argv[])
exit(2); exit(2);
} }
} else { } else {
#ifdef HAVE_READPASSPHRASE
const size_t size = 128;
password = NOFAIL(malloc(size));
if (!readpassphrase(_("Password: "), password, size, 0)) {
perror("readpassphrase");
exit(2);
}
#else
password = getpass(_("Password: ")); password = getpass(_("Password: "));
if (!password) { if (!password) {
perror("getpass"); perror("getpass");
exit(2); exit(2);
} }
#endif
} }
{ {

View File

@ -99,7 +99,6 @@ bcn
beats beats
beauty beauty
beer beer
bentley
berlin berlin
best best
bestbuy bestbuy
@ -240,7 +239,6 @@ cruises
cuisinella cuisinella
cymru cymru
cyou cyou
dabur
dad dad
dance dance
data data
@ -284,7 +282,6 @@ download
drive drive
dtv dtv
dubai dubai
dunlop
dupont dupont
durban durban
dvag dvag
@ -401,7 +398,6 @@ godaddy
gold gold
goldpoint goldpoint
golf golf
goo
goodyear goodyear
goog goog
google google
@ -507,7 +503,6 @@ juniper
kaufen kaufen
kddi kddi
kerryhotels kerryhotels
kerrylogistics
kerryproperties kerryproperties
kfh kfh
kia kia
@ -528,7 +523,6 @@ kyoto
lacaixa lacaixa
lamborghini lamborghini
lamer lamer
lancaster
land land
landrover landrover
lanxess lanxess
@ -557,7 +551,6 @@ limited
limo limo
lincoln lincoln
link link
lipsy
live live
living living
llc llc
@ -633,7 +626,6 @@ mtr
music music
nab nab
nagoya nagoya
natura
navy navy
nba nba
nec nec
@ -724,7 +716,6 @@ pohl
poker poker
politie politie
porn porn
pramerica
praxi praxi
press press
prime prime
@ -751,7 +742,6 @@ realtor
realty realty
recipes recipes
red red
redstone
redumbrella redumbrella
rehab rehab
reise reise
@ -827,7 +817,6 @@ sexy
sfr sfr
shangrila shangrila
sharp sharp
shaw
shell shell
shia shia
shiksha shiksha
@ -1001,7 +990,6 @@ windows
wine wine
winners winners
wme wme
wolterskluwer
woodside woodside
work work
works works

View File

@ -1,90 +0,0 @@
From ripe-dbm@ripe.net Mon Jan 27 10:09:59 2003
Return-Path: <ripe-dbm@ripe.net>
Delivered-To: md@wonderland.linux.it
Received: from attila.bofh.it (localhost [127.0.0.1])
by wonderland.linux.it (Postfix/Md) with ESMTP id 582BA33CD5
for <md@wonderland.linux.it>; Mon, 27 Jan 2003 10:09:59 +0100 (CET)
Received: from picard.linux.it (picard.linux.it [::ffff:62.177.1.107])
by attila.bofh.it (Postfix) with ESMTP id 46AE15F966
for <md@wonderland.linux.it>; Mon, 27 Jan 2003 09:03:25 +0100 (CET)
Received: from birch.ripe.net (birch.ripe.net [::ffff:193.0.1.96])
by picard.linux.it (Postfix) with ESMTP id 4A76942B2
for <md@Linux.IT>; Mon, 27 Jan 2003 09:05:01 +0100 (CET)
Received: from x24.ripe.net (x24.ripe.net [193.0.1.24])
by birch.ripe.net (8.12.5/8.11.6) with ESMTP id h0R83NAq030231;
Mon, 27 Jan 2003 09:03:23 +0100
Received: (from ripe-dbm@localhost)
by x24.ripe.net (8.12.4/8.12.6) id h0R83M5k002263;
Mon, 27 Jan 2003 09:03:22 +0100
Message-Id: <200301270803.h0R83M5k002263@x24.ripe.net>
From: RIPE Database Administration <ripe-dbm@ripe.net>
Cc: Can Bican <can@ripe.net>
To: md@Linux.IT
FCC: cur
Subject: Re: NCC#2003013332 Re: [db-wg] IPv6 Whois update
Reply-To: ripe-dbm@ripe.net
X-Organization: RIPE Network Coordination Centre
X-Phone: +31 20 535 4444
X-Fax: +31 20 535 4341
X-Mailer: BaT/0.67
Sender: RIPE Database Manager <ripe-dbm@ripe.net>
Date: Mon, 27 Jan 2003 09:03:21 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, hits=0.6 required=5.0
tests=DEAR_SOMEBODY,QUOTED_EMAIL_TEXT,SIGNATURE_SHORT_DENSE,
SPAM_PHRASE_05_08
version=2.43
X-Spam-Level:
Status: RO
Content-Length: 1239
Lines: 46
Dear Marco d'Itri,
For the month October, 2002:
We had 55 milion queries, 4.3 milion done with your client.
This number is probably not the best indicator as some IPs do a lot of
queries so here are also the statistics for different IP addresses using
your client:
31364 (of 853385) different IP addresses used your client.
If you have any more questions, please contact <ripe-dbm@ripe.net>.
Regards,
Tiago Antao
____________________________
RIPE Database Administration.
Original message follows:
------------------------
On Thursday 23 January 2003 18:52, Marco d'Itri wrote:
> On Jan 23, Can Bican <can@ripe.net> wrote:
> >This is a feature we supported, and we'll keep supporting it. It's a
> > mistake on our side that we'll change promptly, so please don't change
> > the behaviour. We'll make the proxy accept -V switches of these types.
>
> Thank you for your prompt reply.
> BTW, is any statistics about -V arguments available? I wonder how many
> queries are made with my client (i.e. the -V argument matches /^Md/).
I have forwarded your request to ripe-dbm@ripe.net. You can contact that
address if you'd like more/less specific requirements about the counts.
Regards,
--
Can Bican
DB Group
RIPE NCC

View File

@ -1,4 +1,6 @@
# server name charset optional parameters # server name encoding optional parameters
whois.afrinic.net utf-8
whois.apnic.net iso-8859-1
whois.cat utf-8 -C UTF-8 whois.cat utf-8 -C UTF-8
whois.conac.cn utf-8 whois.conac.cn utf-8
whois.corenic.net utf-8 -C UTF-8 whois.corenic.net utf-8 -C UTF-8
@ -6,7 +8,7 @@ whois.online.rs.corenic.net utf-8 -C UTF-8
whois.site.rs.corenic.net utf-8 -C UTF-8 whois.site.rs.corenic.net utf-8 -C UTF-8
whois.lacnic.net utf-8 whois.lacnic.net utf-8
whois.museum utf-8 -C UTF-8 whois.museum utf-8 -C UTF-8
whois.ripe.net iso-8859-1 whois.ripe.net utf-8 --charset UTF-8
whois.nic.llyw.cymru utf-8 whois.nic.llyw.cymru utf-8
whois.nic.gov.scot utf-8 whois.nic.gov.scot utf-8
@ -20,7 +22,6 @@ whois.cira.ca utf-8
whois.nic.ch utf-8 whois.nic.ch utf-8
whois.nic.cl utf-8 whois.nic.cl utf-8
whois.cnnic.cn utf-8 whois.cnnic.cn utf-8
cwhois.cnnic.cn utf-8
whois.nic.cz utf-8 whois.nic.cz utf-8
whois.denic.de utf-8 whois.denic.de utf-8
whois.enum.denic.de utf-8 whois.enum.denic.de utf-8

View File

@ -15,8 +15,9 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, see <https://www.gnu.org/licenses/>.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* SPDX-License-Identifier: GPL-2.0-or-later
*/ */
#include <stdlib.h> #include <stdlib.h>

View File

@ -1,3 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef SIMPLE_RECODE_H #ifndef SIMPLE_RECODE_H
#define SIMPLE_RECODE_H #define SIMPLE_RECODE_H

View File

@ -45,7 +45,7 @@
.gov.wales whois.nic.gov.wales .gov.wales whois.nic.gov.wales
.edu whois.educause.edu .edu whois.educause.edu
.gov whois.dotgov.gov .gov whois.nic.gov
.int whois.iana.org .int whois.iana.org
.mil NONE .mil NONE
@ -59,26 +59,26 @@
.biz whois.nic.biz .biz whois.nic.biz
.cat whois.nic.cat .cat whois.nic.cat
.coop whois.nic.coop .coop whois.nic.coop
.info whois.afilias.net .info NONE
.jobs whois.nic.jobs .jobs NONE
.mobi whois.afilias.net .mobi NONE
.museum whois.nic.museum .museum whois.nic.museum
.name whois.nic.name .name whois.nic.name
.post whois.dotpostregistry.net .post whois.nic.post
.pro whois.nic.pro .pro NONE
.tel whois.nic.tel .tel whois.nic.tel
.travel whois.nic.travel .travel NONE
.xxx whois.nic.xxx .xxx whois.nic.xxx
.ac whois.nic.ac .ac whois.nic.ac
.ad NONE # www.nic.ad .ad whois.nic.ad
.ae whois.aeda.net.ae .ae whois.aeda.net.ae
.af whois.nic.af .af whois.nic.af
.ag whois.nic.ag .ag whois.nic.ag
.ai whois.nic.ai .ai whois.nic.ai
.al NONE # www.akep.al .al NONE # www.akep.al
.am whois.amnic.net .am whois.amnic.net
.ao WEB https://www.dns.ao/ao/gca/index.php?id=19 # www.dns.ao .ao WEB https://www.dns.ao/ao/whois/ # www.dns.ao
.aq NONE # 2day.com .aq NONE # 2day.com
.ar whois.nic.ar .ar whois.nic.ar
.as whois.nic.as .as whois.nic.as
@ -109,7 +109,7 @@
.bv NONE # http://www.norid.no/domenenavnbaser/bv-sj.html .bv NONE # http://www.norid.no/domenenavnbaser/bv-sj.html
.by whois.cctld.by .by whois.cctld.by
.bw whois.nic.net.bw .bw whois.nic.net.bw
.bz RECURSIVE whois.afilias-grs.info .bz RECURSIVE whois.identitydigital.services
.co.ca whois.co.ca .co.ca whois.co.ca
.ca whois.cira.ca .ca whois.cira.ca
.cc VERISIGN ccwhois.verisign-grs.com .cc VERISIGN ccwhois.verisign-grs.com
@ -120,11 +120,11 @@
.ci whois.nic.ci .ci whois.nic.ci
.ck NONE .ck NONE
.cl whois.nic.cl .cl whois.nic.cl
.cm whois.netcom.cm .cm whois.nic.cm
.edu.cn whois.edu.cn .edu.cn whois.edu.cn
.cn whois.cnnic.cn .cn whois.cnnic.cn
.uk.co whois.uk.co .uk.co whois.uk.co
.co whois.nic.co .co whois.registry.co
.cr whois.nic.cr .cr whois.nic.cr
.cu WEB https://www.nic.cu/ .cu WEB https://www.nic.cu/
.cv whois.nic.cv .cv whois.nic.cv
@ -159,17 +159,17 @@
.gf whois.mediaserv.net .gf whois.mediaserv.net
.gg whois.gg .gg whois.gg
.gh whois.nic.gh .gh whois.nic.gh
.gi whois2.afilias-grs.net .gi whois.identitydigital.services
.gl whois.nic.gl .gl whois.nic.gl
.gm WEB http://www.nic.gm/htmlpages/whois.htm .gm WEB http://www.nic.gm/htmlpages/whois.htm
.gn whois.ande.gov.gn .gn whois.ande.gov.gn
.gp whois.nic.gp .gp whois.nic.gp
.gq whois.dominio.gq .gq WEB http://www.dominio.gq/en/whois.html
.gr WEB https://grweb.ics.forth.gr/public/whois .gr WEB https://grweb.ics.forth.gr/public/whois?lang=en
.gs whois.nic.gs .gs whois.nic.gs
.gt WEB https://www.gt/sitio/?lang=en .gt WEB https://www.gt/sitio/?lang=en
.gu NONE .gu NONE
.gw WEB https://nic.gw/en/whois/ .gw WEB https://registar.nic.gw/en/whois/
.gy whois.registry.gy .gy whois.registry.gy
.hk whois.hkirc.hk .hk whois.hkirc.hk
.hm whois.registry.hm .hm whois.registry.hm
@ -181,7 +181,7 @@
.ie whois.weare.ie .ie whois.weare.ie
.il whois.isoc.org.il .il whois.isoc.org.il
.im whois.nic.im .im whois.nic.im
.in whois.registry.in .in whois.nixiregistry.in
.io whois.nic.io .io whois.nic.io
.iq whois.cmc.iq # http://www.cmc.iq/en/iq.html .iq whois.cmc.iq # http://www.cmc.iq/en/iq.html
.ir whois.nic.ir .ir whois.nic.ir
@ -204,7 +204,7 @@
.kz whois.nic.kz .kz whois.nic.kz
.la whois.nic.la .la whois.nic.la
.lb whois.lbdr.org.lb .lb whois.lbdr.org.lb
.lc whois2.afilias-grs.net .lc RECURSIVE whois.identitydigital.services
.li whois.nic.li .li whois.nic.li
.lk whois.nic.lk .lk whois.nic.lk
.lr NONE # http://www.psg.com/dns/lr/ .lr NONE # http://www.psg.com/dns/lr/
@ -214,9 +214,9 @@
.lv whois.nic.lv .lv whois.nic.lv
.ly whois.nic.ly .ly whois.nic.ly
.ma whois.registre.ma .ma whois.registre.ma
.mc NONE # www.nic.mc .mc whois.nic.mc
.md whois.nic.md .md whois.nic.md
.me whois.nic.me # afilias .me RECURSIVE whois.nic.me # whois.identitydigital.services
#.mf #.mf
.mg whois.nic.mg .mg whois.nic.mg
.mh NONE # www.nic.net.mh .mh NONE # www.nic.net.mh
@ -230,7 +230,7 @@
.mr whois.nic.mr .mr whois.nic.mr
.ms whois.nic.ms .ms whois.nic.ms
.mt whois.nic.org.mt .mt whois.nic.org.mt
.mu whois.nic.mu .mu whois.tld.mu
.mv NONE # NIC? www.dhiraagu.com.mv .mv NONE # NIC? www.dhiraagu.com.mv
.mw whois.nic.mw .mw whois.nic.mw
.mx whois.mx .mx whois.mx
@ -252,17 +252,17 @@
.pa WEB http://www.nic.pa/en .pa WEB http://www.nic.pa/en
.pe kero.yachay.pe .pe kero.yachay.pe
.pf whois.registry.pf .pf whois.registry.pf
.pg NONE # http://www.unitech.ac.pg/ .pg whois.nic.pg # https://www.unitech.ac.pg/icts-dns/
.edu.ph WEB https://services.ph.net/dns/query.pl .edu.ph WEB https://services.ph.net/dnshosting/dnshostingquery.pl
.gov.ph NONE # http://dns.gov.ph/ .gov.ph NONE # http://dns.gov.ph/
.ph WEB https://whois.dot.ph/ .ph WEB https://whois.dot.ph/
.pk whois.pknic.net.pk .pk whois.pknic.net.pk
.co.pl whois.co.pl # "unofficial" SLD .co.pl whois.co.pl # "unofficial" SLD
.pl whois.dns.pl .pl whois.dns.pl
.pm whois.nic.pm .pm whois.nic.pm
.pn WEB http://www.pitcairn.pn/PnRegistry/whois.html .pn WEB https://www.nic.pn/
.pr whois.afilias-srs.net .pr RECURSIVE whois.nic.pr # whois.identitydigital.services
.ps whois.pnina.ps .ps WEB https://www.pnina.ps/
.pt whois.dns.pt .pt whois.dns.pt
.pw whois.nic.pw .pw whois.nic.pw
.py WEB https://www.nic.py/consultdompy.php .py WEB https://www.nic.py/consultdompy.php
@ -283,7 +283,7 @@
.rw whois.ricta.org.rw # http://www.ricta.org.rw/ .rw whois.ricta.org.rw # http://www.ricta.org.rw/
.sa whois.nic.net.sa .sa whois.nic.net.sa
.sb whois.nic.net.sb .sb whois.nic.net.sb
.sc whois2.afilias-grs.net # www.nic.sc .sc whois.nic.sc
.sd whois.nic.sd .sd whois.nic.sd
.se whois.iis.se .se whois.iis.se
.sg whois.sgnic.sg .sg whois.sgnic.sg
@ -295,7 +295,7 @@
.sm whois.nic.sm .sm whois.nic.sm
.sn whois.nic.sn .sn whois.nic.sn
.so whois.nic.so .so whois.nic.so
.sr NONE # www.register.sr .sr whois.sr # https://isp.datasur.sr/
.ss whois.nic.ss .ss whois.nic.ss
.st whois.nic.st .st whois.nic.st
.msk.su whois.flexireg.net .msk.su whois.flexireg.net
@ -316,7 +316,7 @@
.tl whois.nic.tl .tl whois.nic.tl
.tm whois.nic.tm .tm whois.nic.tm
.tn whois.ati.tn .tn whois.ati.tn
.to whois.tonic.to .to whois.tonicregistry.to
.tr whois.trabis.gov.tr .tr whois.trabis.gov.tr
.tt WEB https://www.nic.tt/cgi-bin/search.pl .tt WEB https://www.nic.tt/cgi-bin/search.pl
.tv RECURSIVE whois.nic.tv .tv RECURSIVE whois.nic.tv
@ -328,29 +328,22 @@
.ua whois.ua .ua whois.ua
.ug whois.co.ug .ug whois.co.ug
.ac.uk whois.nic.ac.uk .ac.uk whois.nic.ac.uk
.bl.uk NONE
.british-library.uk NONE
.gov.uk whois.gov.uk .gov.uk whois.gov.uk
.icnet.uk NONE .mil.uk NONE
.jet.uk NONE
.mod.uk NONE .mod.uk NONE
.nhs.uk NONE .nhs.uk NONE
.nls.uk NONE
.parliament.uk NONE .parliament.uk NONE
.police.uk NONE
.uk whois.nic.uk .uk whois.nic.uk
#.um #.um
.fed.us whois.nic.gov .fed.us whois.nic.gov
.us whois.nic.us .us whois.nic.us
.edu.uy WEB https://www.nic.uy/ .com.uy WEB https://nic.com.uy/consulta-whois
.gub.uy WEB https://www.dominios.gub.uy/ .gub.uy WEB https://www.dominios.gub.uy/
.mil.uy WEB https://www.dominios.gub.uy/ .mil.uy WEB https://www.dominios.gub.uy/
.net.uy WEB https://www.nic.uy/ .uy WEB https://www.nic.uy/
.org.uy WEB https://www.nic.uy/
.uy WEB https://nic.com.uy/v2/consulta-whois
.uz whois.cctld.uz .uz whois.cctld.uz
.va NONE .va NONE
.vc whois2.afilias-grs.net .vc RECURSIVE whois.identitydigital.services
.ve whois.nic.ve .ve whois.nic.ve
.vg whois.nic.vg .vg whois.nic.vg
.vi whois.nic.vi .vi whois.nic.vi
@ -368,39 +361,39 @@
.net.za net-whois.registry.net.za .net.za net-whois.registry.net.za
.org.za org-whois.registry.net.za .org.za org-whois.registry.net.za
.web.za web-whois.registry.net.za .web.za web-whois.registry.net.za
.za NONE # https://www.nic.za/za-domains/ .za whois.nic.za
.zm whois.zicta.zm .zm whois.zicta.zm
.zw NONE # http://www.zispa.co.zw/ .zw NONE # http://www.zispa.co.zw/
# AW means that I had to guess the whois server name, but I was not able # AW means that I had to guess the whois server name, but I was not able
# to find any registered subdomains to verify it. # to find any registered subdomains to verify it.
.xn--2scrj9c whois.registry.in # India .xn--2scrj9c whois.nixiregistry.in # India
.xn--3e0b707e whois.kr # Korea, Republic of .xn--3e0b707e whois.kr # Korea, Republic of
.xn--3hcrj9c whois.registry.in # India .xn--3hcrj9c whois.nixiregistry.in # India
.xn--45br5cyl whois.registry.in # India .xn--45br5cyl whois.nixiregistry.in # India
.xn--45brj9c whois.registry.in # India, Bengali .xn--45brj9c whois.nixiregistry.in # India, Bengali
.xn--4dbrk0ce whois.isoc.org.il # Israel .xn--4dbrk0ce whois.isoc.org.il # Israel
.xn--54b7fta0cc WEB https://bdia.btcl.com.bd/ # Bangladesh .xn--54b7fta0cc WEB https://bdia.btcl.com.bd/ # Bangladesh
.xn--80ao21a whois.nic.kz # Kazakhstan .xn--80ao21a whois.nic.kz # Kazakhstan
.xn--90a3ac whois.rnids.rs # Serbia .xn--90a3ac whois.rnids.rs # Serbia
.xn--90ae whois.imena.bg # Bulgaria .xn--90ae whois.imena.bg # Bulgaria
.xn--90ais whois.cctld.by # Belarus .xn--90ais whois.cctld.by # Belarus
.xn--clchc0ea0b2g2a9gcd whois.sgnic.sg # Singapore, Tamil .xn--clchc0ea0b2g2a9gcd whois.ta.sgnic.sg # Singapore, Tamil
.xn--d1alf whois.marnet.mk # Macedonia .xn--d1alf whois.marnet.mk # Macedonia
.xn--e1a4c whois.eu # European Union, Cyrillic .xn--e1a4c whois.eu # European Union, Cyrillic
.xn--fiqs8s cwhois.cnnic.cn # China, Simplified Chinese .xn--fiqs8s whois.cnnic.cn # China, Simplified Chinese
.xn--fiqz9s cwhois.cnnic.cn # China, Traditional Chinese .xn--fiqz9s whois.cnnic.cn # China, Traditional Chinese
.xn--fpcrj9c3d whois.registry.in # India, Telugu .xn--fpcrj9c3d whois.nixiregistry.in # India, Telugu
.xn--fzc2c9e2c whois.nic.lk # Sri Lanka, Sinhala .xn--fzc2c9e2c whois.nic.lk # Sri Lanka, Sinhala
.xn--gecrj9c whois.registry.in # India, Gujarati .xn--gecrj9c whois.nixiregistry.in # India, Gujarati
.xn--h2breg3eve whois.registry.in # India .xn--h2breg3eve whois.nixiregistry.in # India
.xn--h2brj9c8c whois.registry.in # India .xn--h2brj9c8c whois.nixiregistry.in # India
.xn--h2brj9c whois.registry.in # India, Hindi .xn--h2brj9c whois.nixiregistry.in # India, Hindi
.xn--j1amh whois.dotukr.com # Ukraine .xn--j1amh whois.dotukr.com # Ukraine
.xn--j6w193g whois.hkirc.hk # Hong Kong .xn--j6w193g whois.hkirc.hk # Hong Kong
.xn--kprw13d whois.twnic.net.tw # Taiwan, Simplified Chinese .xn--kprw13d whois.twnic.net.tw # Taiwan, Simplified Chinese
.xn--kpry57d whois.twnic.net.tw # Taiwan, Traditional Chinese .xn--kpry57d whois.twnic.net.tw # Taiwan, Traditional Chinese
.xn--l1acc NONE # Mongolia .xn--l1acc whois.mn # Mongolia
.xn--lgbbat1ad8j whois.nic.dz # Algeria .xn--lgbbat1ad8j whois.nic.dz # Algeria
.xn--mgb9awbf whois.registry.om # Oman .xn--mgb9awbf whois.registry.om # Oman
.xn--mgba3a4f16a whois.nic.ir # Iran .xn--mgba3a4f16a whois.nic.ir # Iran
@ -408,30 +401,30 @@
.xn--mgbah1a3hjkrd whois.nic.mr # Mauritania .xn--mgbah1a3hjkrd whois.nic.mr # Mauritania
.xn--mgbai9azgqp6j NONE # Pakistan .xn--mgbai9azgqp6j NONE # Pakistan
.xn--mgbayh7gpa WEB https://www.domain.jo/FirstPageen.aspx # Jordan .xn--mgbayh7gpa WEB https://www.domain.jo/FirstPageen.aspx # Jordan
.xn--mgbbh1a71e whois.registry.in # India, Urdu .xn--mgbbh1a71e whois.nixiregistry.in # India, Urdu
.xn--mgbbh1a whois.registry.in # India .xn--mgbbh1a whois.nixiregistry.in # India
.xn--mgbc0a9azcg NONE # Morocco .xn--mgbc0a9azcg NONE # Morocco
.xn--mgbcpq6gpa1a NONE # Bahrain .xn--mgbcpq6gpa1a NONE # Bahrain
.xn--mgberp4a5d4ar whois.nic.net.sa # Saudi Arabia .xn--mgberp4a5d4ar whois.nic.net.sa # Saudi Arabia
.xn--mgbgu82a whois.registry.in # India .xn--mgbgu82a whois.nixiregistry.in # India
.xn--mgbpl2fh NONE # Sudan .xn--mgbpl2fh NONE # Sudan
.xn--mgbtx2b whois.cmc.iq # Iraq .xn--mgbtx2b whois.cmc.iq # Iraq
.xn--mgbx4cd0ab whois.mynic.my # Malaysia AW .xn--mgbx4cd0ab whois.mynic.my # Malaysia AW
.xn--mix891f WEB https://www.monic.mo/monic/faces/whois # Macao .xn--mix891f WEB https://www.monic.mo/monic/faces/whois # Macao
.xn--node whois.itdc.ge # Georgia .xn--node WEB http://რეგისტრაცია.გე/ # Georgia
.xn--o3cw4h whois.thnic.co.th # Thailand .xn--o3cw4h whois.thnic.co.th # Thailand
.xn--ogbpf8fl whois.tld.sy # Syria .xn--ogbpf8fl whois.tld.sy # Syria
.xn--p1ai whois.tcinet.ru # Russian Federation .xn--p1ai whois.tcinet.ru # Russian Federation
.xn--pgbs0dh whois.ati.tn # Tunisia .xn--pgbs0dh whois.ati.tn # Tunisia
.xn--q7ce6a whois.nic.la # Lao .xn--q7ce6a whois.nic.la # Lao
.xn--qxa6a whois.eu # European Union, Greek .xn--qxa6a whois.eu # European Union, Greek
.xn--qxam WEB https://grweb.ics.forth.gr/public/whois # Greece .xn--qxam WEB https://grweb.ics.forth.gr/public/whois?lang=en # Greece
.xn--rvc1e0am3e whois.registry.in # India .xn--rvc1e0am3e whois.nixiregistry.in # India
.xn--s9brj9c whois.registry.in # India, Punjabi .xn--s9brj9c whois.nixiregistry.in # India, Punjabi
.xn--wgbh1c whois.dotmasr.eg # Egypt .xn--wgbh1c whois.dotmasr.eg # Egypt
.xn--wgbl6a whois.registry.qa # Qatar .xn--wgbl6a whois.registry.qa # Qatar
.xn--xkc2al3hye2a whois.nic.lk # Sri Lanka, Tamil .xn--xkc2al3hye2a whois.nic.lk # Sri Lanka, Tamil
.xn--xkc2dl3a5ee0h whois.registry.in # India, Tamil .xn--xkc2dl3a5ee0h whois.nixiregistry.in # India, Tamil
.xn--y9a3aq whois.amnic.net # Armenia .xn--y9a3aq whois.amnic.net # Armenia
.xn--yfro4i67o whois.sgnic.sg # Singapore, Chinese .xn--yfro4i67o whois.zh.sgnic.sg # Singapore, Chinese
.xn--ygbi2ammx whois.pnina.ps # Palestinian Territory .xn--ygbi2ammx NONE # Palestinian Territory

View File

@ -16,8 +16,9 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, see <https://www.gnu.org/licenses/>.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* SPDX-License-Identifier: GPL-2.0-or-later
*/ */
/* for strdup */ /* for strdup */

68
whois.1
View File

@ -9,18 +9,16 @@ whois \- client for the whois directory service
] [ ] [
.RB {\~ \-p \~|\~ \-\-port \~} .RB {\~ \-p \~|\~ \-\-port \~}
.I PORT .I PORT
] [\~\c ]
.B \-abBcdGHIKlLmMrRx .RB [\~ \-abBcdGHIKlLmMrRx
] [\~\c ]
.BI \-g \~SOURCE:FIRST\-LAST .RB [\~ \-g \fI\~SOURCE:FIRST\-LAST\fR
] [\~\c ]
.BR \-i \~ .RB [\~ \-i
.IR ATTR [, ATTR ]...\~] .IR ATTR [, ATTR ]...\~]
[\~\c .RB [\~ \-s
.BR \-s \~
.IR SOURCE [, SOURCE ]...\~] .IR SOURCE [, SOURCE ]...\~]
[\~\c .RB [\~ \-T
.BR \-T \~
.IR TYPE [, TYPE ]...\~] .IR TYPE [, TYPE ]...\~]
.RB [\~ \-\-verbose \~] .RB [\~ \-\-verbose \~]
.RB [\~ \-\-no\-recursion \~] .RB [\~ \-\-no\-recursion \~]
@ -49,14 +47,15 @@ searches for an object in a
database. database.
.P .P
This version of the whois client tries to guess the right server to This version of the whois client tries to guess the right server to
ask for the specified object. If no guess can be made it will connect to ask for the specified object.
If no guess can be made it will connect to
.I whois.networksolutions.com .I whois.networksolutions.com
for NIC handles or for NIC handles or
.I whois.arin.net .I whois.arin.net
for IPv4 addresses and network names. for IPv4 addresses and network names.
.SH OPTIONS .SH OPTIONS
.TP 8 .TP 8
.B \-h \c .B \-h
.IR HOST , .IR HOST ,
.BI \-\-host= HOST .BI \-\-host= HOST
Connect to Connect to
@ -65,7 +64,7 @@ Connect to
.B \-H .B \-H
Do not display the legal disclaimers that some registries like to show you. Do not display the legal disclaimers that some registries like to show you.
.TP 8 .TP 8
.B \-p \c .B \-p
.IR PORT , .IR PORT ,
.BI \-\-port= PORT .BI \-\-port= PORT
Connect to Connect to
@ -75,7 +74,8 @@ Connect to
First query First query
.I whois.iana.org .I whois.iana.org
and then follow its referral to the and then follow its referral to the
whois server authoritative for that request. This works for IP addresses, whois server authoritative for that request.
This works for IP addresses,
AS numbers and domains. AS numbers and domains.
.BR BEWARE : .BR BEWARE :
this implies that the IANA server will receive your complete query. this implies that the IANA server will receive your complete query.
@ -113,7 +113,7 @@ Return the smallest IP address range with a reference to an irt object.
.B \-d .B \-d
Return the reverse DNS delegation object too. Return the reverse DNS delegation object too.
.TP 8 .TP 8
.B \-g \c .B \-g
.I SOURCE:FIRST\-LAST .I SOURCE:FIRST\-LAST
Search updates from Search updates from
.I SOURCE .I SOURCE
@ -121,12 +121,13 @@ database between
.I FIRST .I FIRST
and and
.I LAST .I LAST
update serial number. It is useful to obtain Near Real Time Mirroring stream. update serial number.
It is useful to obtain Near Real Time Mirroring stream.
.TP 8 .TP 8
.B \-G .B \-G
Disable grouping of associated objects. Disable grouping of associated objects.
.TP 8 .TP 8
.B \-i \c .B \-i
.IR ATTR [, ATTR ]... .IR ATTR [, ATTR ]...
Inverse-search objects having associated attributes. Inverse-search objects having associated attributes.
.I ATTR .I ATTR
@ -135,11 +136,13 @@ is the attribute name, while the positional
argument is the attribute value. argument is the attribute value.
.TP 8 .TP 8
.B \-K .B \-K
Return primary key attributes only. An exception is the Return primary key attributes only.
An exception is the
.I members .I members
attribute of attribute of
.I set .I set
objects, which is always returned. Another exception are all objects, which is always returned.
Another exception are all
attributes of the objects attributes of the objects
.IR organisation , .IR organisation ,
.I person .I person
@ -159,7 +162,7 @@ Return all one level more specific objects.
.B \-M .B \-M
Return all levels of more specific objects. Return all levels of more specific objects.
.TP 8 .TP 8
.B \-q \c .B \-q
.I KEYWORD .I KEYWORD
Return information about the server. Return information about the server.
.I KEYWORD .I KEYWORD
@ -178,7 +181,7 @@ Disable recursive lookups for contact information.
Disable following referrals and force showing the object from the local copy Disable following referrals and force showing the object from the local copy
in the server. in the server.
.TP 8 .TP 8
.B \-s \c .B \-s
.IR SOURCE [, SOURCE ]... .IR SOURCE [, SOURCE ]...
Request the server to search for objects mirrored from Request the server to search for objects mirrored from
.IR SOURCE . .IR SOURCE .
@ -187,18 +190,18 @@ Use the
.I \-q sources .I \-q sources
parameter to obtain a list of valid sources. parameter to obtain a list of valid sources.
.TP 8 .TP 8
.B \-t \c .B \-t
.I TYPE .I TYPE
Return the template for a object of Return the template for a object of
.IR TYPE . .IR TYPE .
.TP 8 .TP 8
.B \-T \c .B \-T
.IR TYPE [, TYPE ]... .IR TYPE [, TYPE ]...
Restrict the search to objects of Restrict the search to objects of
.IR TYPE . .IR TYPE .
Multiple types are separated by a comma. Multiple types are separated by a comma.
.TP 8 .TP 8
.B \-v \c .B \-v
.I TYPE .I TYPE
Return the verbose template for a object of Return the verbose template for a object of
.IR TYPE . .IR TYPE .
@ -206,7 +209,9 @@ Return the verbose template for a object of
.B \-x .B \-x
Search for only exact match on network address prefix. Search for only exact match on network address prefix.
.SH NOTES .SH NOTES
When querying the Verisign gTLDs (e.g.\& \&.com, \&.net...\&) thin registry servers When querying the Verisign gTLDs
(e.g.\& \&.com, \&.net...\&)
thin registry servers
for a domain, the program will automatically prepend the for a domain, the program will automatically prepend the
.I domain .I domain
keyword to only show domain records. The keyword to only show domain records. The
@ -239,7 +244,8 @@ flags have been specified, the program will automatically add the flag
.IR "\-\-show\-handles" . .IR "\-\-show\-handles" .
.P .P
RIPE-specific command line options are ignored when querying non-RIPE RIPE-specific command line options are ignored when querying non-RIPE
servers. This may or may not be the behaviour intended by the user. servers.
This may or may not be the behaviour intended by the user.
When using non-standard query parameters then the command line options When using non-standard query parameters then the command line options
which are not to be interpreted by the client must follow the which are not to be interpreted by the client must follow the
.I \-\- .I \-\-
@ -248,7 +254,8 @@ separator (which marks the beginning of the query string).
If the If the
.I /etc/whois.conf .I /etc/whois.conf
configuration file exists, it will be consulted configuration file exists, it will be consulted
to find a server before applying the normal rules. Each line of the to find a server before applying the normal rules.
Each line of the
file should contain a regular expression to be matched against the query file should contain a regular expression to be matched against the query
text and the whois server to use, separated by white space. text and the whois server to use, separated by white space.
IDN domains must use the ACE format. IDN domains must use the ACE format.
@ -279,7 +286,8 @@ A list of options which will be evaluated before the ones specified on the
command line. command line.
.IP "WHOIS_SERVER" .IP "WHOIS_SERVER"
This server will be queried if the program cannot guess where some kind This server will be queried if the program cannot guess where some kind
of objects are located. If the variable does not exist then of objects are located.
If the variable does not exist then
.I whois.arin.net .I whois.arin.net
will be queried. will be queried.
.SH "SEE ALSO" .SH "SEE ALSO"
@ -289,7 +297,7 @@ will be queried.
WHOIS Protocol Specification. WHOIS Protocol Specification.
.P .P
.IR "RIPE Database Query Reference Manual" : .IR "RIPE Database Query Reference Manual" :
.RI < https://www.ripe.net/data\-tools/support/documentation/ripe\-database\-query\-reference\-manual > .RI < https://www.ripe.net/\:data\-tools/\:support/\:documentation/\:ripe\-database\-query\-reference\-manual >
.SH BUGS .SH BUGS
The program may have buffer overflows in the command line parser: The program may have buffer overflows in the command line parser:
be sure to not pass untrusted data to it. be sure to not pass untrusted data to it.
@ -304,4 +312,4 @@ and this man page were written by Marco d'Itri
.RI < md@linux.it > .RI < md@linux.it >
and are licensed under the terms of the GNU General Public License, and are licensed under the terms of the GNU General Public License,
version 2 or later. version 2 or later.
\" SPDX-License-Identifier: GPL-2.0-or-later .\" SPDX-License-Identifier: GPL-2.0-or-later

416
whois.c
View File

@ -6,6 +6,14 @@
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, see <https://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-2.0-or-later * SPDX-License-Identifier: GPL-2.0-or-later
*/ */
@ -40,6 +48,13 @@
#include <idna.h> #include <idna.h>
#endif #endif
/* prototypes referenced in data.h */
static void find_referral_server_apnic(char **, const char *);
static void find_referral_server_arin(char **, const char *);
static void find_referral_server_iana(char **, const char *);
static void find_referral_server_recursive(char **, const char *);
static void find_referral_server_verisign(char **, const char *);
/* Application-specific */ /* Application-specific */
#include "version.h" #include "version.h"
#include "data.h" #include "data.h"
@ -311,7 +326,7 @@ int handle_query(const char *hserver, const char *hport,
const char *query, const char *flags) const char *query, const char *flags)
{ {
char *server = NULL, *port = NULL; char *server = NULL, *port = NULL;
char *p, *query_string; char *p, *query_string, *old_server, *new_server;
if (hport) { if (hport) {
server = strdup(hserver); server = strdup(hserver);
@ -344,18 +359,18 @@ int handle_query(const char *hserver, const char *hport,
case 4: case 4:
if (verb) if (verb)
printf(_("Using server %s.\n"), server + 1); printf(_("Using server %s.\n"), server + 1);
sockfd = openconn(server + 1, NULL); old_server = server;
free(server); server = query_verisign(server, NULL, query);
server = query_crsnic(sockfd, query); free(old_server);
if (no_recursion && server) if (no_recursion && server)
server[0] = '\0'; server[0] = '\0';
break; break;
case 8: case 8:
if (verb) if (verb)
printf(_("Using server %s.\n"), server + 1); printf(_("Using server %s.\n"), server + 1);
sockfd = openconn(server + 1, NULL); old_server = server;
free(server); server = query_server(server, NULL, query);
server = query_afilias(sockfd, query); free(old_server);
if (no_recursion && server) if (no_recursion && server)
server[0] = '\0'; server[0] = '\0';
break; break;
@ -388,9 +403,8 @@ int handle_query(const char *hserver, const char *hport,
case 0x0E: case 0x0E:
if (verb) if (verb)
printf(_("Using server %s.\n"), "whois.iana.org"); printf(_("Using server %s.\n"), "whois.iana.org");
sockfd = openconn("whois.iana.org", NULL);
free(server); free(server);
server = query_iana(sockfd, query); server = query_server("whois.iana.org", NULL, query);
break; break;
default: default:
break; break;
@ -408,15 +422,17 @@ int handle_query(const char *hserver, const char *hport,
printf(_("Query string: \"%s\"\n\n"), query_string); printf(_("Query string: \"%s\"\n\n"), query_string);
} }
sockfd = openconn(server, port); new_server = query_server(server, port, query_string);
free(server); free(server);
server = do_query(sockfd, query_string); if (port)
free(port);
free(query_string); free(query_string);
/* recursion is fun */ /* recursion is fun */
if (!no_recursion && server && !strchr(query, ' ')) { if (!no_recursion && new_server && !strchr(query, ' ')) {
printf(_("\n\nFound a referral to %s.\n\n"), server); printf(_("\n\nFound a referral to %s.\n\n"), new_server);
handle_query(server, NULL, query, flags); handle_query(new_server, NULL, query, flags);
free(new_server);
} }
return 0; return 0;
@ -788,55 +804,218 @@ int hide_line(int *hiding, const char *const line)
return 0; return 0;
} }
static void find_referral_server_apnic(char **referral_server, const char *buf)
{
/* Possible states of this FSM:
* 0: searching for the descr or mnt-by attribute
* 1: searching for the mnt-by attribute (descr found)
* 2: searching for the descr attribute (mnt-by found)
* 3: searching for the end of the object (an empty line)
* 4: done: stop searching
*
* Since the descr attribute is user-provided, consider it only if it
* is in an object actually maintained by APNIC.
*
* If multiple records are returned then it users the referral in the
* first valid object found.
*/
static int state = 0;
static char *rir_name = NULL;
char *p;
if (state == 4)
return;
if (state <= 2) {
if (strneq(buf, "descr:", 6)) {
p = (char *)buf + 6; /* skip until the colon */
for (; *p == ' ' || *p == '\t'; p++); /* skip white space */
if (strneq(p, "Transferred to the ", 19)) {
rir_name = strdup(p + 19);
if ((p = strpbrk(rir_name, " ")))
*p = '\0';
if (state == 0)
state = 1; /* still needs mnt-by */
else
state = 3;
}
} else if (strneq(buf, "mnt-by:", 7)) {
p = (char *)buf + 7; /* skip until the colon */
for (; *p == ' ' || *p == '\t'; p++); /* skip white space */
if (streq(p, "APNIC-STUB")) {
if (state == 0)
state = 2; /* still needs descr */
else
state = 3;
}
} else if (streq(buf, "")) {
if (state == 1)
free(rir_name);
state = 0; /* start again with a new object */
}
return;
}
if (state == 3 && streq(buf, "")) {
int i;
const char *rir_servers[] = {
"AFRINIC", "whois.afrinic.net",
"ARIN", "whois.arin.net",
"LACNIC", "whois.lacnic.net",
"RIPE", "whois.ripe.net",
NULL, NULL,
};
state = 4;
for (i = 0; rir_servers[i]; i += 2)
if (streq(rir_name, rir_servers[i]))
*referral_server = strdup(rir_servers[i + 1]);
free(rir_name);
}
}
static void find_referral_server_arin(char **referral_server, const char *buf)
{
char *p;
/* ARIN referrals:
* ReferralServer: rwhois://rwhois.fuse.net:4321/
* ReferralServer: whois://whois.ripe.net
* ReferralServer: whois.ripe.net
*/
if (!strneq(buf, "ReferralServer:", 15))
return;
/* When whois.arin.net returns multiple NetRange records, they will
* appear from the less specific one to the most specific one.
* Since the range we care about is the most specific one then we
* need to use the last ReferralServer field found.
*/
if (*referral_server) {
free(*referral_server);
*referral_server = NULL;
}
if ((p = strstr(buf, "rwhois://")))
*referral_server = strdup(p + 9);
else if ((p = strstr(buf, "whois://")))
*referral_server = strdup(p + 8);
else
*referral_server = strdup(buf + 17);
if (*referral_server && (p = strpbrk(*referral_server, "/")))
*p = '\0';
}
static void find_referral_server_iana(char **referral_server, const char *buf)
{
const char *p;
if (*referral_server)
return;
/* IANA referrals:
* refer: whois.apnic.net
*/
if (!strneq(buf, "refer:", 6))
return;
p = buf + 6; /* skip until the colon */
for (; *p == ' ' || *p == '\t'; p++); /* skip white space */
*referral_server = strdup(p);
}
static void find_referral_server_recursive(char **referral_server, const char *buf)
{
static int state = 0;
const char *p;
if (*referral_server)
return;
if (state == 0 && strneq(buf, "Domain Name:", 12))
state = 1;
else if (state == 1 && strneq(buf, "Domain Name:", 12))
state = 2;
else if (state == 1 && strneq(buf, "Registrar WHOIS Server:", 23)) {
p = buf + 23; /* skip until the colon */
for (; *p && *p == ' '; p++); /* skip the spaces */
*referral_server = strdup(p);
state = 2;
}
}
static void find_referral_server_verisign(char **referral_server, const char *buf)
{
static int state = 0;
const char *p;
if (*referral_server)
return;
/* If there are multiple matches only the server of the first record
* is queried */
if (state == 0 && strneq(buf, " Domain Name:", 15)) {
state = 1;
} else if (state == 0 && strneq(buf, " Server Name:", 15)) {
*referral_server = strdup("");
state = 2;
} else if (state == 1 && strneq(buf, " Registrar WHOIS Server:", 26)) {
p = buf + 26; /* skip until the colon */
for (; *p && *p == ' '; p++); /* skip the spaces */
*referral_server = strdup(p);
state = 2;
}
}
/* returns a string which should be freed by the caller, or NULL */ /* returns a string which should be freed by the caller, or NULL */
char *do_query(const int sock, const char *query) char *query_server(const char *server, const char *port, const char *query)
{ {
char *temp, *p, buf[2000]; char *temp, *p, buf[2000];
FILE *fi; FILE *fi;
int hide = hide_discl; int hide = hide_discl;
int sock, i;
char *referral_server = NULL; char *referral_server = NULL;
void (*referral_handler)(char **referral_server, const char *buf) = NULL;
temp = malloc(strlen(query) + 2 + 1); temp = malloc(strlen(query) + 2 + 1);
strcpy(temp, query); strcpy(temp, query);
strcat(temp, "\r\n"); strcat(temp, "\r\n");
for (i = 0; server_referral_handlers[i].name; i++) {
/* If the first character is not printable then it represents
* a general category of servers in the list.
*/
if (server[0] < ' ' &&
strneq(server_referral_handlers[i].name, server, 1)) {
server++;
referral_handler = server_referral_handlers[i].handler;
break;
} else if (streq(server_referral_handlers[i].name, server)) {
referral_handler = server_referral_handlers[i].handler;
break;
}
}
sock = openconn(server, port);
fi = fdopen(sock, "r"); fi = fdopen(sock, "r");
if (!fi)
err_sys("fdopen");
if (write(sock, temp, strlen(temp)) < 0) if (write(sock, temp, strlen(temp)) < 0)
err_sys("write"); err_sys("write");
free(temp); free(temp);
while (fgets(buf, sizeof(buf), fi)) { while (fgets(buf, sizeof(buf), fi)) {
/* 6bone-style referral: alarm(20); /* reset the timeout */
* % referto: whois -h whois.arin.net -p 43 as 1 if ((p = strpbrk(buf, "\r\n"))) /* remove the trailing CR/LF */
*/
if (!referral_server && strneq(buf, "% referto:", 10)) {
char nh[256], np[16], nq[1024];
if (sscanf(buf, REFERTO_FORMAT, nh, np, nq) == 3) {
/* XXX we are ignoring the new query string */
referral_server = malloc(strlen(nh) + 1 + strlen(np) + 1);
sprintf(referral_server, "%s:%s", nh, np);
}
}
/* ARIN referrals:
* ReferralServer: rwhois://rwhois.fuse.net:4321/
* ReferralServer: whois://whois.ripe.net
*/
if (!referral_server && strneq(buf, "ReferralServer:", 15)) {
if ((p = strstr(buf, "rwhois://")))
referral_server = strdup(p + 9);
else if ((p = strstr(buf, "whois://")))
referral_server = strdup(p + 8);
if (referral_server && (p = strpbrk(referral_server, "/\r\n")))
*p = '\0'; *p = '\0';
}
if (referral_handler)
referral_handler(&referral_server, buf);
if (hide_line(&hide, buf)) if (hide_line(&hide, buf))
continue; continue;
if ((p = strpbrk(buf, "\r\n")))
*p = '\0';
recode_fputs(buf, stdout); recode_fputs(buf, stdout);
fputc('\n', stdout); fputc('\n', stdout);
} }
@ -849,16 +1028,20 @@ char *do_query(const int sock, const char *query)
err_quit(_("Catastrophic error: disclaimer text has been changed.\n" err_quit(_("Catastrophic error: disclaimer text has been changed.\n"
"Please upgrade this program.\n")); "Please upgrade this program.\n"));
/* defensive programming: make sure to avoid trivial referral loops */
if (referral_server && streq(server, referral_server)) {
free(referral_server);
referral_server = NULL;
}
return referral_server; return referral_server;
} }
char *query_crsnic(const int sock, const char *query) char *query_verisign(const char *server, const char *port, const char *query)
{ {
char *temp, *p, buf[2000]; char *temp, *p;
FILE *fi; int sock;
int hide = hide_discl;
char *referral_server = NULL; char *referral_server = NULL;
int state = 0;
int dotscount = 0; int dotscount = 0;
temp = malloc(strlen("domain ") + strlen(query) + 2 + 1); temp = malloc(strlen("domain ") + strlen(query) + 2 + 1);
@ -872,140 +1055,9 @@ char *query_crsnic(const int sock, const char *query)
if (dotscount == 1 && !strpbrk(query, "=~ ")) if (dotscount == 1 && !strpbrk(query, "=~ "))
strcpy(temp, "domain "); strcpy(temp, "domain ");
strcat(temp, query); strcat(temp, query);
strcat(temp, "\r\n");
fi = fdopen(sock, "r"); referral_server = query_server(server, port, temp);
if (write(sock, temp, strlen(temp)) < 0)
err_sys("write");
free(temp); free(temp);
while (fgets(buf, sizeof(buf), fi)) {
/* If there are multiple matches only the server of the first record
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 */
referral_server = strdup(p);
if ((p = strpbrk(referral_server, "\r\n ")))
*p = '\0';
state = 2;
}
/* the output must not be hidden or no data will be shown for
host records and not-existing domains */
if (hide_line(&hide, buf))
continue;
if ((p = strpbrk(buf, "\r\n")))
*p = '\0';
recode_fputs(buf, stdout);
fputc('\n', stdout);
}
if (ferror(fi))
err_sys("fgets");
fclose(fi);
return referral_server;
}
char *query_afilias(const int sock, const char *query)
{
char *temp, *p, buf[2000];
FILE *fi;
int hide = hide_discl;
char *referral_server = NULL;
int state = 0;
temp = malloc(strlen(query) + 2 + 1);
strcpy(temp, query);
strcat(temp, "\r\n");
fi = fdopen(sock, "r");
if (write(sock, temp, strlen(temp)) < 0)
err_sys("write");
free(temp);
while (fgets(buf, sizeof(buf), fi)) {
/* If multiple attributes are returned then use the first result.
This is not supposed to happen. */
if (state == 0 && strneq(buf, "Domain Name:", 12))
state = 1;
if (state == 1 && strneq(buf, "Registrar WHOIS Server:", 23)) {
for (p = buf; *p != ':'; p++); /* skip until colon */
for (p++; *p == ' '; p++); /* skip colon and spaces */
referral_server = strdup(p);
if ((p = strpbrk(referral_server, "\r\n ")))
*p = '\0';
state = 2;
}
/* the output must not be hidden or no data will be shown for
host records and not-existing domains */
if (hide_line(&hide, buf))
continue;
if ((p = strpbrk(buf, "\r\n")))
*p = '\0';
recode_fputs(buf, stdout);
fputc('\n', stdout);
}
if (ferror(fi))
err_sys("fgets");
fclose(fi);
if (hide > HIDE_NOT_STARTED && hide != HIDE_TO_THE_END)
err_quit(_("Catastrophic error: disclaimer text has been changed.\n"
"Please upgrade this program.\n"));
return referral_server;
}
char *query_iana(const int sock, const char *query)
{
char *temp, *p, buf[2000];
FILE *fi;
char *referral_server = NULL;
int state = 0;
temp = malloc(strlen(query) + 2 + 1);
strcpy(temp, query);
strcat(temp, "\r\n");
fi = fdopen(sock, "r");
if (write(sock, temp, strlen(temp)) < 0)
err_sys("write");
free(temp);
while (fgets(buf, sizeof(buf), fi)) {
/* If multiple attributes are returned then use the first result.
This is not supposed to happen. */
if (state == 0 && strneq(buf, "refer:", 6)) {
for (p = buf; *p != ':'; p++); /* skip until colon */
for (p++; *p == ' '; p++); /* skip colon and spaces */
referral_server = strdup(p);
if ((p = strpbrk(referral_server, "\r\n ")))
*p = '\0';
state = 2;
}
if ((p = strpbrk(buf, "\r\n")))
*p = '\0';
recode_fputs(buf, stdout);
fputc('\n', stdout);
}
if (ferror(fi))
err_sys("fgets");
fclose(fi);
return referral_server; return referral_server;
} }
@ -1029,7 +1081,7 @@ int openconn(const char *server, const char *port)
if (AFL_MODE) if (AFL_MODE)
return dup(0); return dup(0);
alarm(60); alarm(20);
#ifdef HAVE_GETADDRINFO #ifdef HAVE_GETADDRINFO
memset(&hints, 0, sizeof(struct addrinfo)); memset(&hints, 0, sizeof(struct addrinfo));
@ -1257,6 +1309,12 @@ char *normalize_domain(const char *dom)
} }
#if defined HAVE_LIBIDN || defined HAVE_LIBIDN2 #if defined HAVE_LIBIDN || defined HAVE_LIBIDN2
/* A leading ! means that this probably is a RADB query, so skip IDN
* processing because it would lower-case the command characters.
*/
if (*ret == '!')
return ret;
/* find the start of the last word if there are spaces in the query */ /* find the start of the last word if there are spaces in the query */
for (p = ret; *p; p++) for (p = ret; *p; p++)
if (*p == ' ') if (*p == ' ')

View File

@ -1,9 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* SPDX-License-Identifier: GPL-2.0-or-later */
#include "utils.h" #include "utils.h"
/* 6bone referto: extension */
#define REFERTO_FORMAT "%% referto: whois -h %255s -p %15s %1021[^\n\r]"
#define HIDE_TO_THE_END -3 #define HIDE_TO_THE_END -3
#define HIDE_DISABLED -2 #define HIDE_DISABLED -2
#define HIDE_NOT_STARTED -1 #define HIDE_NOT_STARTED -1
@ -15,10 +12,8 @@ const char *match_config_file(const char *);
const char *whereas(const unsigned long); const char *whereas(const unsigned long);
char *queryformat(const char *, const char *, const char *); char *queryformat(const char *, const char *, const char *);
int hide_line(int *hiding, const char *const line); int hide_line(int *hiding, const char *const line);
char *do_query(const int, const char *); char *query_server(const char *, const char *, const char *);
char *query_crsnic(const int, const char *); char *query_verisign(const char *, const char *, const char *);
char *query_afilias(const int, const char *);
char *query_iana(const int, const char *);
int openconn(const char *, const char *); int openconn(const char *, const char *);
int connect_with_timeout(int, const struct sockaddr *, socklen_t, int); int connect_with_timeout(int, const struct sockaddr *, socklen_t, int);
void NORETURN usage(int error); void NORETURN usage(int error);