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