whois查询

来源:互联网 发布:vue.js 金额格式化 编辑:程序博客网 时间:2024/06/05 05:47


Whois查询接口文档

whois(读作“Who is”,非缩写)是用来查询域名IP以及所有者等信息的传输协议。简单说,whois就是一个用来查询域名是否已经被注册,以及注册域名的详细信息的数据库(如域名所有人、域名注册商)。通过whois来实现对域名信息的查询。早期的whois查询多以命令列接口存在,但是现在出现了一些网页接口简化的线上查询工具,可以一次向不同的数据库查询。网页接口的查询工具仍然依赖whois协议向服务器发送查询请求,命令列接口的工具仍然被系统管理员广泛使用。whois通常使用TCP协议43端口。每个域名/IPwhois信息由对应的管理机构保存。

 

Whois查询接口: http://www.haoservice.com/docs/12

 

支持格式: json

 

接口形式:http

 {
    "error_code":0,
    "reason":"Success",
    "result":{
        "exp_date":" 27-mar-2015",
        "name_server":" NS1.EZDNSCENTER.COM, NS2.EZDNSCENTER.COM, NS3.EZDNSCENTER.COM, NS4.EZDNSCENTER.COM,
                        NS5.EZDNSCENTER.COM, NS6.EZDNSCENTER.COM, ns1.ezdnscenter.com, ns2.ezdnscenter.com,
                        ns3.ezdnscenter.com, ns4.ezdnscenter.com, ns5.ezdnscenter.com, ns6.ezdnscenter.com",
        "status":" clientTransferProhibitedRegistry Registrant ID:",
        "name":" haoservice.com",
        "email":" xxxx@xxx.com",
        "registrar":" SHANGHAI MEICHENG TECHNOLOGY INFORMATION DEVELOPMENT CO., LTD.",
        "reg_date":" 27-mar-2013",
        "total_infor":null,
        "Registrant_Organization":" xxxxxx"
    }
}


演示示例:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Net;
using System.IO;
using System.IO.Compression;
using System.Text.RegularExpressions;
using System.Web.Script.Serialization;
namespace map
{
    class Program
    {
        static void Main(string[] args)
        {
            string key = "*****************";//申请的key值
            string domian = "haoservice.com";
     
            string url = "http://apis.haoservice.com/whois?domain="+domian+"&key=" + key;
            WebClient wc = new WebClient();
            wc.Encoding = Encoding.UTF8;
            string str = wc.DownloadString(url);
            Console.WriteLine(str);
            Console.ReadKey();


        }
    }
}

0 0