I got this code for whois lookup from here.
but i am getting raw data or html data .. i am getting an output but not in readable format like in json or xml .. how i can convert this into json .. pasting a example output
ttmm.com domain lookup results from whois.ename.com server:
enter code here Domain Name: ttmm.com
Registry Domain ID:
Registrar WHOIS Server: whois.ename.com
Registrar URL: http://www.ename.net
Updated Date: 1998-11-25 T05:00:00Z
Creation Date: 1998-11-25 T05:00:00Z
Registrar Registration Expiration Date: 2016-11-24 T05:00:00Z
Registrar: eName Technology Co.,Ltd.
Registrar IANA ID: 1331
Registrar Abuse Contact Email: [email protected]
Registrar Abuse Contact Phone: +86.4000044400
Domain Status: clientDeleteProhibited
https://www.icann.org/epp#clientDeleteProhibited
Domain Status: clientTransferProhibited https://www.icann.org/epp#clientTransferProhibited
Registry Registrant ID:Not Available From Registry
Registrant Name: chousteven
Registrant Organization: hua you
Registrant Street: an yuan cun daxue cheng
Registrant City: ping xiang shi
Registrant State/Province: jiang xi
Registrant Postal Code: 337000
Registrant Country: CN
Registrant Phone: +86.15979220355
Registrant Phone Ext:
Registrant Fax: +86.15979220355
Registrant Fax Ext:
Registrant Email: [email protected]
Registry Admin ID:Not Available From Registry
Admin Name: chousteven
Admin Organization: hua you
Admin Street: an yuan cun daxue cheng
Admin City: ping xiang shi
Admin State/Province: jiang xi
Admin Postal Code: 337000
Admin Country: CN
Admin Phone: +86.15979220355
Admin Phone Ext:
Admin Fax: +86.15979220355
Admin Fax Ext:
Admin Email: [email protected]
Registry Tech ID:Not Available From Registry
Tech Name: chousteven
Tech Organization: hua you
Tech Street: an yuan cun daxue cheng
Tech City: ping xiang shi
Tech State/Province: jiang xi
Tech Postal Code: 337000
Tech Country: CN
Tech Phone: +86.15979220355
Tech Phone Ext:
Tech Fax: +86.15979220355
Tech Fax Ext:
Tech Email: [email protected]
Name Server: ns1.alidns.com
Name Server: ns2.alidns.com
DNSSEC: unsigned
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
>>> Last update of WHOIS database: 2015-11-19 T12:53:51Z <<<
For more information on Whois status codes, please visit
https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en
Lots of custom parsing. Sorry. There is no simple solution.
There is no standard format for WHOIS responses. At a minimum, most registries have a slightly different format for responses; additionally, "thin registries" such as .COM and .NET require every registrar to implement their own WHOIS server, each of which has its own slightly different, idiosyncratic format.
As others have noted, there are paid APIs available to do this parsing for you. Depending on your needs, this may be a more appropriate solution than trying to parse several thousand different formats yourself.