For Port 43 connected to the fsockopen function, I am now working on a program for querying the whois information of the domain name. now some domain names can be queried, such as com and net domain names. Some types cannot be found. for example, if I want to query the whois information of the cn domain name, the code always fails: PHPcode $ query = & quot; www. about port 43 of the fsockopen function connection
I am now working on a program for querying whois information. now some domain names can be queried, such as com and net domain names.
Some types cannot be found. for example, if I want to query the whois information of the cn domain name, it will always fail.
Code:
PHP code
$ Query = "www.net.cn"; // The domain name to be queried $ server = "whois.cnnic.cn"; // whois server address $ data = ""; // initialize the final output variable value $ fp = @ fsockopen ($ server, 43); fputs ($ fp, $ query); while (! Feof ($ fp) {$ data. = nl2br (fgets ($ fp, 128);} fclose ($ fp); echo $ data;
I used a tool to check that port 43 of whois.cnnic.cn is open.
Why is the blank output?
Is there a problem with my program? Or what's wrong?
------ Solution --------------------
I remember that some queries can be blocked. Is this a problem.
------ Solution --------------------
[User: liangdong Time: 18: 20: 36 Path :~ /Php] $ telnet whois.cnnic.cn 43
Trying 218.241.97.14...
Connected to whois.cnnic.cn.
Escape character is '^]'.
Www.net.cn
Domain Name: www.net.cn
ROID: 20021209s10021s00003058-cn
Domain Status: clientDeleteProhibited
Domain Status: clientUpdateProhibited
Domain Status: clientTransferProhibited
Registrant ID: hc034904482-cn
Registrant Organization: Beijing HiChina Zhicheng Technology Co., Ltd.
Registrant Name: Wang Juan
Registrant Email: wjuan@hichina.com
Sort soring Registrar: Beijing wanwangzhicheng Technology Co., Ltd.
Name Server: ns3.hichina.com
Name Server: ns4.hichina.com
Registration Date: 00:00:00
Expiration Date: 2020-10-19 00:00:00
Dnssec Deployment: N
Connection closed by foreign host.
Telnet is acceptable. \ n is used to determine the end, $ query = "xxxx \ n"
------ Solution --------------------
Strange!
No handshake signal is sent when a session is initiated.
If you make a call, do you have to confirm who the other person is?