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

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

update new TLD from IANA

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