域名Whois查询源码 PHP代码

发布于 29 天前  159 次阅读


一、前言:

一时兴起之际,亲自动手编写了一个域名 Whois 查询源码。

二、优缺点:

1.其优点主要表现为:

对于众多常见的域名后缀,基本上都能够实现正常查询。

无论是大家熟知的“.com”、“.net”、“.org”等国际通用后缀,还是“.cn”等国内广泛使用的后缀,在大多数情况下都能准确地查询到相关的域名信息。

2.也存在一定的缺点:

如果遇到新增的顶级后缀或者来自其他国家的后缀,就需要对源数据的字段进行调试。这是因为不同国家的域名系统在字段设置上可能存在差异。例如,某些国家可能会采用特定的编码方式或者字段名称来存储域名信息。以“.CN”和“.PLUS”后缀为例,在对这两个后缀进行调试的过程中,发现了它们与其他常见后缀在字段设置上的不同之处。你可以参考针对这两个后缀所进行的字段调试代码,以便在遇到类似情况时能够更好地进行处理。这样的调试过程虽然可能会耗费一定的时间和精力,但对于提高源码的通用性和适应性具有重要意义。

三、文件代码:

代码分为两文件

index.php与apijson.php代码

index.php代码

<?php
// 引用外部文件 apijson.php
include 'apijson.php';

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // 获取用户输入的域名
    $domain = $_POST['domain'];

    // 判断是否为中文域名
    $is_chinese_domain = preg_match('/[\x{4e00}-\x{9fa5}]/u', $domain);

    // 如果是中文域名,转换为 punycode 编码
    if ($is_chinese_domain) {
        $punycode_domain = idn_to_ascii($domain);
    } else {
        $punycode_domain = $domain;
    }

    // 判断是否为 punycode 编码
    $is_punycode_domain = preg_match('/^xn--/', $punycode_domain);

    // 如果是 punycode 编码,转换为中文域名
    if ($is_punycode_domain) {
        $chinese_domain = idn_to_utf8($punycode_domain);
    } else {
        $chinese_domain = $punycode_domain;
    }

    // 提取域名后缀
    $domain_parts = explode('.', $punycode_domain);
    $tld = array_pop($domain_parts);

    // 检查域名后缀是否在支持的 WHOIS 服务器列表中
    if (!array_key_exists($tld, $whois_servers)) {
        echo "<script>alert('不支持的域名后缀');</script>";
        exit;
    }

    // 获取对应的 WHOIS 服务器地址
    $whois_server = $whois_servers[$tld];

    // 连接 WHOIS 服务器
    $fp = @fsockopen($whois_server, 43, $errno, $errstr, 10);
    if (!$fp) {
        echo "<script>alert('无法连接到 WHOIS 服务器');</script>";
        exit;
    }

    // 发送查询请求
    fputs($fp, $punycode_domain . "\r\n");

    // 获取查询结果
    $whois_info = "";
    while (!feof($fp)) {
        $whois_info .= fgets($fp, 128);
    }
    fclose($fp);

    // 解析 WHOIS 信息
    $domain_info = parse_whois_info($whois_info, $tld);
}

function parse_whois_info($whois_info, $tld) {
    $lines = explode("\n", $whois_info);
    $info = [];

    foreach ($lines as $line) {
        if (strpos($line, ':') !== false) {
            list($key, $value) = explode(':', $line, 2);
            $key = trim($key);
            $value = trim($value);
            if (!isset($info[$key])) {
                $info[$key] = $value;
            } elseif (is_array($info[$key])) {
                $info[$key][] = $value;
            } else {
                $info[$key] = [$info[$key], $value];
            }
        }
    }

    // 处理特定键值
    if ($tld === 'cn') {
        $info['Registrar'] = $info['Sponsoring Registrar'] ?? 'N/A';
        $info['Updated Date'] = $info['Updated Date'] ?? 'N/A';
        $info['Creation Date'] = $info['Registration Time'] ?? 'N/A';
        $info['Registry Expiry Date'] = $info['Expiration Time'] ?? 'N/A';
        $info['Domain Status'] = $info['Domain Status'] ?? 'N/A';
        $info['Name Server'] = $info['Name Server'] ?? 'N/A';
        $info['Registrant Name'] = $info['Registrant'] ?? 'N/A';
        $info['Registrant Email'] = $info['Registrant Contact Email'] ?? 'N/A';
        $info['Registrant Street'] = $info['Registrant Street'] ?? 'N/A';
        $info['Registrant City'] = $info['Registrant City'] ?? 'N/A';
        $info['Registrant Phone'] = $info['Registrant Phone'] ?? 'N/A';
        $info['Registrant State/Province'] = $info['Registrant State/Province'] ?? 'N/A';
        $info['Registrant Postal Code'] = $info['Registrant Postal Code'] ?? 'N/A';
        $info['Registrant Country'] = $info['Registrant Country'] ?? 'N/A';
        $info['WHOIS Server'] = $info['Registrar WHOIS Server'] ?? 'N/A';
        $info['IANA ID'] = $info['Registrar IANA ID'] ?? 'N/A';
    } elseif ($tld === 'plus') {
        $info['Registrar'] = $info['Registrar'] ?? 'N/A';
        $info['Updated Date'] = $info['Updated Date'] ?? 'N/A';
        $info['Creation Date'] = $info['Creation Date'] ?? 'N/A';
        $info['Registry Expiry Date'] = $info['Registry Expiry Date'] ?? 'N/A';
        $info['Domain Status'] = $info['Domain Status'] ?? 'N/A';
        $info['Name Server'] = $info['Name Server'] ?? 'N/A';
        $info['Registrant Name'] = $info['Registrant Organization'] ?? 'N/A';
        $info['Registrant Email'] = $info['Registrar Abuse Contact Email'] ?? 'N/A';
        $info['Registrant Phone'] = $info['Registrar Abuse Contact Phone'] ?? 'N/A';
        $info['Registrant Street'] = $info['Registrant Street'] ?? 'N/A';
        $info['Registrant City'] = $info['Registrant City'] ?? 'N/A';
        $info['Registrant State/Province'] = $info['Registrant State/Province'] ?? 'N/A';
        $info['Registrant Postal Code'] = $info['Registrant Postal Code'] ?? 'N/A';
        $info['Registrant Country'] = $info['Registrant Country'] ?? 'N/A';
        $info['Registrar IANA ID'] = $info['Registrar IANA ID'] ?? 'N/A';
        $info['WHOIS Server'] = $info['Registrar WHOIS Server'] ?? 'N/A';
        $info['IANA ID'] = $info['Registrar IANA ID'] ?? 'N/A';
    } else {
        $info['Registrar'] = $info['Registrar'] ?? 'N/A';
        $info['Updated Date'] = $info['Updated Date'] ?? 'N/A';
        $info['Creation Date'] = $info['Creation Date'] ?? 'N/A';
        $info['Registry Expiry Date'] = $info['Registry Expiry Date'] ?? 'N/A';
        $info['Domain Status'] = $info['Domain Status'] ?? 'N/A';
        $info['Name Server'] = $info['Name Server'] ?? 'N/A';
        $info['Registrant'] = $info['Registrant'] ?? 'N/A';
        $info['Registrant Name'] = $info['Registrant Name'] ?? 'N/A';
        $info['Registrant Email'] = $info['Registrant Email'] ?? 'N/A';
        $info['Registrant Street'] = $info['Registrant Street'] ?? 'N/A';
        $info['Registrant City'] = $info['Registrant City'] ?? 'N/A';
        $info['Registrant State/Province'] = $info['Registrant State/Province'] ?? 'N/A';
        $info['Registrant Postal Code'] = $info['Registrant Postal Code'] ?? 'N/A';
        $info['Registrant Country'] = $info['Registrant Country'] ?? 'N/A';
        $info['WHOIS Server'] = $info['Registrar WHOIS Server'] ?? 'N/A';
        $info['Registrant Phone'] = $info['Registrant Phone'] ?? 'N/A';
        $info['IANA ID'] = $info['Registrar IANA ID'] ?? 'N/A';
    }

    // 处理 Domain Status
    if (isset($info['Domain Status'])) {
        if (is_array($info['Domain Status'])) {
            foreach ($info['Domain Status'] as &$status) {
                $status = preg_replace('/ https:\/\/icann\.org\/epp#.*$/', '', $status);
            }
        } else {
            $info['Domain Status'] = preg_replace('/ https:\/\/icann\.org\/epp#.*$/', '', $info['Domain Status']);
        }
    }

    // 过滤 REDACTED FOR PRIVACY 和 Please query the RDDS service...
    foreach ($info as $key => $value) {
        if ($value === 'REDACTED FOR PRIVACY' || $value === 'Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.') {
            $info[$key] = 'N/A';
        }
    }

    return $info;
}
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>WHOIS 查询网站</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 20px;
        }
        .container {
            max-width: 800px;
            margin: auto;
            background: #fff;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        h1 {
            text-align: center;
            color: #333;
        }
        form {
            text-align: center;
            margin-bottom: 20px;
        }
        label {
            font-size: 18px;
            margin-right: 10px;
        }
        input[type="text"] {
            padding: 10px;
            font-size: 16px;
            width: 60%;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        input[type="submit"] {
            padding: 10px 20px;
            font-size: 16px;
            background-color: #007BFF;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        input[type="submit"]:hover {
            background-color: #0056b3;
        }
        .result {
            margin-top: 20px;
            border-top: 1px solid #ccc;
            padding-top: 20px;
        }
        .result p {
            margin: 5px 0;
        }
        .result strong {
            color: #333;
        }
        .domain-info {
            background-color: #f9f9f9;
            padding: 10px;
            border-radius: 4px;
            margin-bottom: 20px;
        }
        pre {
            white-space: pre-wrap;       /* CSS 3 */
            white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
            white-space: -pre-wrap;      /* Opera 4-6 */
            white-space: -o-pre-wrap;    /* Opera 7 */
            word-wrap: break-word;       /* Internet Explorer 5.5+ */
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>WHOIS 查询</h1>
        <form action="" method="post">
            <label for="domain">输入要查询的域名:</label>
            <input type="text" name="domain" id="domain" required>
            <input type="submit" value="查询">
        </form>
        <?php if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($domain_info)) : ?>
            <div class="domain-info">
                <p><strong>域名:</strong> <?php echo htmlspecialchars($chinese_domain); ?></p>
                <?php if ($is_chinese_domain || $is_punycode_domain) : ?>
                    <p><strong>域名代码:</strong> <?php echo htmlspecialchars($punycode_domain); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Registrar'] !== 'N/A') : ?>
                    <p><strong>注册商:</strong> <?php echo htmlspecialchars($domain_info['Registrar']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['WHOIS Server'] !== 'N/A') : ?>
                    <p><strong>WHOIS Server:</strong> <?php echo htmlspecialchars($domain_info['WHOIS Server']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Updated Date'] !== 'N/A') : ?>
                    <p><strong>更新日:</strong> <?php echo htmlspecialchars($domain_info['Updated Date']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Creation Date'] !== 'N/A') : ?>
                    <p><strong>注册日:</strong> <?php echo htmlspecialchars($domain_info['Creation Date']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Registry Expiry Date'] !== 'N/A') : ?>
                    <p><strong>过期日:</strong> <?php echo htmlspecialchars($domain_info['Registry Expiry Date']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['IANA ID'] !== 'N/A') : ?>
                    <p><strong>IANA ID:</strong> <?php echo htmlspecialchars($domain_info['IANA ID']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Registrant Name'] !== 'N/A') : ?>
                    <p><strong>注册人:</strong> <?php echo htmlspecialchars($domain_info['Registrant Name']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Registrant Email'] !== 'N/A') : ?>
                    <p><strong>注册人邮箱:</strong> <?php echo htmlspecialchars($domain_info['Registrant Email']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Registrant Phone'] !== 'N/A') : ?>
                    <p><strong>注册人手机:</strong> <?php echo htmlspecialchars($domain_info['Registrant Phone']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Registrant Street'] !== 'N/A') : ?>
                    <p><strong>街道:</strong> <?php echo htmlspecialchars($domain_info['Registrant Street']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Registrant City'] !== 'N/A') : ?>
                    <p><strong>城市:</strong> <?php echo htmlspecialchars($domain_info['Registrant City']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Registrant State/Province'] !== 'N/A') : ?>
                    <p><strong>省/州:</strong> <?php echo htmlspecialchars($domain_info['Registrant State/Province']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Registrant Postal Code'] !== 'N/A') : ?>
                    <p><strong>邮编:</strong> <?php echo htmlspecialchars($domain_info['Registrant Postal Code']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Registrant Country'] !== 'N/A') : ?>
                    <p><strong>国家/地区:</strong> <?php echo htmlspecialchars($domain_info['Registrant Country']); ?></p>
                <?php endif; ?>
                <?php if ($domain_info['Domain Status'] !== 'N/A') : ?>
                    <p><strong>状态:</strong></p>
                    <?php if (is_array($domain_info['Domain Status'])) : ?>
                        <?php foreach ($domain_info['Domain Status'] as $status) : ?>
                            <p><a class="a" target="_blank" href="https://icann.org/epp#<?php echo urlencode($status); ?>"><?php echo htmlspecialchars($status); ?></a></p>
                        <?php endforeach; ?>
                    <?php else : ?>
                        <p><a class="a" target="_blank" href="https://icann.org/epp#<?php echo urlencode($domain_info['Domain Status']); ?>"><?php echo htmlspecialchars($domain_info['Domain Status']); ?></a></p>
                    <?php endif; ?>
                <?php endif; ?>
                <?php if ($domain_info['Name Server'] !== 'N/A') : ?>
                    <p><strong>DNS:</strong></p>
                    <?php if (is_array($domain_info['Name Server'])) : ?>
                        <?php foreach ($domain_info['Name Server'] as $ns) : ?>
                            <p><?php echo htmlspecialchars($ns); ?></p>
                        <?php endforeach; ?>
                    <?php else : ?>
                        <p><?php echo htmlspecialchars($domain_info['Name Server']); ?></p>
                    <?php endif; ?>
                <?php endif; ?>
                <?php if (isset($domain_info['DNSSEC']) && $domain_info['DNSSEC'] !== 'N/A') : ?>
                    <p><strong>DNSSEC:</strong> <?php echo htmlspecialchars($domain_info['DNSSEC']); ?></p>
                <?php endif; ?>
            </div>
            <div class="result">
                <?php echo "<pre>" . htmlspecialchars($whois_info) . "</pre>"; ?>
            </div>
        <?php endif; ?>
    </div>
</body>
</html>
apijson.php代码

<?php
$whois_servers = [
    'com' => 'whois.verisign-grs.com',
    'net' => 'whois.verisign-grs.com',
    'org' => 'whois.publicinterestregistry.net',
    'cn' => 'whois.cnnic.cn',
    'uk' => 'whois.nic.uk',
    'us' => 'whois.nic.us',
    'ru' => 'whois.tcinet.ru',
    'io' => 'whois.nic.io',
    'ai' => 'whois.nic.ai',
    'app' => 'whois.nic.google',
    'dev' => 'whois.nic.google',
    'xyz' => 'whois.nic.xyz',
    'info' => 'whois.nic.info',
    'tech' => 'whois.nic.tech',
    'online' => 'whois.nic.online',
    'site' => 'whois.nic.site',
    'space' => 'whois.nic.space',
    'store' => 'whois.nic.store',
    'club' => 'whois.nic.club',
    'cloud' => 'whois.nic.cloud',
    'design' => 'whois.nic.design',
    'digital' => 'whois.nic.digital',
    'email' => 'whois.nic.email',
    'games' => 'whois.nic.games',
    'global' => 'whois.nic.global',
    'guide' => 'whois.nic.guide',
    'ink' => 'whois.nic.ink',
    'link' => 'whois.nic.link',
    'live' => 'whois.nic.live',
    'me' => 'whois.nic.me',
    'media' => 'whois.nic.media',
    'mobi' => 'whois.nic.mobi',
    'name' => 'whois.nic.name',
    'news' => 'whois.nic.news',
    'ninja' => 'whois.nic.ninja',
    'online' => 'whois.nic.online',
    'pro' => 'whois.nic.pro',
    'rocks' => 'whois.nic.rocks',
    'services' => 'whois.nic.services',
    'shop' => 'whois.nic.shop',
    'show' => 'whois.nic.show',
    'solutions' => 'whois.nic.solutions',
    'studio' => 'whois.nic.studio',
    'support' => 'whois.nic.support',
    'systems' => 'whois.nic.systems',
    'team' => 'whois.nic.team',
    'tech' => 'whois.nic.tech',
    'tools' => 'whois.nic.tools',
    'tv' => 'whois.nic.tv',
    'video' => 'whois.nic.video',
    'vip' => 'whois.nic.vip',
    'vision' => 'whois.nic.vision',
    'watch' => 'whois.nic.watch',
    'wiki' => 'whois.nic.wiki',
    'work' => 'whois.nic.work',
    'world' => 'whois.nic.world',
    'wtf' => 'whois.nic.wtf',
    'zone' => 'whois.nic.zone',
    'plus' => 'whois.nic.plus',
    'ac' => 'whois.nic.ac',
    'ae' => 'whois.aeda.net.ae',
    'aero' => 'whois.aero',
    'af' => 'whois.nic.af',
    'ag' => 'whois.nic.ag',
    'al' => 'whois.ripe.net',
    'am' => 'whois.amnic.net',
    'as' => 'whois.nic.as',
    'asia' => 'whois.nic.asia',
    'at' => 'whois.nic.at',
    'au' => 'whois.auda.org.au',
    'aw' => 'whois.nic.aw',
    'ax' => 'whois.ax',
    'az' => 'whois.ripe.net',
    'ba' => 'whois.ripe.net',
    'be' => 'whois.dns.be',
    'bg' => 'whois.register.bg',
    'bi' => 'whois.nic.bi',
    'biz' => 'whois.biz',
    'bj' => 'whois.nic.bj',
    'br' => 'whois.registro.br',
    'bs' => 'whois.nic.bs',
    'bt' => 'whois.netnames.net',
    'bw' => 'whois.nic.net.bw',
    'by' => 'whois.cctld.by',
    'bz' => 'whois.belizenic.bz',
    'ca' => 'whois.cira.ca',
    'cat' => 'whois.cat',
    'cc' => 'whois.nic.cc',
    'cd' => 'whois.nic.cd',
    'ch' => 'whois.nic.ch',
    'ci' => 'whois.nic.ci',
    'ck' => 'whois.nic.ck',
    'cl' => 'whois.nic.cl',
    'cm' => 'whois.netcom.cm',
    'co' => 'whois.nic.co',
    'com.co' => 'whois.nic.co',
    'coop' => 'whois.nic.coop',
    'cr' => 'whois.nic.cr',
    'cu' => 'whois.nic.cu',
    'cv' => 'whois.nic.cv',
    'cx' => 'whois.nic.cx',
    'cy' => 'whois.nic.cy',
    'cz' => 'whois.nic.cz',
    'de' => 'whois.denic.de',
    'dj' => 'whois.nic.dj',
    'dk' => 'whois.dk-hostmaster.dk',
    'dm' => 'whois.nic.dm',
    'do' => 'whois.nic.do',
    'dz' => 'whois.nic.dz',
    'ec' => 'whois.nic.ec',
    'edu' => 'whois.educause.edu',
    'ee' => 'whois.tld.ee',
    'eg' => 'whois.ripe.net',
    'es' => 'whois.nic.es',
    'eu' => 'whois.eu',
    'fi' => 'whois.fi',
    'fj' => 'whois.usp.ac.fj',
    'fk' => 'whois.nic.fk',
    'fm' => 'whois.nic.fm',
    'fo' => 'whois.nic.fo',
    'fr' => 'whois.nic.fr',
    'ga' => 'whois.nic.ga',
    'gd' => 'whois.nic.gd',
    'ge' => 'whois.nic.ge',
    'gf' => 'whois.mediaserv.net',
    'gg' => 'whois.gg',
    'gh' => 'whois.nic.gh',
    'gi' => 'whois2.afilias-grs.net',
    'gl' => 'whois.nic.gl',
    'gm' => 'whois.nic.gm',
    'gn' => 'whois.nic.gn',
    'gov' => 'whois.nic.gov',
    'gp' => 'whois.nic.gp',
    'gq' => 'whois.dominio.gq',
    'gr' => 'whois.grnet.gr',
    'gs' => 'whois.nic.gs',
    'gt' => 'whois.nic.gt',
    'gu' => 'whois.nic.gu',
    'gw' => 'whois.nic.gw',
    'gy' => 'whois.nic.gy',
    'hk' => 'whois.hkirc.hk',
    'hm' => 'whois.registry.hm',
    'hn' => 'whois.nic.hn',
    'hr' => 'whois.dns.hr',
    'ht' => 'whois.nic.ht',
    'hu' => 'whois.nic.hu',
    'id' => 'whois.id',
    'ie' => 'whois.domainregistry.ie',
    'il' => 'whois.isoc.org.il',
    'im' => 'whois.nic.im',
    'in' => 'whois.inregistry.net',
    'info' => 'whois.afilias.net',
    'int' => 'whois.iana.org',
    'io' => 'whois.nic.io',
    'iq' => 'whois.cmc.iq',
    'ir' => 'whois.nic.ir',
    'is' => 'whois.isnic.is',
    'it' => 'whois.nic.it',
    'je' => 'whois.je',
    'jm' => 'whois.nic.jm',
    'jo' => 'whois.dns.jo',
    'jobs' => 'whois.nic.jobs',
    'jp' => 'whois.jprs.jp',
    'ke' => 'whois.kenic.or.ke',
    'kg' => 'whois.domain.kg',
    'kh' => 'whois.nic.kh',
    'ki' => 'whois.nic.ki',
    'km' => 'whois.nic.km',
    'kn' => 'whois.nic.kn',
    'kp' => 'whois.kcce.kp',
    'kr' => 'whois.kr',
    'kw' => 'whois.nic.kw',
    'ky' => 'whois.kyregistry.ky',
    'kz' => 'whois.nic.kz',
    'la' => 'whois.nic.la',
    'lb' => 'whois.lbdr.org.lb',
    'lc' => 'whois.nic.lc',
    'li' => 'whois.nic.li',
    'lk' => 'whois.nic.lk',
    'lr' => 'whois.nic.lr',
    'ls' => 'whois.nic.ls',
    'lt' => 'whois.domreg.lt',
    'lu' => 'whois.dns.lu',
    'lv' => 'whois.nic.lv',
    'ly' => 'whois.nic.ly',
    'ma' => 'whois.iam.net.ma',
    'mc' => 'whois.ripe.net',
    'md' => 'whois.nic.md',
    'me' => 'whois.nic.me',
    'mg' => 'whois.nic.mg',
    'mh' => 'whois.nic.mh',
    'mil' => 'whois.nic.mil',
    'mk' => 'whois.marnet.mk',
    'ml' => 'whois.dot.ml',
    'mm' => 'whois.registry.gov.mm',
    'mn' => 'whois.nic.mn',
    'mo' => 'whois.monic.mo',
    'mobi' => 'whois.nic.mobi',
    'mp' => 'whois.nic.mp',
    'mq' => 'whois.mediaserv.net',
    'mr' => 'whois.nic.mr',
    'ms' => 'whois.nic.ms',
    'mt' => 'whois.nic.mt',
    'mu' => 'whois.nic.mu',
    'museum' => 'whois.nic.museum',
    'mv' => 'whois.nic.mv',
    'mw' => 'whois.nic.mw',
    'mx' => 'whois.mx',
    'my' => 'whois.mynic.my',
    'mz' => 'whois.nic.mz',
    'na' => 'whois.na-nic.com.na',
    'name' => 'whois.nic.name',
    'nc' => 'whois.nc',
    'ne' => 'whois.nic.ne',
    'net' => 'whois.verisign-grs.com',
    'nf' => 'whois.nic.nf',
    'ng' => 'whois.nic.ng',
    'ni' => 'whois.ni',
    'nl' => 'whois.domain-registry.nl',
    'no' => 'whois.norid.no',
    'np' => 'whois.nic.np',
    'nr' => 'whois.nic.nr',
    'nu' => 'whois.nic.nu',
    'nz' => 'whois.srs.net.nz',
    'om' => 'whois.registry.om',
    'org' => 'whois.publicinterestregistry.net',
    'pa' => 'whois.nic.pa',
    'pe' => 'whois.nic.pe',
    'pf' => 'whois.registry.pf',
    'pg' => 'whois.nic.pg',
    'ph' => 'whois.nic.ph',
    'pk' => 'whois.nic.pk',
    'pl' => 'whois.dns.pl',
    'pm' => 'whois.nic.pm',
    'pn' => 'whois.nic.pn',
    'pr' => 'whois.nic.pr',
    'pro' => 'whois.nic.pro',
    'ps' => 'whois.pnina.ps',
    'pt' => 'whois.dns.pt',
    'pw' => 'whois.nic.pw',
    'py' => 'whois.nic.py',
    'qa' => 'whois.registry.qa',
    're' => 'whois.nic.re',
    'ro' => 'whois.rotld.ro',
    'rs' => 'whois.rnids.rs',
    'ru' => 'whois.tcinet.ru',
    'rw' => 'whois.ricta.org.rw',
    'sa' => 'whois.nic.sa',
    'sb' => 'whois.nic.sb',
    'sc' => 'whois2.afilias-grs.net',
    'sd' => 'whois.sdnic.sd',
    'se' => 'whois.iis.se',
    'sg' => 'whois.sgnic.sg',
    'sh' => 'whois.nic.sh',
    'si' => 'whois.arnes.si',
    'sk' => 'whois.sk-nic.sk',
    'sl' => 'whois.nic.sl',
    'sm' => 'whois.nic.sm',
    'sn' => 'whois.nic.sn',
    'so' => 'whois.nic.so',
    'sr' => 'whois.sr',
    'st' => 'whois.nic.st',
    'su' => 'whois.tcinet.ru',
    'sv' => 'whois.sv',
    'sx' => 'whois.sx',
    'sy' => 'whois.tld.sy',
    'sz' => 'whois.nic.sz',
    'tc' => 'whois.nic.tc',
    'td' => 'whois.nic.td',
    'tel' => 'whois.nic.tel',
    'tf' => 'whois.nic.tf',
    'tg' => 'whois.nic.tg',
    'th' => 'whois.thnic.co.th',
    'tj' => 'whois.nic.tj',
    'tk' => 'whois.nic.tk',
    'tl' => 'whois.nic.tl',
    'tm' => 'whois.nic.tm',
    'tn' => 'whois.ati.tn',
    'to' => 'whois.tonic.to',
    'tp' => 'whois.nic.tp',
    'tr' => 'whois.nic.tr',
    'tt' => 'whois.nic.tt',
    'tv' => 'whois.nic.tv',
    'tw' => 'whois.twnic.net.tw',
    'tz' => 'whois.tznic.or.tz',
    'ua' => 'whois.ua',
    'ug' => 'whois.co.ug',
    'uk' => 'whois.nic.uk',
    'us' => 'whois.nic.us',
    'uy' => 'whois.nic.uy',
    'uz' => 'whois.cctld.uz',
    'va' => 'whois.ripe.net',
    'vc' => 'whois2.afilias-grs.net',
    've' => 'whois.nic.ve',
    'vg' => 'whois.nic.vg',
    'vi' => 'whois.nic.vi',
    'vn' => 'whois.vnnic.vn',
    'vu' => 'whois.dnrs.neustar',
    'wf' => 'whois.nic.wf',
    'ws' => 'whois.website.ws',
    'ye' => 'whois.nic.ye',
    'yt' => 'whois.nic.yt',
    'za' => 'whois.registry.net.za',
    'zm' => 'whois.zicta.zm',
    'zw' => 'whois.nic.zw',
];