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

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

update new TLD from IANA

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