mirror of
https://github.com/rfc1036/whois.git
synced 2026-08-31 07:30:22 +00:00
Use whois.nic.$TLD for the "new" gTLDs
The "new" gTLDs are contractually required by ICANN to provide port 43 whois service on this standard domain.
This commit is contained in:
parent
4411a41702
commit
171705cbde
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
*_del.h
|
||||
new_gtlds.h
|
||||
tld_serv.h
|
||||
servers_charset.h
|
||||
version.h
|
||||
|
||||
3
Makefile
3
Makefile
@ -84,6 +84,9 @@ ip_del.h: ip_del_list make_ip_del.pl
|
||||
ip6_del.h: ip6_del_list make_ip6_del.pl
|
||||
$(PERL) make_ip6_del.pl < $< > $@
|
||||
|
||||
new_gtlds.h: new_gtlds_list make_new_gtlds.pl
|
||||
$(PERL) make_new_gtlds.pl < $< > $@
|
||||
|
||||
tld_serv.h: tld_serv_list make_tld_serv.pl
|
||||
$(PERL) make_tld_serv.pl < $< > $@
|
||||
|
||||
|
||||
5
data.h
5
data.h
@ -134,6 +134,11 @@ const struct as32_del as32_assign[] = {
|
||||
{ 0, 0, NULL }
|
||||
};
|
||||
|
||||
const char *new_gtlds[] = {
|
||||
#include "new_gtlds.h"
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *tld_serv[] = {
|
||||
#include "tld_serv.h"
|
||||
NULL, NULL
|
||||
|
||||
16
make_new_gtlds.pl
Executable file
16
make_new_gtlds.pl
Executable file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
while (<>) {
|
||||
chomp;
|
||||
s/#.*$//;
|
||||
s/^\s+//; s/\s+$//;
|
||||
next if /^$/;
|
||||
|
||||
die "format error: $_" if not /^((?:xn--)?[a-z0-9]+)$/;
|
||||
|
||||
print qq| ".$_",\n|;
|
||||
}
|
||||
|
||||
266
new_gtlds_list
Normal file
266
new_gtlds_list
Normal file
@ -0,0 +1,266 @@
|
||||
# If a TLD is listed in this file then queries will go to whois.nic.$TLD.
|
||||
# All "new" gTLDs are mandated by the ICANN contract to provide port 43 and
|
||||
# web-based whois service on this standard domain.
|
||||
# Any exceptions can be handled in tld_serv_list as usual, since it will
|
||||
# be checked first.
|
||||
|
||||
academy
|
||||
actor
|
||||
agency
|
||||
airforce
|
||||
archi
|
||||
associates
|
||||
axa
|
||||
bar
|
||||
bargains
|
||||
berlin
|
||||
best
|
||||
bid
|
||||
bike
|
||||
black
|
||||
blackfriday
|
||||
blue
|
||||
boutique
|
||||
build
|
||||
builders
|
||||
buzz
|
||||
cab
|
||||
camera
|
||||
camp
|
||||
capital
|
||||
cards
|
||||
care
|
||||
career
|
||||
careers
|
||||
cash
|
||||
catering
|
||||
center
|
||||
ceo
|
||||
cheap
|
||||
christmas
|
||||
citic
|
||||
cleaning
|
||||
clinic
|
||||
clothing
|
||||
club
|
||||
codes
|
||||
coffee
|
||||
college
|
||||
cologne
|
||||
com
|
||||
community
|
||||
company
|
||||
computer
|
||||
condos
|
||||
construction
|
||||
consulting
|
||||
contractors
|
||||
cooking
|
||||
cool
|
||||
country
|
||||
creditcard
|
||||
cruises
|
||||
dance
|
||||
dating
|
||||
democrat
|
||||
dental
|
||||
desi
|
||||
diamonds
|
||||
directory
|
||||
discount
|
||||
dnp
|
||||
domains
|
||||
education
|
||||
email
|
||||
engineering
|
||||
enterprises
|
||||
equipment
|
||||
estate
|
||||
eus
|
||||
events
|
||||
exchange
|
||||
expert
|
||||
exposed
|
||||
fail
|
||||
farm
|
||||
feedback
|
||||
finance
|
||||
financial
|
||||
fish
|
||||
fishing
|
||||
fitness
|
||||
flights
|
||||
florist
|
||||
foo
|
||||
foundation
|
||||
frogans
|
||||
fund
|
||||
furniture
|
||||
futbol
|
||||
gal
|
||||
gallery
|
||||
gift
|
||||
glass
|
||||
gop
|
||||
graphics
|
||||
gratis
|
||||
gripe
|
||||
guitars
|
||||
guru
|
||||
haus
|
||||
holdings
|
||||
holiday
|
||||
horse
|
||||
house
|
||||
immobilien
|
||||
industries
|
||||
info
|
||||
ink
|
||||
institute
|
||||
insure
|
||||
international
|
||||
investments
|
||||
jetzt
|
||||
kaufen
|
||||
kim
|
||||
kitchen
|
||||
kiwi
|
||||
koeln
|
||||
kred
|
||||
land
|
||||
lease
|
||||
lighting
|
||||
limited
|
||||
limo
|
||||
link
|
||||
london
|
||||
luxury
|
||||
maison
|
||||
management
|
||||
mango
|
||||
marketing
|
||||
media
|
||||
meet
|
||||
menu
|
||||
miami
|
||||
moda
|
||||
moe
|
||||
monash
|
||||
moscow
|
||||
nagoya
|
||||
net
|
||||
neustar
|
||||
ninja
|
||||
nyc
|
||||
okinawa
|
||||
onl
|
||||
org
|
||||
paris
|
||||
partners
|
||||
parts
|
||||
photo
|
||||
photography
|
||||
photos
|
||||
pics
|
||||
pictures
|
||||
pink
|
||||
plumbing
|
||||
productions
|
||||
properties
|
||||
pub
|
||||
qpon
|
||||
quebec
|
||||
recipes
|
||||
red
|
||||
reisen
|
||||
ren
|
||||
rentals
|
||||
repair
|
||||
report
|
||||
rest
|
||||
reviews
|
||||
rich
|
||||
rocks
|
||||
rodeo
|
||||
ruhr
|
||||
ryukyu
|
||||
saarland
|
||||
schule
|
||||
services
|
||||
sexy
|
||||
shiksha
|
||||
shoes
|
||||
singles
|
||||
social
|
||||
sohu
|
||||
solar
|
||||
solutions
|
||||
soy
|
||||
supplies
|
||||
supply
|
||||
support
|
||||
surgery
|
||||
systems
|
||||
tattoo
|
||||
tax
|
||||
technology
|
||||
tienda
|
||||
tips
|
||||
today
|
||||
tokyo
|
||||
tools
|
||||
town
|
||||
toys
|
||||
trade
|
||||
training
|
||||
university
|
||||
uno
|
||||
vacations
|
||||
vegas
|
||||
ventures
|
||||
viajes
|
||||
villas
|
||||
vision
|
||||
vodka
|
||||
vote
|
||||
voting
|
||||
voto
|
||||
voyage
|
||||
wang
|
||||
watch
|
||||
webcam
|
||||
wed
|
||||
wien
|
||||
wiki
|
||||
works
|
||||
wtc
|
||||
wtf
|
||||
xn--3bst00m
|
||||
xn--3ds443g
|
||||
xn--55qw42g
|
||||
xn--55qx5d
|
||||
xn--6frz82g
|
||||
xn--6qq986b3xl
|
||||
xn--80adxhks
|
||||
xn--80asehdb
|
||||
xn--80aswg
|
||||
xn--c1avg
|
||||
xn--cg4bki
|
||||
xn--czru2d
|
||||
xn--d1acj3b
|
||||
xn--fiq228c5hs
|
||||
xn--fiq64b
|
||||
xn--i1b6b1a6a2e
|
||||
xn--io0a7i
|
||||
xn--mgbab2bd
|
||||
xn--ngbc5azd
|
||||
xn--nqv7f
|
||||
xn--nqv7fs00ema
|
||||
xn--q9jyb4c
|
||||
xn--rhqv96g
|
||||
xn--ses554g
|
||||
xn--unup4y
|
||||
xn--zfr164b
|
||||
xyz
|
||||
yokohama
|
||||
zone
|
||||
32
whois.c
32
whois.c
@ -459,6 +459,21 @@ char *guess_server(const char *s)
|
||||
if (domcmp(s, tld_serv[i]))
|
||||
return strdup(tld_serv[i + 1]);
|
||||
|
||||
/* use the default server name for "new" gTLDs */
|
||||
if (is_new_gtld(s)) {
|
||||
char *server;
|
||||
const char *p, *tld = NULL;
|
||||
|
||||
for (p = s; *p; p++) /* look for the TLD */
|
||||
if (*p == '.')
|
||||
tld = p;
|
||||
|
||||
server = malloc(strlen("whois.nic") + strlen(tld) + 1);
|
||||
strcpy(server, "whois.nic");
|
||||
strcat(server, tld);
|
||||
return(server);
|
||||
}
|
||||
|
||||
/* no dot but hyphen */
|
||||
if (!strchr(s, '.')) {
|
||||
/* search for strings at the start of the word */
|
||||
@ -535,6 +550,12 @@ char *queryformat(const char *server, const char *flags, const char *query)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* Use UTF-8 by default for "new" gTLDs */
|
||||
if (!simple_recode_input_charset && /* was not in the database */
|
||||
!strchr(query, ' ') && /* and has no parameters */
|
||||
is_new_gtld(query)) /* and is a "new" gTLD: */
|
||||
simple_recode_input_charset = "utf-8"; /* then try UTF-8 */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBIDN
|
||||
@ -957,6 +978,17 @@ int domcmp(const char *dom, const char *tld)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int is_new_gtld(const char *s)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; new_gtlds[i]; i++)
|
||||
if (domcmp(s, new_gtlds[i]))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempt to normalize a query by removing trailing dots and whitespace,
|
||||
* then convert the domain to punycode.
|
||||
|
||||
1
whois.h
1
whois.h
@ -28,6 +28,7 @@ unsigned long myinet_aton(const char *);
|
||||
unsigned long asn32_to_long(const char *);
|
||||
int isasciidigit(const char);
|
||||
int domcmp(const char *, const char *);
|
||||
int is_new_gtld(const char *);
|
||||
int domfind(const char *, const char *[]);
|
||||
char *normalize_domain(const char *);
|
||||
char *convert_6to4(const char *);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user