How to make a php Whois query API

Source: Internet
Author: User
Tags date copy mail php script query domain domain name domain name registration
Here we obtain data from the data interface of the WAN or new network, and then output it through the simple text processing of PHP.
Copy CodeThe code is as follows:
<php?
$domain = $_get[' Q '];
Preg_match ("
<div class= "\" Lytableinfowrap\ "" > (. +?) </div>
Is ", @file_get_contents (' http://www.xinnet.cn/Modules/agent/serv/pages/domain_whois.jsp?domainNameWhois= '. $ Domain. ' &nocode=nocode '), $whois);
echo $whois [1];
?>

Do here, may have some friends to ask, this is not a simple PHP script it?! What is API interface? and then we'll process it and make the query more professional:
The query format we need is as follows:
Http://api/whois/baidu.com
Where baidu.com is the domain name that needs to be queried
You can modify the configuration of the nginx to achieve this:
Copy CodeThe code is as follows:
Location ~*/whois/(. +) $ {
Proxy_pass http://127.0.0.1:8080/whois/index.php?q=baidu.com
#将查询传递给内网的apache处理
}

OK, so that a use of the WHOIS API interface is completed, you can call your own program, you can also share the use of ^_^!
Query baidu.com results:
Whois Server Version 2.0
Domain names in the. com and. NET domains can now registered
With many different competing registrars. Go to Http://www.internic.net
For detailed information.
Domain Name:BAIDU.COM
Registrar:REGISTER.COM, Inc.
Whois Server:whois.register.com
Referral url:http://www.register.com
Name Server:dns. Baidu.com
Name Server:ns2. Baidu.com
Name Server:ns3. Baidu.com
Name server:ns4. Baidu.com
status:clienttransferprohibited
status:serverdeleteprohibited
status:servertransferprohibited
status:serverupdateprohibited
Updated date:15-mar-2010
Creation date:11-oct-1999
Expiration date:11-oct-2014
>>> last update of whois Database:fri Aug 05:42:12 UTC <<<
Notice:the expiration date displayed in the "This" is the date the
Registrar ' s sponsorship of the domain name registration in the registry is
Currently set to expire. This date does is not necessarily reflect the expiration
Date of the domain name registrant ' s agreement with the sponsoring
Registrar. Users may consult the sponsoring Registrar's Whois database to
View the Registrar ' s reported date of expiration for this registration.
TERMS of Use:you are not authorized to access or query our Whois
Database through the use of electronic processes that are high-volume and
Automated except as reasonably necessary to register domain names or
Modify existing registrations; The Data in VeriSign Global Registry
Services ' ("VeriSign") Whois database is provided by VeriSign for
Information purposes only, and to assist persons in obtaining information
About or related to a domain name registration the record. VeriSign does not
guarantee its accuracy. By submitting a Whois query, your agree to abide
By the following terms of use:you agree and you
For lawful purposes and that under no circumstances'll you with this Data
To: (1) Allow, enable, or otherwise support the transmission of mass
Unsolicited, commercial advertising or solicitations via e-mail, telephone,
or facsimile; or (2) enable high volume, automated, electronic processes
That is apply to VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of the This Data is expressly
Prohibited without the prior written consent of VeriSign. You are not agree
Use electronic processes the are automated and high-volume to access or
Query the Whois database except as reasonably necessary to register
Domain names or modify existing registrations. VeriSign reserves the right
To restrict your access to the Whois database in its sole discretion to ensure
Operational stability. VeriSign may restrict or terminate your access to the
Whois database for failure to abide by this terms of use. VeriSign
reserves the right to modify these terms in any time.
The Registry database contains only. COM,. NET,. EDU Domains and
Registrars.
The data in register.com ' s WHOIS database are provided to
Register.com For information purposes only, which is, to assist your in
Obtaining information about or related to a domain name registration
Record. Register.com makes this information available ' as is, ' and '
does not guarantee its accuracy. By submitting a WHOIS query,
Agree that you'll use this data to lawful purposes and that,
Under no circumstances would you do this with this data to: (1) Allow, enable,
or otherwise support the transmission of mass unsolicited, commercial
Advertising or solicitations via direct mail, electronic mail, or by
Telephone; or (2) enable high volume, automated, electronic processes
That is apply to register.com (or its systems). The compilation,
repackaging, dissemination or other use of the This data is expressly
Prohibited without the prior written consent of Register.com.
Register.com reserves the right to modify this terms at no time.
By submitting this query, you agree to abide by these terms.
Registrant:
Beijing Baidu netcom Science and Technology Co.Ltd.
Baidu Netcom Baidu Netcom
No. Shangdi 10th Street, Haidian District,
Beijing, 100085
CN
Phone: +86.1059926680
Email:domainmaster@baidu.com
Registrar Name ...: register.com
Registrar Whois ...: whois.register.com
Registrar Homepage:www.register.com
Domain Name:baidu.com
Created on ...: 1999-10-11, ......
Expires on ...: 2014-10-11, ......
Administrative Contact:
Beijing Baidu netcom Science and Technology Co.Ltd.
Baidu Netcom Baidu Netcom
No. Shangdi 10th Street, Haidian District,
Beijing, 100085
CN
Phone: +86.1059927440
Email:wumengyi@baidu.com
Technical Contact:
Registercom
Domain Registrar
575 8th Avenue
New York, NY 10018
US
Phone: +1.9027492701
Email:domainregistrar@register.com
DNS Servers:
Ns3.baidu.com
Ns2.baidu.com
Ns4.baidu.com
Dns.baidu.com
Visit AboutUs.org For more information about baidu.com
AboutUs:baidu.com
Register your domain name at http://www.register.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.