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