source: josm/trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java@ 9898

Last change on this file since 9898 was 9898, checked in by Don-vip, 8 years ago

update new TLD from IANA - version 2016022800

  • Property svn:eol-style set to native
File size: 83.7 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17package org.openstreetmap.josm.data.validation.routines;
18
19import java.net.IDN;
20import java.util.Arrays;
21import java.util.Locale;
22
23/**
24 * <p><b>Domain name</b> validation routines.</p>
25 *
26 * <p>
27 * This validator provides methods for validating Internet domain names
28 * and top-level domains.
29 * </p>
30 *
31 * <p>Domain names are evaluated according
32 * to the standards <a href="http://www.ietf.org/rfc/rfc1034.txt">RFC1034</a>,
33 * section 3, and <a href="http://www.ietf.org/rfc/rfc1123.txt">RFC1123</a>,
34 * section 2.1. No accommodation is provided for the specialized needs of
35 * other applications; if the domain name has been URL-encoded, for example,
36 * validation will fail even though the equivalent plaintext version of the
37 * same name would have passed.
38 * </p>
39 *
40 * <p>
41 * Validation is also provided for top-level domains (TLDs) as defined and
42 * maintained by the Internet Assigned Numbers Authority (IANA):
43 * </p>
44 *
45 * <ul>
46 * <li>{@link #isValidInfrastructureTld} - validates infrastructure TLDs
47 * (<code>.arpa</code>, etc.)</li>
48 * <li>{@link #isValidGenericTld} - validates generic TLDs
49 * (<code>.com, .org</code>, etc.)</li>
50 * <li>{@link #isValidCountryCodeTld} - validates country code TLDs
51 * (<code>.us, .uk, .cn</code>, etc.)</li>
52 * </ul>
53 *
54 * <p>
55 * (<b>NOTE</b>: This class does not provide IP address lookup for domain names or
56 * methods to ensure that a given domain name matches a specific IP; see
57 * {@link java.net.InetAddress} for that functionality.)
58 * </p>
59 *
60 * @version $Revision: 1725571 $
61 * @since Validator 1.4
62 */
63public final class DomainValidator extends AbstractValidator {
64
65 private static final int MAX_DOMAIN_LENGTH = 253;
66
67 private static final String[] EMPTY_STRING_ARRAY = new String[0];
68
69 // Regular expression strings for hostnames (derived from RFC2396 and RFC 1123)
70
71 // RFC2396: domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
72 // Max 63 characters
73 private static final String DOMAIN_LABEL_REGEX = "\\p{Alnum}(?>[\\p{Alnum}-]{0,61}\\p{Alnum})?";
74
75 // RFC2396 toplabel = alpha | alpha *( alphanum | "-" ) alphanum
76 // Max 63 characters
77 private static final String TOP_LABEL_REGEX = "\\p{Alpha}(?>[\\p{Alnum}-]{0,61}\\p{Alnum})?";
78
79 // RFC2396 hostname = *( domainlabel "." ) toplabel [ "." ]
80 // Note that the regex currently requires both a domain label and a top level label, whereas
81 // the RFC does not. This is because the regex is used to detect if a TLD is present.
82 // If the match fails, input is checked against DOMAIN_LABEL_REGEX (hostnameRegex)
83 // RFC1123 sec 2.1 allows hostnames to start with a digit
84 private static final String DOMAIN_NAME_REGEX =
85 "^(?:" + DOMAIN_LABEL_REGEX + "\\.)+" + "(" + TOP_LABEL_REGEX + ")\\.?$";
86
87 private final boolean allowLocal;
88
89 /**
90 * Singleton instance of this validator, which
91 * doesn't consider local addresses as valid.
92 */
93 private static final DomainValidator DOMAIN_VALIDATOR = new DomainValidator(false);
94
95 /**
96 * Singleton instance of this validator, which does
97 * consider local addresses valid.
98 */
99 private static final DomainValidator DOMAIN_VALIDATOR_WITH_LOCAL = new DomainValidator(true);
100
101 /**
102 * RegexValidator for matching domains.
103 */
104 private final RegexValidator domainRegex =
105 new RegexValidator(DOMAIN_NAME_REGEX);
106 /**
107 * RegexValidator for matching a local hostname
108 */
109 // RFC1123 sec 2.1 allows hostnames to start with a digit
110 private final RegexValidator hostnameRegex =
111 new RegexValidator(DOMAIN_LABEL_REGEX);
112
113 /**
114 * Returns the singleton instance of this validator. It
115 * will not consider local addresses as valid.
116 * @return the singleton instance of this validator
117 */
118 public static synchronized DomainValidator getInstance() {
119 inUse = true;
120 return DOMAIN_VALIDATOR;
121 }
122
123 /**
124 * Returns the singleton instance of this validator,
125 * with local validation as required.
126 * @param allowLocal Should local addresses be considered valid?
127 * @return the singleton instance of this validator
128 */
129 public static synchronized DomainValidator getInstance(boolean allowLocal) {
130 inUse = true;
131 if (allowLocal) {
132 return DOMAIN_VALIDATOR_WITH_LOCAL;
133 }
134 return DOMAIN_VALIDATOR;
135 }
136
137 /**
138 * Private constructor.
139 * @param allowLocal whether to allow local domains
140 */
141 private DomainValidator(boolean allowLocal) {
142 this.allowLocal = allowLocal;
143 }
144
145 /**
146 * Returns true if the specified <code>String</code> parses
147 * as a valid domain name with a recognized top-level domain.
148 * The parsing is case-insensitive.
149 * @param domain the parameter to check for domain name syntax
150 * @return true if the parameter is a valid domain name
151 */
152 @Override
153 public boolean isValid(String domain) {
154 if (domain == null) {
155 return false;
156 }
157 domain = unicodeToASCII(domain);
158 // hosts must be equally reachable via punycode and Unicode
159 // Unicode is never shorter than punycode, so check punycode
160 // if domain did not convert, then it will be caught by ASCII
161 // checks in the regexes below
162 if (domain.length() > MAX_DOMAIN_LENGTH) {
163 return false;
164 }
165 String[] groups = domainRegex.match(domain);
166 if (groups != null && groups.length > 0) {
167 return isValidTld(groups[0]);
168 }
169 return allowLocal && hostnameRegex.isValid(domain);
170 }
171
172 // package protected for unit test access
173 // must agree with isValid() above
174 boolean isValidDomainSyntax(String domain) {
175 if (domain == null) {
176 return false;
177 }
178 domain = unicodeToASCII(domain);
179 // hosts must be equally reachable via punycode and Unicode
180 // Unicode is never shorter than punycode, so check punycode
181 // if domain did not convert, then it will be caught by ASCII
182 // checks in the regexes below
183 if (domain.length() > MAX_DOMAIN_LENGTH) {
184 return false;
185 }
186 String[] groups = domainRegex.match(domain);
187 return (groups != null && groups.length > 0)
188 || hostnameRegex.isValid(domain);
189 }
190
191 /**
192 * Returns true if the specified <code>String</code> matches any
193 * IANA-defined top-level domain. Leading dots are ignored if present.
194 * The search is case-insensitive.
195 * @param tld the parameter to check for TLD status, not null
196 * @return true if the parameter is a TLD
197 */
198 public boolean isValidTld(String tld) {
199 tld = unicodeToASCII(tld);
200 if (allowLocal && isValidLocalTld(tld)) {
201 return true;
202 }
203 return isValidInfrastructureTld(tld)
204 || isValidGenericTld(tld)
205 || isValidCountryCodeTld(tld);
206 }
207
208 /**
209 * Returns true if the specified <code>String</code> matches any
210 * IANA-defined infrastructure top-level domain. Leading dots are
211 * ignored if present. The search is case-insensitive.
212 * @param iTld the parameter to check for infrastructure TLD status, not null
213 * @return true if the parameter is an infrastructure TLD
214 */
215 public boolean isValidInfrastructureTld(String iTld) {
216 final String key = chompLeadingDot(unicodeToASCII(iTld).toLowerCase(Locale.ENGLISH));
217 return arrayContains(INFRASTRUCTURE_TLDS, key);
218 }
219
220 /**
221 * Returns true if the specified <code>String</code> matches any
222 * IANA-defined generic top-level domain. Leading dots are ignored
223 * if present. The search is case-insensitive.
224 * @param gTld the parameter to check for generic TLD status, not null
225 * @return true if the parameter is a generic TLD
226 */
227 public boolean isValidGenericTld(String gTld) {
228 final String key = chompLeadingDot(unicodeToASCII(gTld).toLowerCase(Locale.ENGLISH));
229 return (arrayContains(GENERIC_TLDS, key) || arrayContains(genericTLDsPlus, key))
230 && !arrayContains(genericTLDsMinus, key);
231 }
232
233 /**
234 * Returns true if the specified <code>String</code> matches any
235 * IANA-defined country code top-level domain. Leading dots are
236 * ignored if present. The search is case-insensitive.
237 * @param ccTld the parameter to check for country code TLD status, not null
238 * @return true if the parameter is a country code TLD
239 */
240 public boolean isValidCountryCodeTld(String ccTld) {
241 final String key = chompLeadingDot(unicodeToASCII(ccTld).toLowerCase(Locale.ENGLISH));
242 return (arrayContains(COUNTRY_CODE_TLDS, key) || arrayContains(countryCodeTLDsPlus, key))
243 && !arrayContains(countryCodeTLDsMinus, key);
244 }
245
246 /**
247 * Returns true if the specified <code>String</code> matches any
248 * widely used "local" domains (localhost or localdomain). Leading dots are
249 * ignored if present. The search is case-insensitive.
250 * @param lTld the parameter to check for local TLD status, not null
251 * @return true if the parameter is an local TLD
252 */
253 public boolean isValidLocalTld(String lTld) {
254 final String key = chompLeadingDot(unicodeToASCII(lTld).toLowerCase(Locale.ENGLISH));
255 return arrayContains(LOCAL_TLDS, key);
256 }
257
258 private static String chompLeadingDot(String str) {
259 if (str.startsWith(".")) {
260 return str.substring(1);
261 }
262 return str;
263 }
264
265 // ---------------------------------------------
266 // ----- TLDs defined by IANA
267 // ----- Authoritative and comprehensive list at:
268 // ----- http://data.iana.org/TLD/tlds-alpha-by-domain.txt
269
270 // Note that the above list is in UPPER case.
271 // The code currently converts strings to lower case (as per the tables below)
272
273 // IANA also provide an HTML list at http://www.iana.org/domains/root/db
274 // Note that this contains several country code entries which are NOT in
275 // the text file. These all have the "Not assigned" in the "Sponsoring Organisation" column
276 // For example (as of 2015-01-02):
277 // .bl country-code Not assigned
278 // .um country-code Not assigned
279
280 // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search
281 private static final String[] INFRASTRUCTURE_TLDS = new String[] {
282 "arpa", // internet infrastructure
283 };
284
285 // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search
286 private static final String[] GENERIC_TLDS = new String[] {
287 // Taken from Version 2016022800, Last Updated Sun Feb 28 07:07:01 2016 UTC
288 "aaa", // aaa American Automobile Association, Inc.
289 "aarp", // aarp AARP
290 "abb", // abb ABB Ltd
291 "abbott", // abbott Abbott Laboratories, Inc.
292 "abogado", // abogado Top Level Domain Holdings Limited
293 "academy", // academy Half Oaks, LLC
294 "accenture", // accenture Accenture plc
295 "accountant", // accountant dot Accountant Limited
296 "accountants", // accountants Knob Town, LLC
297 "aco", // aco ACO Severin Ahlmann GmbH &amp; Co. KG
298 "active", // active The Active Network, Inc
299 "actor", // actor United TLD Holdco Ltd.
300 "adac", // adac Allgemeiner Deutscher Automobil-Club e.V. (ADAC)
301 "ads", // ads Charleston Road Registry Inc.
302 "adult", // adult ICM Registry AD LLC
303 "aeg", // aeg Aktiebolaget Electrolux
304 "aero", // aero Societe Internationale de Telecommunications Aeronautique (SITA INC USA)
305 "afl", // afl Australian Football League
306 "agency", // agency Steel Falls, LLC
307 "aig", // aig American International Group, Inc.
308 "airforce", // airforce United TLD Holdco Ltd.
309 "airtel", // airtel Bharti Airtel Limited
310 "alibaba", // alibaba Alibaba Group Holding Limited
311 "alipay", // alipay Alibaba Group Holding Limited
312 "allfinanz", // allfinanz Allfinanz Deutsche Vermögensberatung Aktiengesellschaft
313 "alsace", // alsace REGION D ALSACE
314 "amica", // amica Amica Mutual Insurance Company
315 "amsterdam", // amsterdam Gemeente Amsterdam
316 "analytics", // analytics Campus IP LLC
317 "android", // android Charleston Road Registry Inc.
318 "apartments", // apartments June Maple, LLC
319 "app", // app Charleston Road Registry Inc.
320 "apple", // apple Apple Inc.
321 "aquarelle", // aquarelle Aquarelle.com
322 "aramco", // aramco Aramco Services Company
323 "archi", // archi STARTING DOT LIMITED
324 "army", // army United TLD Holdco Ltd.
325 "arte", // arte Association Relative à la Télévision Européenne G.E.I.E.
326 "asia", // asia DotAsia Organisation Ltd.
327 "associates", // associates Baxter Hill, LLC
328 "attorney", // attorney United TLD Holdco, Ltd
329 "auction", // auction United TLD HoldCo, Ltd.
330 "audi", // audi AUDI Aktiengesellschaft
331 "audio", // audio Uniregistry, Corp.
332 "author", // author Amazon Registry Services, Inc.
333 "auto", // auto Uniregistry, Corp.
334 "autos", // autos DERAutos, LLC
335 "axa", // axa AXA SA
336 "azure", // azure Microsoft Corporation
337 "baidu", // baidu Baidu, Inc.
338 "band", // band United TLD Holdco, Ltd
339 "bank", // bank fTLD Registry Services, LLC
340 "bar", // bar Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable
341 "barcelona", // barcelona Municipi de Barcelona
342 "barclaycard", // barclaycard Barclays Bank PLC
343 "barclays", // barclays Barclays Bank PLC
344 "bargains", // bargains Half Hallow, LLC
345 "bauhaus", // bauhaus Werkhaus GmbH
346 "bayern", // bayern Bayern Connect GmbH
347 "bbc", // bbc British Broadcasting Corporation
348 "bbva", // bbva BANCO BILBAO VIZCAYA ARGENTARIA, S.A.
349 "bcn", // bcn Municipi de Barcelona
350 "beats", // beats Beats Electronics, LLC
351 "beer", // beer Top Level Domain Holdings Limited
352 "bentley", // bentley Bentley Motors Limited
353 "berlin", // berlin dotBERLIN GmbH &amp; Co. KG
354 "best", // best BestTLD Pty Ltd
355 "bet", // bet Afilias plc
356 "bharti", // bharti Bharti Enterprises (Holding) Private Limited
357 "bible", // bible American Bible Society
358 "bid", // bid dot Bid Limited
359 "bike", // bike Grand Hollow, LLC
360 "bing", // bing Microsoft Corporation
361 "bingo", // bingo Sand Cedar, LLC
362 "bio", // bio STARTING DOT LIMITED
363 "biz", // biz Neustar, Inc.
364 "black", // black Afilias Limited
365 "blackfriday", // blackfriday Uniregistry, Corp.
366 "bloomberg", // bloomberg Bloomberg IP Holdings LLC
367 "blue", // blue Afilias Limited
368 "bms", // bms Bristol-Myers Squibb Company
369 "bmw", // bmw Bayerische Motoren Werke Aktiengesellschaft
370 "bnl", // bnl Banca Nazionale del Lavoro
371 "bnpparibas", // bnpparibas BNP Paribas
372 "boats", // boats DERBoats, LLC
373 "boehringer", // boehringer Boehringer Ingelheim International GmbH
374 "bom", // bom Núcleo de Informação e Coordenação do Ponto BR - NIC.br
375 "bond", // bond Bond University Limited
376 "boo", // boo Charleston Road Registry Inc.
377 "book", // book Amazon Registry Services, Inc.
378 "boots", // boots THE BOOTS COMPANY PLC
379 "bosch", // bosch Robert Bosch GMBH
380 "bostik", // bostik Bostik SA
381 "bot", // bot Amazon Registry Services, Inc.
382 "boutique", // boutique Over Galley, LLC
383 "bradesco", // bradesco Banco Bradesco S.A.
384 "bridgestone", // bridgestone Bridgestone Corporation
385 "broadway", // broadway Celebrate Broadway, Inc.
386 "broker", // broker DOTBROKER REGISTRY LTD
387 "brother", // brother Brother Industries, Ltd.
388 "brussels", // brussels DNS.be vzw
389 "budapest", // budapest Top Level Domain Holdings Limited
390 "bugatti", // bugatti Bugatti International SA
391 "build", // build Plan Bee LLC
392 "builders", // builders Atomic Madison, LLC
393 "business", // business Spring Cross, LLC
394 "buy", // buy Amazon Registry Services, INC
395 "buzz", // buzz DOTSTRATEGY CO.
396 "bzh", // bzh Association www.bzh
397 "cab", // cab Half Sunset, LLC
398 "cafe", // cafe Pioneer Canyon, LLC
399 "cal", // cal Charleston Road Registry Inc.
400 "call", // call Amazon Registry Services, Inc.
401 "camera", // camera Atomic Maple, LLC
402 "camp", // camp Delta Dynamite, LLC
403 "cancerresearch", // cancerresearch Australian Cancer Research Foundation
404 "canon", // canon Canon Inc.
405 "capetown", // capetown ZA Central Registry NPC trading as ZA Central Registry
406 "capital", // capital Delta Mill, LLC
407 "car", // car Cars Registry Limited
408 "caravan", // caravan Caravan International, Inc.
409 "cards", // cards Foggy Hollow, LLC
410 "care", // care Goose Cross, LLC
411 "career", // career dotCareer LLC
412 "careers", // careers Wild Corner, LLC
413 "cars", // cars Uniregistry, Corp.
414 "cartier", // cartier Richemont DNS Inc.
415 "casa", // casa Top Level Domain Holdings Limited
416 "cash", // cash Delta Lake, LLC
417 "casino", // casino Binky Sky, LLC
418 "cat", // cat Fundacio puntCAT
419 "catering", // catering New Falls. LLC
420 "cba", // cba COMMONWEALTH BANK OF AUSTRALIA
421 "cbn", // cbn The Christian Broadcasting Network, Inc.
422 "ceb", // ceb The Corporate Executive Board Company
423 "center", // center Tin Mill, LLC
424 "ceo", // ceo CEOTLD Pty Ltd
425 "cern", // cern European Organization for Nuclear Research (&quot;CERN&quot;)
426 "cfa", // cfa CFA Institute
427 "cfd", // cfd DOTCFD REGISTRY LTD
428 "chanel", // chanel Chanel International B.V.
429 "channel", // channel Charleston Road Registry Inc.
430 "chase", // chase JPMorgan Chase &amp; Co.
431 "chat", // chat Sand Fields, LLC
432 "cheap", // cheap Sand Cover, LLC
433 "chloe", // chloe Richemont DNS Inc.
434 "christmas", // christmas Uniregistry, Corp.
435 "chrome", // chrome Charleston Road Registry Inc.
436 "church", // church Holly Fileds, LLC
437 "cipriani", // cipriani Hotel Cipriani Srl
438 "circle", // circle Amazon Registry Services, Inc.
439 "cisco", // cisco Cisco Technology, Inc.
440 "citic", // citic CITIC Group Corporation
441 "city", // city Snow Sky, LLC
442 "cityeats", // cityeats Lifestyle Domain Holdings, Inc.
443 "claims", // claims Black Corner, LLC
444 "cleaning", // cleaning Fox Shadow, LLC
445 "click", // click Uniregistry, Corp.
446 "clinic", // clinic Goose Park, LLC
447 "clinique", // clinique The Estée Lauder Companies Inc.
448 "clothing", // clothing Steel Lake, LLC
449 "cloud", // cloud ARUBA S.p.A.
450 "club", // club .CLUB DOMAINS, LLC
451 "clubmed", // clubmed Club Méditerranée S.A.
452 "coach", // coach Koko Island, LLC
453 "codes", // codes Puff Willow, LLC
454 "coffee", // coffee Trixy Cover, LLC
455 "college", // college XYZ.COM LLC
456 "cologne", // cologne NetCologne Gesellschaft für Telekommunikation mbH
457 "com", // com VeriSign Global Registry Services
458 "commbank", // commbank COMMONWEALTH BANK OF AUSTRALIA
459 "community", // community Fox Orchard, LLC
460 "company", // company Silver Avenue, LLC
461 "compare", // compare iSelect Ltd
462 "computer", // computer Pine Mill, LLC
463 "comsec", // comsec VeriSign, Inc.
464 "condos", // condos Pine House, LLC
465 "construction", // construction Fox Dynamite, LLC
466 "consulting", // consulting United TLD Holdco, LTD.
467 "contact", // contact Top Level Spectrum, Inc.
468 "contractors", // contractors Magic Woods, LLC
469 "cooking", // cooking Top Level Domain Holdings Limited
470 "cool", // cool Koko Lake, LLC
471 "coop", // coop DotCooperation LLC
472 "corsica", // corsica Collectivité Territoriale de Corse
473 "country", // country Top Level Domain Holdings Limited
474 "coupon", // coupon Amazon Registry Services, Inc.
475 "coupons", // coupons Black Island, LLC
476 "courses", // courses OPEN UNIVERSITIES AUSTRALIA PTY LTD
477 "credit", // credit Snow Shadow, LLC
478 "creditcard", // creditcard Binky Frostbite, LLC
479 "creditunion", // creditunion CUNA Performance Resources, LLC
480 "cricket", // cricket dot Cricket Limited
481 "crown", // crown Crown Equipment Corporation
482 "crs", // crs Federated Co-operatives Limited
483 "cruises", // cruises Spring Way, LLC
484 "csc", // csc Alliance-One Services, Inc.
485 "cuisinella", // cuisinella SALM S.A.S.
486 "cymru", // cymru Nominet UK
487 "cyou", // cyou Beijing Gamease Age Digital Technology Co., Ltd.
488 "dabur", // dabur Dabur India Limited
489 "dad", // dad Charleston Road Registry Inc.
490 "dance", // dance United TLD Holdco Ltd.
491 "date", // date dot Date Limited
492 "dating", // dating Pine Fest, LLC
493 "datsun", // datsun NISSAN MOTOR CO., LTD.
494 "day", // day Charleston Road Registry Inc.
495 "dclk", // dclk Charleston Road Registry Inc.
496 "dealer", // dealer Dealer Dot Com, Inc.
497 "deals", // deals Sand Sunset, LLC
498 "degree", // degree United TLD Holdco, Ltd
499 "delivery", // delivery Steel Station, LLC
500 "dell", // dell Dell Inc.
501 "deloitte", // deloitte Deloitte Touche Tohmatsu
502 "delta", // delta Delta Air Lines, Inc.
503 "democrat", // democrat United TLD Holdco Ltd.
504 "dental", // dental Tin Birch, LLC
505 "dentist", // dentist United TLD Holdco, Ltd
506 "desi", // desi Desi Networks LLC
507 "design", // design Top Level Design, LLC
508 "dev", // dev Charleston Road Registry Inc.
509 "diamonds", // diamonds John Edge, LLC
510 "diet", // diet Uniregistry, Corp.
511 "digital", // digital Dash Park, LLC
512 "direct", // direct Half Trail, LLC
513 "directory", // directory Extra Madison, LLC
514 "discount", // discount Holly Hill, LLC
515 "dnp", // dnp Dai Nippon Printing Co., Ltd.
516 "docs", // docs Charleston Road Registry Inc.
517 "dog", // dog Koko Mill, LLC
518 "doha", // doha Communications Regulatory Authority (CRA)
519 "domains", // domains Sugar Cross, LLC
520 "download", // download dot Support Limited
521 "drive", // drive Charleston Road Registry Inc.
522 "dubai", // dubai Dubai Smart Government Department
523 "durban", // durban ZA Central Registry NPC trading as ZA Central Registry
524 "dvag", // dvag Deutsche Vermögensberatung Aktiengesellschaft DVAG
525 "earth", // earth Interlink Co., Ltd.
526 "eat", // eat Charleston Road Registry Inc.
527 "edeka", // edeka EDEKA Verband kaufmännischer Genossenschaften e.V.
528 "edu", // edu EDUCAUSE
529 "education", // education Brice Way, LLC
530 "email", // email Spring Madison, LLC
531 "emerck", // emerck Merck KGaA
532 "energy", // energy Binky Birch, LLC
533 "engineer", // engineer United TLD Holdco Ltd.
534 "engineering", // engineering Romeo Canyon
535 "enterprises", // enterprises Snow Oaks, LLC
536 "epson", // epson Seiko Epson Corporation
537 "equipment", // equipment Corn Station, LLC
538 "erni", // erni ERNI Group Holding AG
539 "esq", // esq Charleston Road Registry Inc.
540 "estate", // estate Trixy Park, LLC
541 "eurovision", // eurovision European Broadcasting Union (EBU)
542 "eus", // eus Puntueus Fundazioa
543 "events", // events Pioneer Maple, LLC
544 "everbank", // everbank EverBank
545 "exchange", // exchange Spring Falls, LLC
546 "expert", // expert Magic Pass, LLC
547 "exposed", // exposed Victor Beach, LLC
548 "express", // express Sea Sunset, LLC
549 "fage", // fage Fage International S.A.
550 "fail", // fail Atomic Pipe, LLC
551 "fairwinds", // fairwinds FairWinds Partners, LLC
552 "faith", // faith dot Faith Limited
553 "family", // family United TLD Holdco Ltd.
554 "fan", // fan Asiamix Digital Ltd
555 "fans", // fans Asiamix Digital Limited
556 "farm", // farm Just Maple, LLC
557 "fashion", // fashion Top Level Domain Holdings Limited
558 "fast", // fast Amazon Registry Services, Inc.
559 "feedback", // feedback Top Level Spectrum, Inc.
560 "ferrero", // ferrero Ferrero Trading Lux S.A.
561 "film", // film Motion Picture Domain Registry Pty Ltd
562 "final", // final Núcleo de Informação e Coordenação do Ponto BR - NIC.br
563 "finance", // finance Cotton Cypress, LLC
564 "financial", // financial Just Cover, LLC
565 "firestone", // firestone Bridgestone Corporation
566 "firmdale", // firmdale Firmdale Holdings Limited
567 "fish", // fish Fox Woods, LLC
568 "fishing", // fishing Top Level Domain Holdings Limited
569 "fit", // fit Minds + Machines Group Limited
570 "fitness", // fitness Brice Orchard, LLC
571 "flickr", // flickr Yahoo! Domain Services Inc.
572 "flights", // flights Fox Station, LLC
573 "florist", // florist Half Cypress, LLC
574 "flowers", // flowers Uniregistry, Corp.
575 "flsmidth", // flsmidth FLSmidth A/S
576 "fly", // fly Charleston Road Registry Inc.
577 "foo", // foo Charleston Road Registry Inc.
578 "football", // football Foggy Farms, LLC
579 "ford", // ford Ford Motor Company
580 "forex", // forex DOTFOREX REGISTRY LTD
581 "forsale", // forsale United TLD Holdco, LLC
582 "forum", // forum Fegistry, LLC
583 "foundation", // foundation John Dale, LLC
584 "fox", // fox FOX Registry, LLC
585 "fresenius", // fresenius Fresenius Immobilien-Verwaltungs-GmbH
586 "frl", // frl FRLregistry B.V.
587 "frogans", // frogans OP3FT
588 "frontier", // frontier Frontier Communications Corporation
589 "fund", // fund John Castle, LLC
590 "furniture", // furniture Lone Fields, LLC
591 "futbol", // futbol United TLD Holdco, Ltd.
592 "fyi", // fyi Silver Tigers, LLC
593 "gal", // gal Asociación puntoGAL
594 "gallery", // gallery Sugar House, LLC
595 "gallup", // gallup Gallup, Inc.
596 "game", // game Uniregistry, Corp.
597 "garden", // garden Top Level Domain Holdings Limited
598 "gbiz", // gbiz Charleston Road Registry Inc.
599 "gdn", // gdn Joint Stock Company "Navigation-information systems"
600 "gea", // gea GEA Group Aktiengesellschaft
601 "gent", // gent COMBELL GROUP NV/SA
602 "genting", // genting Resorts World Inc. Pte. Ltd.
603 "ggee", // ggee GMO Internet, Inc.
604 "gift", // gift Uniregistry, Corp.
605 "gifts", // gifts Goose Sky, LLC
606 "gives", // gives United TLD Holdco Ltd.
607 "giving", // giving Giving Limited
608 "glass", // glass Black Cover, LLC
609 "gle", // gle Charleston Road Registry Inc.
610 "global", // global Dot Global Domain Registry Limited
611 "globo", // globo Globo Comunicação e Participações S.A
612 "gmail", // gmail Charleston Road Registry Inc.
613 "gmo", // gmo GMO Internet, Inc.
614 "gmx", // gmx 1&amp;1 Mail &amp; Media GmbH
615 "gold", // gold June Edge, LLC
616 "goldpoint", // goldpoint YODOBASHI CAMERA CO.,LTD.
617 "golf", // golf Lone Falls, LLC
618 "goo", // goo NTT Resonant Inc.
619 "goog", // goog Charleston Road Registry Inc.
620 "google", // google Charleston Road Registry Inc.
621 "gop", // gop Republican State Leadership Committee, Inc.
622 "got", // got Amazon Registry Services, Inc.
623 "gov", // gov General Services Administration Attn: QTDC, 2E08 (.gov Domain Registration)
624 "grainger", // grainger Grainger Registry Services, LLC
625 "graphics", // graphics Over Madison, LLC
626 "gratis", // gratis Pioneer Tigers, LLC
627 "green", // green Afilias Limited
628 "gripe", // gripe Corn Sunset, LLC
629 "group", // group Romeo Town, LLC
630 "gucci", // gucci Guccio Gucci S.p.a.
631 "guge", // guge Charleston Road Registry Inc.
632 "guide", // guide Snow Moon, LLC
633 "guitars", // guitars Uniregistry, Corp.
634 "guru", // guru Pioneer Cypress, LLC
635 "hamburg", // hamburg Hamburg Top-Level-Domain GmbH
636 "hangout", // hangout Charleston Road Registry Inc.
637 "haus", // haus United TLD Holdco, LTD.
638 "hdfcbank", // hdfcbank HDFC Bank Limited
639 "health", // health DotHealth, LLC
640 "healthcare", // healthcare Silver Glen, LLC
641 "help", // help Uniregistry, Corp.
642 "helsinki", // helsinki City of Helsinki
643 "here", // here Charleston Road Registry Inc.
644 "hermes", // hermes Hermes International
645 "hiphop", // hiphop Uniregistry, Corp.
646 "hitachi", // hitachi Hitachi, Ltd.
647 "hiv", // hiv dotHIV gemeinnuetziger e.V.
648 "hockey", // hockey Half Willow, LLC
649 "holdings", // holdings John Madison, LLC
650 "holiday", // holiday Goose Woods, LLC
651 "homedepot", // homedepot Homer TLC, Inc.
652 "homes", // homes DERHomes, LLC
653 "honda", // honda Honda Motor Co., Ltd.
654 "horse", // horse Top Level Domain Holdings Limited
655 "host", // host DotHost Inc.
656 "hosting", // hosting Uniregistry, Corp.
657 "hoteles", // hoteles Travel Reservations SRL
658 "hotmail", // hotmail Microsoft Corporation
659 "house", // house Sugar Park, LLC
660 "how", // how Charleston Road Registry Inc.
661 "hsbc", // hsbc HSBC Holdings PLC
662 "hyundai", // hyundai Hyundai Motor Company
663 "ibm", // ibm International Business Machines Corporation
664 "icbc", // icbc Industrial and Commercial Bank of China Limited
665 "ice", // ice IntercontinentalExchange, Inc.
666 "icu", // icu One.com A/S
667 "ifm", // ifm ifm electronic gmbh
668 "iinet", // iinet Connect West Pty. Ltd.
669 "immo", // immo Auburn Bloom, LLC
670 "immobilien", // immobilien United TLD Holdco Ltd.
671 "industries", // industries Outer House, LLC
672 "infiniti", // infiniti NISSAN MOTOR CO., LTD.
673 "info", // info Afilias Limited
674 "ing", // ing Charleston Road Registry Inc.
675 "ink", // ink Top Level Design, LLC
676 "institute", // institute Outer Maple, LLC
677 "insurance", // insurance fTLD Registry Services LLC
678 "insure", // insure Pioneer Willow, LLC
679 "int", // int Internet Assigned Numbers Authority
680 "international", // international Wild Way, LLC
681 "investments", // investments Holly Glen, LLC
682 "ipiranga", // ipiranga Ipiranga Produtos de Petroleo S.A.
683 "irish", // irish Dot-Irish LLC
684 "iselect", // iselect iSelect Ltd
685 "ist", // ist Istanbul Metropolitan Municipality
686 "istanbul", // istanbul Istanbul Metropolitan Municipality / Medya A.S.
687 "itau", // itau Itau Unibanco Holding S.A.
688 "iwc", // iwc Richemont DNS Inc.
689 "jaguar", // jaguar Jaguar Land Rover Ltd
690 "java", // java Oracle Corporation
691 "jcb", // jcb JCB Co., Ltd.
692 "jetzt", // jetzt New TLD Company AB
693 "jewelry", // jewelry Wild Bloom, LLC
694 "jlc", // jlc Richemont DNS Inc.
695 "jll", // jll Jones Lang LaSalle Incorporated
696 "jmp", // jmp Matrix IP LLC
697 "jobs", // jobs Employ Media LLC
698 "joburg", // joburg ZA Central Registry NPC trading as ZA Central Registry
699 "jot", // jot Amazon Registry Services, Inc.
700 "joy", // joy Amazon Registry Services, Inc.
701 "jpmorgan", // jpmorgan JPMorgan Chase &amp; Co.
702 "jprs", // jprs Japan Registry Services Co., Ltd.
703 "juegos", // juegos Uniregistry, Corp.
704 "kaufen", // kaufen United TLD Holdco Ltd.
705 "kddi", // kddi KDDI CORPORATION
706 "kfh", // kfh Kuwait Finance House
707 "kia", // kia KIA MOTORS CORPORATION
708 "kim", // kim Afilias Limited
709 "kinder", // kinder Ferrero Trading Lux S.A.
710 "kitchen", // kitchen Just Goodbye, LLC
711 "kiwi", // kiwi DOT KIWI LIMITED
712 "koeln", // koeln NetCologne Gesellschaft für Telekommunikation mbH
713 "komatsu", // komatsu Komatsu Ltd.
714 "kpn", // kpn Koninklijke KPN N.V.
715 "krd", // krd KRG Department of Information Technology
716 "kred", // kred KredTLD Pty Ltd
717 "kyoto", // kyoto Academic Institution: Kyoto Jyoho Gakuen
718 "lacaixa", // lacaixa CAIXA D&#39;ESTALVIS I PENSIONS DE BARCELONA
719 "lamborghini", // lamborghini Automobili Lamborghini S.p.A.
720 "lamer", // lamer The Estée Lauder Companies Inc.
721 "lancaster", // lancaster LANCASTER
722 "land", // land Pine Moon, LLC
723 "landrover", // landrover Jaguar Land Rover Ltd
724 "lanxess", // lanxess LANXESS Corporation
725 "lasalle", // lasalle Jones Lang LaSalle Incorporated
726 "lat", // lat ECOM-LAC Federación de Latinoamérica y el Caribe para Internet y el Comercio Electrónico
727 "latrobe", // latrobe La Trobe University
728 "law", // law Minds + Machines Group Limited
729 "lawyer", // lawyer United TLD Holdco, Ltd
730 "lds", // lds IRI Domain Management, LLC
731 "lease", // lease Victor Trail, LLC
732 "leclerc", // leclerc A.C.D. LEC Association des Centres Distributeurs Edouard Leclerc
733 "legal", // legal Blue Falls, LLC
734 "lexus", // lexus TOYOTA MOTOR CORPORATION
735 "lgbt", // lgbt Afilias Limited
736 "liaison", // liaison Liaison Technologies, Incorporated
737 "lidl", // lidl Schwarz Domains und Services GmbH &amp; Co. KG
738 "life", // life Trixy Oaks, LLC
739 "lifeinsurance", // lifeinsurance American Council of Life Insurers
740 "lifestyle", // lifestyle Lifestyle Domain Holdings, Inc.
741 "lighting", // lighting John McCook, LLC
742 "like", // like Amazon Registry Services, Inc.
743 "limited", // limited Big Fest, LLC
744 "limo", // limo Hidden Frostbite, LLC
745 "lincoln", // lincoln Ford Motor Company
746 "linde", // linde Linde Aktiengesellschaft
747 "link", // link Uniregistry, Corp.
748 "live", // live United TLD Holdco Ltd.
749 "living", // living Lifestyle Domain Holdings, Inc.
750 "lixil", // lixil LIXIL Group Corporation
751 "loan", // loan dot Loan Limited
752 "loans", // loans June Woods, LLC
753 "lol", // lol Uniregistry, Corp.
754 "london", // london Dot London Domains Limited
755 "lotte", // lotte Lotte Holdings Co., Ltd.
756 "lotto", // lotto Afilias Limited
757 "love", // love Merchant Law Group LLP
758 "ltd", // ltd Over Corner, LLC
759 "ltda", // ltda InterNetX Corp.
760 "lupin", // lupin LUPIN LIMITED
761 "luxe", // luxe Top Level Domain Holdings Limited
762 "luxury", // luxury Luxury Partners LLC
763 "madrid", // madrid Comunidad de Madrid
764 "maif", // maif Mutuelle Assurance Instituteur France (MAIF)
765 "maison", // maison Victor Frostbite, LLC
766 "makeup", // makeup L&#39;Oréal
767 "man", // man MAN SE
768 "management", // management John Goodbye, LLC
769 "mango", // mango PUNTO FA S.L.
770 "market", // market Unitied TLD Holdco, Ltd
771 "marketing", // marketing Fern Pass, LLC
772 "markets", // markets DOTMARKETS REGISTRY LTD
773 "marriott", // marriott Marriott Worldwide Corporation
774 "mba", // mba Lone Hollow, LLC
775 "med", // med Medistry LLC
776 "media", // media Grand Glen, LLC
777 "meet", // meet Afilias Limited
778 "melbourne", // melbourne The Crown in right of the State of Victoria
779 "meme", // meme Charleston Road Registry Inc.
780 "memorial", // memorial Dog Beach, LLC
781 "men", // men Exclusive Registry Limited
782 "menu", // menu Wedding TLD2, LLC
783 "meo", // meo PT Comunicacoes S.A.
784 "miami", // miami Top Level Domain Holdings Limited
785 "microsoft", // microsoft Microsoft Corporation
786 "mil", // mil DoD Network Information Center
787 "mini", // mini Bayerische Motoren Werke Aktiengesellschaft
788 "mma", // mma MMA IARD
789 "mobi", // mobi Afilias Technologies Limited dba dotMobi
790 "mobily", // mobily GreenTech Consultancy Company W.L.L.
791 "moda", // moda United TLD Holdco Ltd.
792 "moe", // moe Interlink Co., Ltd.
793 "moi", // moi Amazon Registry Services, Inc.
794 "mom", // mom Uniregistry, Corp.
795 "monash", // monash Monash University
796 "money", // money Outer McCook, LLC
797 "montblanc", // montblanc Richemont DNS Inc.
798 "mormon", // mormon IRI Domain Management, LLC (&quot;Applicant&quot;)
799 "mortgage", // mortgage United TLD Holdco, Ltd
800 "moscow", // moscow Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID)
801 "motorcycles", // motorcycles DERMotorcycles, LLC
802 "mov", // mov Charleston Road Registry Inc.
803 "movie", // movie New Frostbite, LLC
804 "movistar", // movistar Telefónica S.A.
805 "mtn", // mtn MTN Dubai Limited
806 "mtpc", // mtpc Mitsubishi Tanabe Pharma Corporation
807 "mtr", // mtr MTR Corporation Limited
808 "museum", // museum Museum Domain Management Association
809 "mutuelle", // mutuelle Fédération Nationale de la Mutualité Française
810 "nadex", // nadex Nadex Domains, Inc
811 "nagoya", // nagoya GMO Registry, Inc.
812 "name", // name VeriSign Information Services, Inc.
813 "natura", // natura NATURA COSMÉTICOS S.A.
814 "navy", // navy United TLD Holdco Ltd.
815 "nec", // nec NEC Corporation
816 "net", // net VeriSign Global Registry Services
817 "netbank", // netbank COMMONWEALTH BANK OF AUSTRALIA
818 "network", // network Trixy Manor, LLC
819 "neustar", // neustar NeuStar, Inc.
820 "new", // new Charleston Road Registry Inc.
821 "news", // news United TLD Holdco Ltd.
822 "nexus", // nexus Charleston Road Registry Inc.
823 "ngo", // ngo Public Interest Registry
824 "nhk", // nhk Japan Broadcasting Corporation (NHK)
825 "nico", // nico DWANGO Co., Ltd.
826 "nikon", // nikon NIKON CORPORATION
827 "ninja", // ninja United TLD Holdco Ltd.
828 "nissan", // nissan NISSAN MOTOR CO., LTD.
829 "nokia", // nokia Nokia Corporation
830 "norton", // norton Symantec Corporation
831 "nowruz", // nowruz Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
832 "nra", // nra NRA Holdings Company, INC.
833 "nrw", // nrw Minds + Machines GmbH
834 "ntt", // ntt NIPPON TELEGRAPH AND TELEPHONE CORPORATION
835 "nyc", // nyc The City of New York by and through the New York City Department of Information Technology &amp; Telecommunications
836 "obi", // obi OBI Group Holding SE &amp; Co. KGaA
837 "office", // office Microsoft Corporation
838 "okinawa", // okinawa BusinessRalliart inc.
839 "omega", // omega The Swatch Group Ltd
840 "one", // one One.com A/S
841 "ong", // ong Public Interest Registry
842 "onl", // onl I-REGISTRY Ltd., Niederlassung Deutschland
843 "online", // online DotOnline Inc.
844 "ooo", // ooo INFIBEAM INCORPORATION LIMITED
845 "oracle", // oracle Oracle Corporation
846 "orange", // orange Orange Brand Services Limited
847 "org", // org Public Interest Registry (PIR)
848 "organic", // organic Afilias Limited
849 "origins", // origins The Estée Lauder Companies Inc.
850 "osaka", // osaka Interlink Co., Ltd.
851 "otsuka", // otsuka Otsuka Holdings Co., Ltd.
852 "ovh", // ovh OVH SAS
853 "page", // page Charleston Road Registry Inc.
854 "pamperedchef", // pamperedchef The Pampered Chef, Ltd.
855 "panerai", // panerai Richemont DNS Inc.
856 "paris", // paris City of Paris
857 "pars", // pars Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
858 "partners", // partners Magic Glen, LLC
859 "parts", // parts Sea Goodbye, LLC
860 "party", // party Blue Sky Registry Limited
861 "pet", // pet Afilias plc
862 "pharmacy", // pharmacy National Association of Boards of Pharmacy
863 "philips", // philips Koninklijke Philips N.V.
864 "photo", // photo Uniregistry, Corp.
865 "photography", // photography Sugar Glen, LLC
866 "photos", // photos Sea Corner, LLC
867 "physio", // physio PhysBiz Pty Ltd
868 "piaget", // piaget Richemont DNS Inc.
869 "pics", // pics Uniregistry, Corp.
870 "pictet", // pictet Pictet Europe S.A.
871 "pictures", // pictures Foggy Sky, LLC
872 "pid", // pid Top Level Spectrum, Inc.
873 "pin", // pin Amazon Registry Services, Inc.
874 "ping", // ping Ping Registry Provider, Inc.
875 "pink", // pink Afilias Limited
876 "pizza", // pizza Foggy Moon, LLC
877 "place", // place Snow Galley, LLC
878 "play", // play Charleston Road Registry Inc.
879 "playstation", // playstation Sony Computer Entertainment Inc.
880 "plumbing", // plumbing Spring Tigers, LLC
881 "plus", // plus Sugar Mill, LLC
882 "pohl", // pohl Deutsche Vermögensberatung Aktiengesellschaft DVAG
883 "poker", // poker Afilias Domains No. 5 Limited
884 "porn", // porn ICM Registry PN LLC
885 "post", // post Universal Postal Union
886 "praxi", // praxi Praxi S.p.A.
887 "press", // press DotPress Inc.
888 "pro", // pro Registry Services Corporation dba RegistryPro
889 "prod", // prod Charleston Road Registry Inc.
890 "productions", // productions Magic Birch, LLC
891 "prof", // prof Charleston Road Registry Inc.
892 "promo", // promo Afilias plc
893 "properties", // properties Big Pass, LLC
894 "property", // property Uniregistry, Corp.
895 "protection", // protection XYZ.COM LLC
896 "pub", // pub United TLD Holdco Ltd.
897 "pwc", // pwc PricewaterhouseCoopers LLP
898 "qpon", // qpon dotCOOL, Inc.
899 "quebec", // quebec PointQuébec Inc
900 "quest", // quest Quest ION Limited
901 "racing", // racing Premier Registry Limited
902 "read", // read Amazon Registry Services, Inc.
903 "realtor", // realtor Real Estate Domains LLC
904 "realty", // realty Fegistry, LLC
905 "recipes", // recipes Grand Island, LLC
906 "red", // red Afilias Limited
907 "redstone", // redstone Redstone Haute Couture Co., Ltd.
908 "redumbrella", // redumbrella Travelers TLD, LLC
909 "rehab", // rehab United TLD Holdco Ltd.
910 "reise", // reise Foggy Way, LLC
911 "reisen", // reisen New Cypress, LLC
912 "reit", // reit National Association of Real Estate Investment Trusts, Inc.
913 "ren", // ren Beijing Qianxiang Wangjing Technology Development Co., Ltd.
914 "rent", // rent XYZ.COM LLC
915 "rentals", // rentals Big Hollow,LLC
916 "repair", // repair Lone Sunset, LLC
917 "report", // report Binky Glen, LLC
918 "republican", // republican United TLD Holdco Ltd.
919 "rest", // rest Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable
920 "restaurant", // restaurant Snow Avenue, LLC
921 "review", // review dot Review Limited
922 "reviews", // reviews United TLD Holdco, Ltd.
923 "rexroth", // rexroth Robert Bosch GMBH
924 "rich", // rich I-REGISTRY Ltd., Niederlassung Deutschland
925 "ricoh", // ricoh Ricoh Company, Ltd.
926 "rio", // rio Empresa Municipal de Informática SA - IPLANRIO
927 "rip", // rip United TLD Holdco Ltd.
928 "rocher", // rocher Ferrero Trading Lux S.A.
929 "rocks", // rocks United TLD Holdco, LTD.
930 "rodeo", // rodeo Top Level Domain Holdings Limited
931 "room", // room Amazon Registry Services, Inc.
932 "rsvp", // rsvp Charleston Road Registry Inc.
933 "ruhr", // ruhr regiodot GmbH &amp; Co. KG
934 "run", // run Snow Park, LLC
935 "rwe", // rwe RWE AG
936 "ryukyu", // ryukyu BusinessRalliart inc.
937 "saarland", // saarland dotSaarland GmbH
938 "safe", // safe Amazon Registry Services, Inc.
939 "safety", // safety Safety Registry Services, LLC.
940 "sakura", // sakura SAKURA Internet Inc.
941 "sale", // sale United TLD Holdco, Ltd
942 "salon", // salon Outer Orchard, LLC
943 "samsung", // samsung SAMSUNG SDS CO., LTD
944 "sandvik", // sandvik Sandvik AB
945 "sandvikcoromant", // sandvikcoromant Sandvik AB
946 "sanofi", // sanofi Sanofi
947 "sap", // sap SAP AG
948 "sapo", // sapo PT Comunicacoes S.A.
949 "sarl", // sarl Delta Orchard, LLC
950 "sas", // sas Research IP LLC
951 "saxo", // saxo Saxo Bank A/S
952 "sbs", // sbs SPECIAL BROADCASTING SERVICE CORPORATION
953 "sca", // sca SVENSKA CELLULOSA AKTIEBOLAGET SCA (publ)
954 "scb", // scb The Siam Commercial Bank Public Company Limited (&quot;SCB&quot;)
955 "schaeffler", // schaeffler Schaeffler Technologies AG &amp; Co. KG
956 "schmidt", // schmidt SALM S.A.S.
957 "scholarships", // scholarships Scholarships.com, LLC
958 "school", // school Little Galley, LLC
959 "schule", // schule Outer Moon, LLC
960 "schwarz", // schwarz Schwarz Domains und Services GmbH &amp; Co. KG
961 "science", // science dot Science Limited
962 "scor", // scor SCOR SE
963 "scot", // scot Dot Scot Registry Limited
964 "seat", // seat SEAT, S.A. (Sociedad Unipersonal)
965 "security", // security XYZ.COM LLC
966 "seek", // seek Seek Limited
967 "select", // select iSelect Ltd
968 "sener", // sener Sener Ingeniería y Sistemas, S.A.
969 "services", // services Fox Castle, LLC
970 "seven", // seven Seven West Media Ltd
971 "sew", // sew SEW-EURODRIVE GmbH &amp; Co KG
972 "sex", // sex ICM Registry SX LLC
973 "sexy", // sexy Uniregistry, Corp.
974 "sfr", // sfr Societe Francaise du Radiotelephone - SFR
975 "sharp", // sharp Sharp Corporation
976 "shell", // shell Shell Information Technology International Inc
977 "shia", // shia Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
978 "shiksha", // shiksha Afilias Limited
979 "shoes", // shoes Binky Galley, LLC
980 "show", // show Snow Beach, LLC
981 "shriram", // shriram Shriram Capital Ltd.
982 "singles", // singles Fern Madison, LLC
983 "site", // site DotSite Inc.
984 "ski", // ski STARTING DOT LIMITED
985 "skin", // skin L&#39;Oréal
986 "sky", // sky Sky International AG
987 "skype", // skype Microsoft Corporation
988 "smile", // smile Amazon Registry Services, Inc.
989 "sncf", // sncf SNCF (Société Nationale des Chemins de fer Francais)
990 "soccer", // soccer Foggy Shadow, LLC
991 "social", // social United TLD Holdco Ltd.
992 "softbank", // softbank SoftBank Group Corp.
993 "software", // software United TLD Holdco, Ltd
994 "sohu", // sohu Sohu.com Limited
995 "solar", // solar Ruby Town, LLC
996 "solutions", // solutions Silver Cover, LLC
997 "song", // song Amazon EU S.à r.l.
998 "sony", // sony Sony Corporation
999 "soy", // soy Charleston Road Registry Inc.
1000 "space", // space DotSpace Inc.
1001 "spiegel", // spiegel SPIEGEL-Verlag Rudolf Augstein GmbH &amp; Co. KG
1002 "spot", // spot Amazon Registry Services, Inc.
1003 "spreadbetting", // spreadbetting DOTSPREADBETTING REGISTRY LTD
1004 "srl", // srl InterNetX Corp.
1005 "stada", // stada STADA Arzneimittel AG
1006 "star", // star Star India Private Limited
1007 "starhub", // starhub StarHub Limited
1008 "statefarm", // statefarm State Farm Mutual Automobile Insurance Company
1009 "statoil", // statoil Statoil ASA
1010 "stc", // stc Saudi Telecom Company
1011 "stcgroup", // stcgroup Saudi Telecom Company
1012 "stockholm", // stockholm Stockholms kommun
1013 "storage", // storage Self Storage Company LLC
1014 "store", // store DotStore Inc.
1015 "studio", // studio United TLD Holdco Ltd.
1016 "study", // study OPEN UNIVERSITIES AUSTRALIA PTY LTD
1017 "style", // style Binky Moon, LLC
1018 "sucks", // sucks Vox Populi Registry Ltd.
1019 "supplies", // supplies Atomic Fields, LLC
1020 "supply", // supply Half Falls, LLC
1021 "support", // support Grand Orchard, LLC
1022 "surf", // surf Top Level Domain Holdings Limited
1023 "surgery", // surgery Tin Avenue, LLC
1024 "suzuki", // suzuki SUZUKI MOTOR CORPORATION
1025 "swatch", // swatch The Swatch Group Ltd
1026 "swiss", // swiss Swiss Confederation
1027 "sydney", // sydney State of New South Wales, Department of Premier and Cabinet
1028 "symantec", // symantec Symantec Corporation
1029 "systems", // systems Dash Cypress, LLC
1030 "tab", // tab Tabcorp Holdings Limited
1031 "taipei", // taipei Taipei City Government
1032 "taobao", // taobao Alibaba Group Holding Limited
1033 "tatamotors", // tatamotors Tata Motors Ltd
1034 "tatar", // tatar Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic"
1035 "tattoo", // tattoo Uniregistry, Corp.
1036 "tax", // tax Storm Orchard, LLC
1037 "taxi", // taxi Pine Falls, LLC
1038 "tci", // tci Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
1039 "team", // team Atomic Lake, LLC
1040 "tech", // tech Dot Tech LLC
1041 "technology", // technology Auburn Falls, LLC
1042 "tel", // tel Telnic Ltd.
1043 "telecity", // telecity TelecityGroup International Limited
1044 "telefonica", // telefonica Telefónica S.A.
1045 "temasek", // temasek Temasek Holdings (Private) Limited
1046 "tennis", // tennis Cotton Bloom, LLC
1047 "thd", // thd Homer TLC, Inc.
1048 "theater", // theater Blue Tigers, LLC
1049 "theatre", // theatre XYZ.COM LLC
1050 "tickets", // tickets Accent Media Limited
1051 "tienda", // tienda Victor Manor, LLC
1052 "tiffany", // tiffany Tiffany and Company
1053 "tips", // tips Corn Willow, LLC
1054 "tires", // tires Dog Edge, LLC
1055 "tirol", // tirol punkt Tirol GmbH
1056 "tmall", // tmall Alibaba Group Holding Limited
1057 "today", // today Pearl Woods, LLC
1058 "tokyo", // tokyo GMO Registry, Inc.
1059 "tools", // tools Pioneer North, LLC
1060 "top", // top Jiangsu Bangning Science &amp; Technology Co.,Ltd.
1061 "toray", // toray Toray Industries, Inc.
1062 "toshiba", // toshiba TOSHIBA Corporation
1063 "tours", // tours Sugar Station, LLC
1064 "town", // town Koko Moon, LLC
1065 "toyota", // toyota TOYOTA MOTOR CORPORATION
1066 "toys", // toys Pioneer Orchard, LLC
1067 "trade", // trade Elite Registry Limited
1068 "trading", // trading DOTTRADING REGISTRY LTD
1069 "training", // training Wild Willow, LLC
1070 "travel", // travel Tralliance Registry Management Company, LLC.
1071 "travelers", // travelers Travelers TLD, LLC
1072 "travelersinsurance", // travelersinsurance Travelers TLD, LLC
1073 "trust", // trust Artemis Internet Inc
1074 "trv", // trv Travelers TLD, LLC
1075 "tube", // tube Latin American Telecom LLC
1076 "tui", // tui TUI AG
1077 "tunes", // tunes Amazon Registry Services, Inc.
1078 "tushu", // tushu Amazon Registry Services, Inc.
1079 "tvs", // tvs T V SUNDRAM IYENGAR &amp; SONS PRIVATE LIMITED
1080 "ubs", // ubs UBS AG
1081 "unicom", // unicom China United Network Communications Corporation Limited
1082 "university", // university Little Station, LLC
1083 "uno", // uno Dot Latin LLC
1084 "uol", // uol UBN INTERNET LTDA.
1085 "vacations", // vacations Atomic Tigers, LLC
1086 "vana", // vana Lifestyle Domain Holdings, Inc.
1087 "vegas", // vegas Dot Vegas, Inc.
1088 "ventures", // ventures Binky Lake, LLC
1089 "verisign", // verisign VeriSign, Inc.
1090 "versicherung", // versicherung dotversicherung-registry GmbH
1091 "vet", // vet United TLD Holdco, Ltd
1092 "viajes", // viajes Black Madison, LLC
1093 "video", // video United TLD Holdco, Ltd
1094 "viking", // viking Viking River Cruises (Bermuda) Ltd.
1095 "villas", // villas New Sky, LLC
1096 "vin", // vin Holly Shadow, LLC
1097 "vip", // vip Minds + Machines Group Limited
1098 "virgin", // virgin Virgin Enterprises Limited
1099 "vision", // vision Koko Station, LLC
1100 "vista", // vista Vistaprint Limited
1101 "vistaprint", // vistaprint Vistaprint Limited
1102 "viva", // viva Saudi Telecom Company
1103 "vlaanderen", // vlaanderen DNS.be vzw
1104 "vodka", // vodka Top Level Domain Holdings Limited
1105 "volkswagen", // volkswagen Volkswagen Group of America Inc.
1106 "vote", // vote Monolith Registry LLC
1107 "voting", // voting Valuetainment Corp.
1108 "voto", // voto Monolith Registry LLC
1109 "voyage", // voyage Ruby House, LLC
1110 "wales", // wales Nominet UK
1111 "walter", // walter Sandvik AB
1112 "wang", // wang Zodiac Registry Limited
1113 "wanggou", // wanggou Amazon Registry Services, Inc.
1114 "watch", // watch Sand Shadow, LLC
1115 "watches", // watches Richemont DNS Inc.
1116 "weather", // weather The Weather Channel, LLC
1117 "weatherchannel", // weatherchannel The Weather Channel, LLC
1118 "webcam", // webcam dot Webcam Limited
1119 "weber", // weber Saint-Gobain Weber SA
1120 "website", // website DotWebsite Inc.
1121 "wed", // wed Atgron, Inc.
1122 "wedding", // wedding Top Level Domain Holdings Limited
1123 "weir", // weir Weir Group IP Limited
1124 "whoswho", // whoswho Who&#39;s Who Registry
1125 "wien", // wien punkt.wien GmbH
1126 "wiki", // wiki Top Level Design, LLC
1127 "williamhill", // williamhill William Hill Organization Limited
1128 "win", // win First Registry Limited
1129 "windows", // windows Microsoft Corporation
1130 "wine", // wine June Station, LLC
1131 "wme", // wme William Morris Endeavor Entertainment, LLC
1132 "wolterskluwer", // wolterskluwer Wolters Kluwer N.V.
1133 "work", // work Top Level Domain Holdings Limited
1134 "works", // works Little Dynamite, LLC
1135 "world", // world Bitter Fields, LLC
1136 "wtc", // wtc World Trade Centers Association, Inc.
1137 "wtf", // wtf Hidden Way, LLC
1138 "xbox", // xbox Microsoft Corporation
1139 "xerox", // xerox Xerox DNHC LLC
1140 "xin", // xin Elegant Leader Limited
1141 "xn--11b4c3d", // कॉम VeriSign Sarl
1142 "xn--1ck2e1b", // セール Amazon Registry Services, Inc.
1143 "xn--1qqw23a", // 佛山 Guangzhou YU Wei Information Technology Co., Ltd.
1144 "xn--30rr7y", // 慈善 Excellent First Limited
1145 "xn--3bst00m", // 集团 Eagle Horizon Limited
1146 "xn--3ds443g", // 在线 TLD REGISTRY LIMITED
1147 "xn--3pxu8k", // 点看 VeriSign Sarl
1148 "xn--42c2d9a", // คอม VeriSign Sarl
1149 "xn--45q11c", // 八卦 Zodiac Scorpio Limited
1150 "xn--4gbrim", // موقع Suhub Electronic Establishment
1151 "xn--55qw42g", // 公益 China Organizational Name Administration Center
1152 "xn--55qx5d", // 公司 Computer Network Information Center of Chinese Academy of Sciences (China Internet Network Information Center)
1153 "xn--6frz82g", // 移动 Afilias Limited
1154 "xn--6qq986b3xl", // 我爱你 Tycoon Treasure Limited
1155 "xn--80adxhks", // москва Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID)
1156 "xn--80asehdb", // онлайн CORE Association
1157 "xn--80aswg", // сайт CORE Association
1158 "xn--8y0a063a", // 联通 China United Network Communications Corporation Limited
1159 "xn--9dbq2a", // קום VeriSign Sarl
1160 "xn--9et52u", // 时尚 RISE VICTORY LIMITED
1161 "xn--b4w605ferd", // 淡马锡 Temasek Holdings (Private) Limited
1162 "xn--bck1b9a5dre4c", // ファッション Amazon Registry Services, Inc.
1163 "xn--c1avg", // орг Public Interest Registry
1164 "xn--c2br7g", // नेट VeriSign Sarl
1165 "xn--cck2b3b", // ストア Amazon Registry Services, Inc.
1166 "xn--cg4bki", // 삼성 SAMSUNG SDS CO., LTD
1167 "xn--czr694b", // 商标 HU YI GLOBAL INFORMATION RESOURCES(HOLDING) COMPANY.HONGKONG LIMITED
1168 "xn--czrs0t", // 商店 Wild Island, LLC
1169 "xn--czru2d", // 商城 Zodiac Aquarius Limited
1170 "xn--d1acj3b", // дети The Foundation for Network Initiatives “The Smart Internet”
1171 "xn--eckvdtc9d", // ポイント Amazon Registry Services, Inc.
1172 "xn--efvy88h", // 新闻 Xinhua News Agency Guangdong Branch 新华通讯社广东分社
1173 "xn--estv75g", // 工行 Industrial and Commercial Bank of China Limited
1174 "xn--fhbei", // كوم VeriSign Sarl
1175 "xn--fiq228c5hs", // 中文网 TLD REGISTRY LIMITED
1176 "xn--fiq64b", // 中信 CITIC Group Corporation
1177 "xn--fjq720a", // 娱乐 Will Bloom, LLC
1178 "xn--flw351e", // 谷歌 Charleston Road Registry Inc.
1179 "xn--g2xx48c", // 购物 Minds + Machines Group Limited
1180 "xn--gckr3f0f", // クラウド Amazon Registry Services, Inc.
1181 "xn--hxt814e", // 网店 Zodiac Libra Limited
1182 "xn--i1b6b1a6a2e", // संगठन Public Interest Registry
1183 "xn--imr513n", // 餐厅 HU YI GLOBAL INFORMATION RESOURCES (HOLDING) COMPANY. HONGKONG LIMITED
1184 "xn--io0a7i", // 网络 Computer Network Information Center of Chinese Academy of Sciences (China Internet Network Information Center)
1185 "xn--j1aef", // ком VeriSign Sarl
1186 "xn--jlq61u9w7b", // 诺基亚 Nokia Corporation
1187 "xn--jvr189m", // 食品 Amazon Registry Services, Inc.
1188 "xn--kcrx77d1x4a", // 飞利浦 Koninklijke Philips N.V.
1189 "xn--kpu716f", // 手表 Richemont DNS Inc.
1190 "xn--kput3i", // 手机 Beijing RITT-Net Technology Development Co., Ltd
1191 "xn--mgba3a3ejt", // ارامكو Aramco Services Company
1192 "xn--mgbab2bd", // بازار CORE Association
1193 "xn--mgbb9fbpob", // موبايلي GreenTech Consultancy Company W.L.L.
1194 "xn--mgbt3dhd", // همراه Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
1195 "xn--mk1bu44c", // 닷컴 VeriSign Sarl
1196 "xn--mxtq1m", // 政府 Net-Chinese Co., Ltd.
1197 "xn--ngbc5azd", // شبكة International Domain Registry Pty. Ltd.
1198 "xn--ngbe9e0a", // بيتك Kuwait Finance House
1199 "xn--nqv7f", // 机构 Public Interest Registry
1200 "xn--nqv7fs00ema", // 组织机构 Public Interest Registry
1201 "xn--nyqy26a", // 健康 Stable Tone Limited
1202 "xn--p1acf", // рус Rusnames Limited
1203 "xn--pbt977c", // 珠宝 Richemont DNS Inc.
1204 "xn--pssy2u", // 大拿 VeriSign Sarl
1205 "xn--q9jyb4c", // みんな Charleston Road Registry Inc.
1206 "xn--qcka1pmc", // グーグル Charleston Road Registry Inc.
1207 "xn--rhqv96g", // 世界 Stable Tone Limited
1208 "xn--rovu88b", // 書籍 Amazon EU S.à r.l.
1209 "xn--ses554g", // 网址 KNET Co., Ltd
1210 "xn--t60b56a", // 닷넷 VeriSign Sarl
1211 "xn--tckwe", // コム VeriSign Sarl
1212 "xn--unup4y", // 游戏 Spring Fields, LLC
1213 "xn--vermgensberater-ctb", // VERMöGENSBERATER Deutsche Vermögensberatung Aktiengesellschaft DVAG
1214 "xn--vermgensberatung-pwb", // VERMöGENSBERATUNG Deutsche Vermögensberatung Aktiengesellschaft DVAG
1215 "xn--vhquv", // 企业 Dash McCook, LLC
1216 "xn--vuq861b", // 信息 Beijing Tele-info Network Technology Co., Ltd.
1217 "xn--xhq521b", // 广东 Guangzhou YU Wei Information Technology Co., Ltd.
1218 "xn--zfr164b", // 政务 China Organizational Name Administration Center
1219 "xperia", // xperia Sony Mobile Communications AB
1220 "xxx", // xxx ICM Registry LLC
1221 "xyz", // xyz XYZ.COM LLC
1222 "yachts", // yachts DERYachts, LLC
1223 "yahoo", // yahoo Yahoo! Domain Services Inc.
1224 "yamaxun", // yamaxun Amazon Registry Services, Inc.
1225 "yandex", // yandex YANDEX, LLC
1226 "yodobashi", // yodobashi YODOBASHI CAMERA CO.,LTD.
1227 "yoga", // yoga Top Level Domain Holdings Limited
1228 "yokohama", // yokohama GMO Registry, Inc.
1229 "youtube", // youtube Charleston Road Registry Inc.
1230 "zara", // zara Industria de Diseño Textil, S.A. (INDITEX, S.A.)
1231 "zero", // zero Amazon Registry Services, Inc.
1232 "zip", // zip Charleston Road Registry Inc.
1233 "zone", // zone Outer Falls, LLC
1234 "zuerich", // zuerich Kanton Zürich (Canton of Zurich)
1235 };
1236
1237 // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search
1238 private static final String[] COUNTRY_CODE_TLDS = new String[] {
1239 "ac", // Ascension Island
1240 "ad", // Andorra
1241 "ae", // United Arab Emirates
1242 "af", // Afghanistan
1243 "ag", // Antigua and Barbuda
1244 "ai", // Anguilla
1245 "al", // Albania
1246 "am", // Armenia
1247// "an", // Netherlands Antilles (retired)
1248 "ao", // Angola
1249 "aq", // Antarctica
1250 "ar", // Argentina
1251 "as", // American Samoa
1252 "at", // Austria
1253 "au", // Australia (includes Ashmore and Cartier Islands and Coral Sea Islands)
1254 "aw", // Aruba
1255 "ax", // Åland
1256 "az", // Azerbaijan
1257 "ba", // Bosnia and Herzegovina
1258 "bb", // Barbados
1259 "bd", // Bangladesh
1260 "be", // Belgium
1261 "bf", // Burkina Faso
1262 "bg", // Bulgaria
1263 "bh", // Bahrain
1264 "bi", // Burundi
1265 "bj", // Benin
1266 "bm", // Bermuda
1267 "bn", // Brunei Darussalam
1268 "bo", // Bolivia
1269 "br", // Brazil
1270 "bs", // Bahamas
1271 "bt", // Bhutan
1272 "bv", // Bouvet Island
1273 "bw", // Botswana
1274 "by", // Belarus
1275 "bz", // Belize
1276 "ca", // Canada
1277 "cc", // Cocos (Keeling) Islands
1278 "cd", // Democratic Republic of the Congo (formerly Zaire)
1279 "cf", // Central African Republic
1280 "cg", // Republic of the Congo
1281 "ch", // Switzerland
1282 "ci", // Côte d'Ivoire
1283 "ck", // Cook Islands
1284 "cl", // Chile
1285 "cm", // Cameroon
1286 "cn", // China, mainland
1287 "co", // Colombia
1288 "cr", // Costa Rica
1289 "cu", // Cuba
1290 "cv", // Cape Verde
1291 "cw", // Curaçao
1292 "cx", // Christmas Island
1293 "cy", // Cyprus
1294 "cz", // Czech Republic
1295 "de", // Germany
1296 "dj", // Djibouti
1297 "dk", // Denmark
1298 "dm", // Dominica
1299 "do", // Dominican Republic
1300 "dz", // Algeria
1301 "ec", // Ecuador
1302 "ee", // Estonia
1303 "eg", // Egypt
1304 "er", // Eritrea
1305 "es", // Spain
1306 "et", // Ethiopia
1307 "eu", // European Union
1308 "fi", // Finland
1309 "fj", // Fiji
1310 "fk", // Falkland Islands
1311 "fm", // Federated States of Micronesia
1312 "fo", // Faroe Islands
1313 "fr", // France
1314 "ga", // Gabon
1315 "gb", // Great Britain (United Kingdom)
1316 "gd", // Grenada
1317 "ge", // Georgia
1318 "gf", // French Guiana
1319 "gg", // Guernsey
1320 "gh", // Ghana
1321 "gi", // Gibraltar
1322 "gl", // Greenland
1323 "gm", // The Gambia
1324 "gn", // Guinea
1325 "gp", // Guadeloupe
1326 "gq", // Equatorial Guinea
1327 "gr", // Greece
1328 "gs", // South Georgia and the South Sandwich Islands
1329 "gt", // Guatemala
1330 "gu", // Guam
1331 "gw", // Guinea-Bissau
1332 "gy", // Guyana
1333 "hk", // Hong Kong
1334 "hm", // Heard Island and McDonald Islands
1335 "hn", // Honduras
1336 "hr", // Croatia (Hrvatska)
1337 "ht", // Haiti
1338 "hu", // Hungary
1339 "id", // Indonesia
1340 "ie", // Ireland (Éire)
1341 "il", // Israel
1342 "im", // Isle of Man
1343 "in", // India
1344 "io", // British Indian Ocean Territory
1345 "iq", // Iraq
1346 "ir", // Iran
1347 "is", // Iceland
1348 "it", // Italy
1349 "je", // Jersey
1350 "jm", // Jamaica
1351 "jo", // Jordan
1352 "jp", // Japan
1353 "ke", // Kenya
1354 "kg", // Kyrgyzstan
1355 "kh", // Cambodia (Khmer)
1356 "ki", // Kiribati
1357 "km", // Comoros
1358 "kn", // Saint Kitts and Nevis
1359 "kp", // North Korea
1360 "kr", // South Korea
1361 "kw", // Kuwait
1362 "ky", // Cayman Islands
1363 "kz", // Kazakhstan
1364 "la", // Laos (currently being marketed as the official domain for Los Angeles)
1365 "lb", // Lebanon
1366 "lc", // Saint Lucia
1367 "li", // Liechtenstein
1368 "lk", // Sri Lanka
1369 "lr", // Liberia
1370 "ls", // Lesotho
1371 "lt", // Lithuania
1372 "lu", // Luxembourg
1373 "lv", // Latvia
1374 "ly", // Libya
1375 "ma", // Morocco
1376 "mc", // Monaco
1377 "md", // Moldova
1378 "me", // Montenegro
1379 "mg", // Madagascar
1380 "mh", // Marshall Islands
1381 "mk", // Republic of Macedonia
1382 "ml", // Mali
1383 "mm", // Myanmar
1384 "mn", // Mongolia
1385 "mo", // Macau
1386 "mp", // Northern Mariana Islands
1387 "mq", // Martinique
1388 "mr", // Mauritania
1389 "ms", // Montserrat
1390 "mt", // Malta
1391 "mu", // Mauritius
1392 "mv", // Maldives
1393 "mw", // Malawi
1394 "mx", // Mexico
1395 "my", // Malaysia
1396 "mz", // Mozambique
1397 "na", // Namibia
1398 "nc", // New Caledonia
1399 "ne", // Niger
1400 "nf", // Norfolk Island
1401 "ng", // Nigeria
1402 "ni", // Nicaragua
1403 "nl", // Netherlands
1404 "no", // Norway
1405 "np", // Nepal
1406 "nr", // Nauru
1407 "nu", // Niue
1408 "nz", // New Zealand
1409 "om", // Oman
1410 "pa", // Panama
1411 "pe", // Peru
1412 "pf", // French Polynesia With Clipperton Island
1413 "pg", // Papua New Guinea
1414 "ph", // Philippines
1415 "pk", // Pakistan
1416 "pl", // Poland
1417 "pm", // Saint-Pierre and Miquelon
1418 "pn", // Pitcairn Islands
1419 "pr", // Puerto Rico
1420 "ps", // Palestinian territories (PA-controlled West Bank and Gaza Strip)
1421 "pt", // Portugal
1422 "pw", // Palau
1423 "py", // Paraguay
1424 "qa", // Qatar
1425 "re", // Réunion
1426 "ro", // Romania
1427 "rs", // Serbia
1428 "ru", // Russia
1429 "rw", // Rwanda
1430 "sa", // Saudi Arabia
1431 "sb", // Solomon Islands
1432 "sc", // Seychelles
1433 "sd", // Sudan
1434 "se", // Sweden
1435 "sg", // Singapore
1436 "sh", // Saint Helena
1437 "si", // Slovenia
1438 "sj", // Svalbard and Jan Mayen Islands Not in use (Norwegian dependencies; see .no)
1439 "sk", // Slovakia
1440 "sl", // Sierra Leone
1441 "sm", // San Marino
1442 "sn", // Senegal
1443 "so", // Somalia
1444 "sr", // Suriname
1445 "st", // São Tomé and Príncipe
1446 "su", // Soviet Union (deprecated)
1447 "sv", // El Salvador
1448 "sx", // Sint Maarten
1449 "sy", // Syria
1450 "sz", // Swaziland
1451 "tc", // Turks and Caicos Islands
1452 "td", // Chad
1453 "tf", // French Southern and Antarctic Lands
1454 "tg", // Togo
1455 "th", // Thailand
1456 "tj", // Tajikistan
1457 "tk", // Tokelau
1458 "tl", // East Timor (deprecated old code)
1459 "tm", // Turkmenistan
1460 "tn", // Tunisia
1461 "to", // Tonga
1462// "tp", // East Timor (Retired)
1463 "tr", // Turkey
1464 "tt", // Trinidad and Tobago
1465 "tv", // Tuvalu
1466 "tw", // Taiwan, Republic of China
1467 "tz", // Tanzania
1468 "ua", // Ukraine
1469 "ug", // Uganda
1470 "uk", // United Kingdom
1471 "us", // United States of America
1472 "uy", // Uruguay
1473 "uz", // Uzbekistan
1474 "va", // Vatican City State
1475 "vc", // Saint Vincent and the Grenadines
1476 "ve", // Venezuela
1477 "vg", // British Virgin Islands
1478 "vi", // U.S. Virgin Islands
1479 "vn", // Vietnam
1480 "vu", // Vanuatu
1481 "wf", // Wallis and Futuna
1482 "ws", // Samoa (formerly Western Samoa)
1483 "xn--3e0b707e", // 한국 KISA (Korea Internet &amp; Security Agency)
1484 "xn--45brj9c", // ভারত National Internet Exchange of India
1485 "xn--80ao21a", // қаз Association of IT Companies of Kazakhstan
1486 "xn--90a3ac", // срб Serbian National Internet Domain Registry (RNIDS)
1487 "xn--90ais", // ??? Reliable Software Inc.
1488 "xn--clchc0ea0b2g2a9gcd", // சிங்கப்பூர் Singapore Network Information Centre (SGNIC) Pte Ltd
1489 "xn--d1alf", // мкд Macedonian Academic Research Network Skopje
1490 "xn--e1a4c", // ею EURid vzw/asbl
1491 "xn--fiqs8s", // 中国 China Internet Network Information Center
1492 "xn--fiqz9s", // 中國 China Internet Network Information Center
1493 "xn--fpcrj9c3d", // భారత్ National Internet Exchange of India
1494 "xn--fzc2c9e2c", // ලංකා LK Domain Registry
1495 "xn--gecrj9c", // ભારત National Internet Exchange of India
1496 "xn--h2brj9c", // भारत National Internet Exchange of India
1497 "xn--j1amh", // укр Ukrainian Network Information Centre (UANIC), Inc.
1498 "xn--j6w193g", // 香港 Hong Kong Internet Registration Corporation Ltd.
1499 "xn--kprw13d", // 台湾 Taiwan Network Information Center (TWNIC)
1500 "xn--kpry57d", // 台灣 Taiwan Network Information Center (TWNIC)
1501 "xn--l1acc", // мон Datacom Co.,Ltd
1502 "xn--lgbbat1ad8j", // الجزائر CERIST
1503 "xn--mgb9awbf", // عمان Telecommunications Regulatory Authority (TRA)
1504 "xn--mgba3a4f16a", // ایران Institute for Research in Fundamental Sciences (IPM)
1505 "xn--mgbaam7a8h", // امارات Telecommunications Regulatory Authority (TRA)
1506 "xn--mgbayh7gpa", // الاردن National Information Technology Center (NITC)
1507 "xn--mgbbh1a71e", // بھارت National Internet Exchange of India
1508 "xn--mgbc0a9azcg", // المغرب Agence Nationale de Réglementation des Télécommunications (ANRT)
1509 "xn--mgberp4a5d4ar", // السعودية Communications and Information Technology Commission
1510 "xn--mgbpl2fh", // ????? Sudan Internet Society
1511 "xn--mgbtx2b", // عراق Communications and Media Commission (CMC)
1512 "xn--mgbx4cd0ab", // مليسيا MYNIC Berhad
1513 "xn--mix891f", // 澳門 Bureau of Telecommunications Regulation (DSRT)
1514 "xn--node", // გე Information Technologies Development Center (ITDC)
1515 "xn--o3cw4h", // ไทย Thai Network Information Center Foundation
1516 "xn--ogbpf8fl", // سورية National Agency for Network Services (NANS)
1517 "xn--p1ai", // рф Coordination Center for TLD RU
1518 "xn--pgbs0dh", // تونس Agence Tunisienne d&#39;Internet
1519 "xn--qxam", // ελ ICS-FORTH GR
1520 "xn--s9brj9c", // ਭਾਰਤ National Internet Exchange of India
1521 "xn--wgbh1c", // مصر National Telecommunication Regulatory Authority - NTRA
1522 "xn--wgbl6a", // قطر Communications Regulatory Authority
1523 "xn--xkc2al3hye2a", // இலங்கை LK Domain Registry
1524 "xn--xkc2dl3a5ee0h", // இந்தியா National Internet Exchange of India
1525 "xn--y9a3aq", // ??? Internet Society
1526 "xn--yfro4i67o", // 新加坡 Singapore Network Information Centre (SGNIC) Pte Ltd
1527 "xn--ygbi2ammx", // فلسطين Ministry of Telecom &amp; Information Technology (MTIT)
1528 "ye", // Yemen
1529 "yt", // Mayotte
1530 "za", // South Africa
1531 "zm", // Zambia
1532 "zw", // Zimbabwe
1533 };
1534
1535 // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search
1536 private static final String[] LOCAL_TLDS = new String[] {
1537 "localdomain", // Also widely used as localhost.localdomain
1538 "localhost", // RFC2606 defined
1539 };
1540
1541 // Additional arrays to supplement or override the built in ones.
1542 // The PLUS arrays are valid keys, the MINUS arrays are invalid keys
1543
1544 /*
1545 * This field is used to detect whether the getInstance has been called.
1546 * After this, the method updateTLDOverride is not allowed to be called.
1547 * This field does not need to be volatile since it is only accessed from
1548 * synchronized methods.
1549 */
1550 private static boolean inUse = false;
1551
1552 /*
1553 * These arrays are mutable, but they don't need to be volatile.
1554 * They can only be updated by the updateTLDOverride method, and any readers must get an instance
1555 * using the getInstance methods which are all (now) synchronised.
1556 */
1557 // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search
1558 private static volatile String[] countryCodeTLDsPlus = EMPTY_STRING_ARRAY;
1559
1560 // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search
1561 private static volatile String[] genericTLDsPlus = EMPTY_STRING_ARRAY;
1562
1563 // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search
1564 private static volatile String[] countryCodeTLDsMinus = EMPTY_STRING_ARRAY;
1565
1566 // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search
1567 private static volatile String[] genericTLDsMinus = EMPTY_STRING_ARRAY;
1568
1569 /**
1570 * enum used by {@link DomainValidator#updateTLDOverride(ArrayType, String[])}
1571 * to determine which override array to update / fetch
1572 * @since 1.5.0
1573 * @since 1.5.1 made public and added read-only array references
1574 */
1575 public enum ArrayType {
1576 /** Update (or get a copy of) the GENERIC_TLDS_PLUS table containing additonal generic TLDs */
1577 GENERIC_PLUS,
1578 /** Update (or get a copy of) the GENERIC_TLDS_MINUS table containing deleted generic TLDs */
1579 GENERIC_MINUS,
1580 /** Update (or get a copy of) the COUNTRY_CODE_TLDS_PLUS table containing additonal country code TLDs */
1581 COUNTRY_CODE_PLUS,
1582 /** Update (or get a copy of) the COUNTRY_CODE_TLDS_MINUS table containing deleted country code TLDs */
1583 COUNTRY_CODE_MINUS,
1584 /** Get a copy of the generic TLDS table */
1585 GENERIC_RO,
1586 /** Get a copy of the country code table */
1587 COUNTRY_CODE_RO,
1588 /** Get a copy of the infrastructure table */
1589 INFRASTRUCTURE_RO,
1590 /** Get a copy of the local table */
1591 LOCAL_RO
1592 }
1593
1594 // For use by unit test code only
1595 static synchronized void clearTLDOverrides() {
1596 inUse = false;
1597 countryCodeTLDsPlus = EMPTY_STRING_ARRAY;
1598 countryCodeTLDsMinus = EMPTY_STRING_ARRAY;
1599 genericTLDsPlus = EMPTY_STRING_ARRAY;
1600 genericTLDsMinus = EMPTY_STRING_ARRAY;
1601 }
1602
1603 /**
1604 * Update one of the TLD override arrays.
1605 * This must only be done at program startup, before any instances are accessed using getInstance.
1606 * <p>
1607 * For example:
1608 * <p>
1609 * <code>DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"apache"})}</code>
1610 * <p>
1611 * To clear an override array, provide an empty array.
1612 *
1613 * @param table the table to update, see {@link DomainValidator.ArrayType}
1614 * Must be one of the following
1615 * <ul>
1616 * <li>COUNTRY_CODE_MINUS</li>
1617 * <li>COUNTRY_CODE_PLUS</li>
1618 * <li>GENERIC_MINUS</li>
1619 * <li>GENERIC_PLUS</li>
1620 * </ul>
1621 * @param tlds the array of TLDs, must not be null
1622 * @throws IllegalStateException if the method is called after getInstance
1623 * @throws IllegalArgumentException if one of the read-only tables is requested
1624 * @since 1.5.0
1625 */
1626 public static synchronized void updateTLDOverride(ArrayType table, String[] tlds) {
1627 if (inUse) {
1628 throw new IllegalStateException("Can only invoke this method before calling getInstance");
1629 }
1630 String[] copy = new String[tlds.length];
1631 // Comparisons are always done with lower-case entries
1632 for (int i = 0; i < tlds.length; i++) {
1633 copy[i] = tlds[i].toLowerCase(Locale.ENGLISH);
1634 }
1635 Arrays.sort(copy);
1636 switch(table) {
1637 case COUNTRY_CODE_MINUS:
1638 countryCodeTLDsMinus = copy;
1639 break;
1640 case COUNTRY_CODE_PLUS:
1641 countryCodeTLDsPlus = copy;
1642 break;
1643 case GENERIC_MINUS:
1644 genericTLDsMinus = copy;
1645 break;
1646 case GENERIC_PLUS:
1647 genericTLDsPlus = copy;
1648 break;
1649 case COUNTRY_CODE_RO:
1650 case GENERIC_RO:
1651 case INFRASTRUCTURE_RO:
1652 case LOCAL_RO:
1653 throw new IllegalArgumentException("Cannot update the table: " + table);
1654 default:
1655 throw new IllegalArgumentException("Unexpected enum value: " + table);
1656 }
1657 }
1658
1659 /**
1660 * Get a copy of the internal array.
1661 * @param table the array type (any of the enum values)
1662 * @return a copy of the array
1663 * @throws IllegalArgumentException if the table type is unexpected (should not happen)
1664 * @since 1.5.1
1665 */
1666 public static String[] getTLDEntries(ArrayType table) {
1667 final String[] array;
1668 switch(table) {
1669 case COUNTRY_CODE_MINUS:
1670 array = countryCodeTLDsMinus;
1671 break;
1672 case COUNTRY_CODE_PLUS:
1673 array = countryCodeTLDsPlus;
1674 break;
1675 case GENERIC_MINUS:
1676 array = genericTLDsMinus;
1677 break;
1678 case GENERIC_PLUS:
1679 array = genericTLDsPlus;
1680 break;
1681 case GENERIC_RO:
1682 array = GENERIC_TLDS;
1683 break;
1684 case COUNTRY_CODE_RO:
1685 array = COUNTRY_CODE_TLDS;
1686 break;
1687 case INFRASTRUCTURE_RO:
1688 array = INFRASTRUCTURE_TLDS;
1689 break;
1690 case LOCAL_RO:
1691 array = LOCAL_TLDS;
1692 break;
1693 default:
1694 throw new IllegalArgumentException("Unexpected enum value: " + table);
1695 }
1696 return Arrays.copyOf(array, array.length); // clone the array
1697 }
1698
1699 /**
1700 * Converts potentially Unicode input to punycode.
1701 * If conversion fails, returns the original input.
1702 *
1703 * @param input the string to convert, not null
1704 * @return converted input, or original input if conversion fails
1705 */
1706 // Needed by UrlValidator
1707 static String unicodeToASCII(String input) {
1708 if (isOnlyASCII(input)) { // skip possibly expensive processing
1709 return input;
1710 }
1711 try {
1712 final String ascii = IDN.toASCII(input);
1713 if (IDNBUGHOLDER.IDN_TOASCII_PRESERVES_TRAILING_DOTS) {
1714 return ascii;
1715 }
1716 final int length = input.length();
1717 if (length == 0) { // check there is a last character
1718 return input;
1719 }
1720 // RFC3490 3.1. 1)
1721 // Whenever dots are used as label separators, the following
1722 // characters MUST be recognized as dots: U+002E (full stop), U+3002
1723 // (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61
1724 // (halfwidth ideographic full stop).
1725 char lastChar = input.charAt(length-1); // fetch original last char
1726 switch(lastChar) {
1727 case '\u002E': // "." full stop
1728 case '\u3002': // ideographic full stop
1729 case '\uFF0E': // fullwidth full stop
1730 case '\uFF61': // halfwidth ideographic full stop
1731 return ascii + "."; // restore the missing stop
1732 default:
1733 return ascii;
1734 }
1735 } catch (IllegalArgumentException e) { // input is not valid
1736 return input;
1737 }
1738 }
1739
1740 private static class IDNBUGHOLDER {
1741 private static boolean keepsTrailingDot() {
1742 final String input = "a."; // must be a valid name
1743 return input.equals(IDN.toASCII(input));
1744 }
1745
1746 private static final boolean IDN_TOASCII_PRESERVES_TRAILING_DOTS = keepsTrailingDot();
1747 }
1748
1749 /*
1750 * Check if input contains only ASCII
1751 * Treats null as all ASCII
1752 */
1753 private static boolean isOnlyASCII(String input) {
1754 if (input == null) {
1755 return true;
1756 }
1757 for (int i = 0; i < input.length(); i++) {
1758 if (input.charAt(i) > 0x7F) { // CHECKSTYLE IGNORE MagicNumber
1759 return false;
1760 }
1761 }
1762 return true;
1763 }
1764
1765 /**
1766 * Check if a sorted array contains the specified key
1767 *
1768 * @param sortedArray the array to search
1769 * @param key the key to find
1770 * @return {@code true} if the array contains the key
1771 */
1772 private static boolean arrayContains(String[] sortedArray, String key) {
1773 return Arrays.binarySearch(sortedArray, key) >= 0;
1774 }
1775}
Note: See TracBrowser for help on using the repository browser.