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

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

update new TLD from IANA - version 2016040900

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