Skip to content

Latest commit

 

History

History
86 lines (61 loc) · 2.22 KB

tld.md

File metadata and controls

86 lines (61 loc) · 2.22 KB

Top Level Domain Names

A top-level domain (TLD) is one of the domains at the highest level in the hierarchical Domain Name System of the Internet.

Primary TLD data are offered via idata/tld, while idata/tld2 will directly return an array of typed top-level domains.

// Obtain all TLDs with basic information (e.g. domain, type and manager).
const tld = require('idata/tld');
tld.find(element => element.domain == '.com');

// Obtain typed TLDs in domain.
const tld2 = require('idata/tld2');
tld2('ccTLD');
// [ ..., '.cn', ... '.uk', ... ]

Primitive data are downloaded from iana, Root Zone Database.

Data Format

idata/tld is a JSON.

// JSON Array.
[
    // Each item is made up by 3 properties:
    { 
        /* string */ domain,
        /* ENUM */ type,
        /* string */ manager,
    },
    // ...
]
  • string domain
    Top-level domain in lowercase, prefixed with a dot signal.
    ATTENTION: Some domains are NOT made up of latin-1 characters (e.g. .组织机构).

  • ENUM type
    A singal word or hyphen-connected in lower-case, representing the domain's type.
    Which may be one of the following:

    • country-code
    • generic
    • generic-restricted
    • infrastructure
    • sponsored
    • test

    See section Types for details.

  • string manager

APIs

  • object[] tld()
  • string[] tld(string typename)

Types

Typenames available for tld2(typename) include:

  • ARPA | infrastructure
    The only one belonging to this type is .apra .

  • ccTLD | country-code | cc
    cn, jp, ge etc.

  • gTLD | generic | g
    .com, .org etc.

  • grTLD | generic-restricted | gr
    .biz, .name etc.

  • sTLD | sponsored | s
    Those sponsored by some organizations or companies. E.g., .asia is managed by DotAsia Organisation Ltd..

  • tTLD | test | t
    Those for test usage only.

References