furqansoftware / node-whois Goto Github PK
View Code? Open in Web Editor NEWA simple WHOIS client for NodeJS
Home Page: https://npmjs.org/package/whois
License: Other
A simple WHOIS client for NodeJS
Home Page: https://npmjs.org/package/whois
License: Other
If a timeout occurs, the socket remains open. That's bad for CLI scripts, because they don't exit until all sockets are closed.
According to the socket.setTimeout(timeout[, callback]) docs:
When an idle timeout is triggered the socket will receive a 'timeout' event but the connection will not be severed. The user must manually
end()
ordestroy()
the socket.
I therefore suggest to destroy()
the socket (end()
leads to write
after end
errors in some cases):
socket.on 'timeout', =>
+ socket.destroy
done new Error 'lookup: timeout'
The changes in 2.5.10 to the regex made the whois request return different values.
registryExpiryDate
appears to be the only missing, replaced by registrarRegistrationExpirationDate
DomainCheckResult {
domainName: 'GOOGLE.COM',
registryDomainID: '2138514_DOMAIN_COM-VRSN',
registrarWHOISServer: 'whois.markmonitor.com',
registrarURL: 'http://www.markmonitor.com',
updatedDate: 2018-02-21T18:36:40.000Z,
creationDate: 1997-09-15T04:00:00.000Z,
registryExpiryDate: 2020-09-14T04:00:00.000Z,
registrar: 'MarkMonitor Inc.',
registrarIANAID: '292',
registrarAbuseContactEmail: '[email protected]',
registrarAbuseContactPhone: '+1.2083895740',
domainStatus: 'serverUpdateProhibited https://icann.org/epp#serverUpdateProhibited',
nameServer: 'NS4.GOOGLE.COM',
dnssec: 'unsigned',
urloftheICANNWhoisInaccuracyComplaintForm: 'https://www.icann.org/wicf/',
'>>>Lastupdateofwhoisdatabase': '2018-05-30T15:20:12Z <<<',
notice: 'The expiration date displayed in this record is the date the',
termsOFUSE: 'You are not authorized to access or query our Whois',
bythefollowingtermsofuse: 'You agree that you may use this Data only',
to: '(1) allow, enable, or otherwise support the transmission of mass',
endText: '\nFor more information on Whois status codes, please visit https://icann.org/epp\n\nregistrar\'s sponsorship of the domain name registration in the registry is\ncurrently set to expire. This date does not necessarily reflect the expiration\ndate of the domain name registrant\'s agreement with the sponsoring\nregistrar. Users may consult the sponsoring registrar\'s Whois database to\nview the registrar\'s reported date of expiration for this registration.\n\ndatabase through the use of electronic processes that are high-volume and\nautomated except as reasonably necessary to register domain names or\nmodify existing registrations; the Data in VeriSign Global Registry\nServices\' ("VeriSign") Whois database is provided by VeriSign for\ninformation purposes only, and to assist persons in obtaining information\nabout or related to a domain name registration record. VeriSign does not\nguarantee its accuracy. By submitting a Whois query, you agree to abide\nfor lawful purposes and that under no circumstances will you use this Data\nunsolicited, commercial advertising or solicitations via e-mail, telephone,\nor facsimile; or (2) enable high volume, automated, electronic processes\nthat apply to VeriSign (or its computer systems). The compilation,\nrepackaging, dissemination or other use of this Data is expressly\nprohibited without the prior written consent of VeriSign. You agree not to\nuse electronic processes that are automated and high-volume to access or\nquery the Whois database except as reasonably necessary to register\ndomain names or modify existing registrations. VeriSign reserves the right\nto restrict your access to the Whois database in its sole discretion to ensure\noperational stability. VeriSign may restrict or terminate your access to the\nWhois database for failure to abide by these terms of use. VeriSign\nreserves the right to modify these terms at any time.\n\nThe Registry database contains ONLY .COM, .NET, .EDU domains and\nRegistrars.\n' }
DomainCheckResult {
domainName: 'google.com',
registryDomainID: '2138514_DOMAIN_COM-VRSN',
registrarWHOISServer: 'whois.markmonitor.com',
registrarURL: 'http://www.markmonitor.com',
updatedDate: 2018-02-21T18:45:07.000Z,
creationDate: 1997-09-15T07:00:00.000Z,
registrarRegistrationExpirationDate: 2020-09-14T04:00:00.000Z,
registrar: 'MarkMonitor, Inc.',
registrarIANAID: '292',
registrarAbuseContactEmail: '[email protected]',
registrarAbuseContactPhone: '+1.2083895740',
domainStatus: 'serverDeleteProhibited (https://www.icann.org/epp#serverDeleteProhibited)',
registrantOrganization: 'Google LLC',
'registrantState/Province': 'CA',
registrantCountry: 'US',
adminOrganization: 'Google LLC',
'adminState/Province': 'CA',
adminCountry: 'US',
techOrganization: 'Google LLC',
'techState/Province': 'CA',
techCountry: 'US',
nameServer: 'ns4.google.com',
dnssec: 'unsigned',
urloftheICANNWHOISDataProblemReportingSystem: 'http://wdprs.internic.net/',
'>>>LastupdateofWHOISdatabase': '2018-05-30T08:16:18-0700 <<<',
endText: 'If certain contact information is not shown for a Registrant, Administrative,\nor Technical contact, and you wish to send a message to these contacts, please\nsend your message to [email protected] and specify the domain name in\nthe subject line. We will forward that message to the underlying contact.\nIf you have a legitimate interest in viewing the non-public WHOIS details, send\nyour request and the reasons for your request to [email protected]\nand specify the domain name in the subject line. We will review that request and\nmay ask for supporting documentation and explanation.\nThe Data in MarkMonitor.com\'s WHOIS database is provided by MarkMonitor.com for\ninformation purposes, and to assist persons in obtaining information about or\nrelated to a domain name registration record. MarkMonitor.com does not guarantee\nits accuracy. By submitting a WHOIS query, you agree that you will use this Data\nonly for lawful purposes and that, under no circumstances will you use this Data to:\n(1) allow, enable, or otherwise support the transmission of mass unsolicited,\ncommercial advertising or solicitations via e-mail (spam); or\n(2) enable high volume, automated, electronic processes that apply to\nMarkMonitor.com (or its systems).\nMarkMonitor.com reserves the right to modify these terms at any time.\nBy submitting this query, you agree to abide by this policy.\nMarkMonitor is the Global Leader in Online Brand Protection.\nMarkMonitor Domain Management(TM)\nMarkMonitor Brand Protection(TM)\nMarkMonitor AntiPiracy(TM)\nMarkMonitor AntiFraud(TM)\nProfessional and Managed Services\nVisit MarkMonitor at http://www.markmonitor.com\nContact us at +1.8007459229\nIn Europe, at +44.02032062220\nFor more information on Whois status codes, please visit\nhttps://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en\n--\n' }
The current whois
package on npm was last updated 3 years ago, is version 0.0.0, described by the author @weppos as:
My attempt to build a JavaScript WHOIS client for node.js.
Please note this is just an experiment!
Since node-whois
has 10x+ the downloads, an a lot more updates, having it use the name 'whois' (and not include node- per the npm guidelines ) would be good.
If the node-whois people are amenable, maybe asking @weppos if he could transfer ownership of whois would steer users towards this popular, maintained package.
Thank you for useful library!
When I try to get whois info from 50.0.0.0
, I got an error as
Error: getaddrinfo ENOTFOUND rwhois.sonic.net4321 rwhois.sonic.net4321:43
I create the test case for reproduction https://runkit.com/sapics/5e0ab738d78cf8001919d709.
I am trying to make a request, but the request does not complete.
This is a simplified version of the code.
console.log("Start");
require('whois')
.lookup("jrtapsell.tech", data => {
console.log("End");
});
In some cases it's important to have the output from the intermediate whois severs, and not just the output of the final "followed" whois server. For example, whois.godaddy.com provides very limited information and no registration and expiry dates, but those dates are provided by the default .com whois server.
There are probably lots of different ways to do this, but one suggestion is to have something like a verbose or detailed mode that could be enabled via an option. In this mode the response would include full server and response details from each server in the request chain. Here's an example response:
[
{server: 'first-whois-server.com',
response: 'whois response',},
{server: 'second-whois-server.com',
response: 'whois response',},
{server: 'third-whois-server.com',
response: 'whois response',}
]
Hi,
Is there any way to add proxy support ? I got ban for 30 minutes each 300 request (around).
Thanks.
Not able to search .ai domain for example wit.ai.
If I use server
option with value whois.nic.ai
then it works.
In server.json value for .ai is whois..ai. Either type error or this server is not active now.
I saw a npm module server-json, can we utilize it by making dependency on this module or giving option to use another server list like:
const whois = require('whois')
const serversList = require('whois-servers')
// or servers lookup by any other mean with output like
const serversList = {
"ai": "whois.nic.ai",
"info" "whois.afilias.info"
}
whois.lookup('wit.ai', {servers: serverList}, function(err, data) {
console.log(data)
})
"pro": "whois.dotproregistry.net" not work
Hello,
Verisign changed the format of their whois responses.
Whois server address given in Verisign responses in now prefixed with "Registrar WHOIS Server:"
The regex in the node-whois code isn't up-to-date (currently: (ReferralServer|Registrar Whois|Whois Server|WHOIS Server)) so extracting the server address doesn't work and resolution stop early.
Hi,
I'm facing an error which is impossible to handle, even using try...catch.
How to reproduce:
$ npm install whois
└── [email protected]
$ cat whois-sample.js
var whois = require('whois');
whois.lookup('example.org', {}, function(err, rawData) {
console.log("WHOIS inside lookup callback");
if ( err ) {
return console.log(err, null);
}
return console.log(null, rawData);
});
$ node whois-sample.js
net.js:961
throw new RangeError('"port" option should be >= 0 and < 65536: ' + port);
^
RangeError: "port" option should be >= 0 and < 65536:
at lookupAndConnect (net.js:961:13)
at Socket.connect (net.js:936:5)
at Object.exports.connect.exports.createConnection (net.js:74:35)
at Object.__dirname.lookup (..../node_modules/whois/index.js:63:18)
at Socket.<anonymous> (..../node_modules/whois/index.js:95:17)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at TCP._handle.close [as _onclose] (net.js:498:12)
$ node -v
v6.9.5
$ npm -v
3.10.10
If I change the domain to example.com
or any other I've tested, it works. However, it may happen to other domains.
Thanks in advance.
Please augment servers.json
with line
"online": "whois.centralnic.net",
to add support for .ONLINE TLD.
Try searching for example.online
using this:
var whois = require('whois');
whois.lookup('example.online', function(err, data){
if (err) throw err;
console.log(data);
});
% Note: this output has been filtered.
% To receive output for a database update, use the "-B" flag.
%ERROR:101: no entries found
%
% No entries found in source RIPE.
% This query was served by the RIPE Database Query Service version 1.89.2 (BLAARKOP)
This domain is not available for registration. It has been reserved
in compliance with Specification 5 of the New gTLD Registry
Agreement. Please see https://gitlab.centralnic.com/centralnic/
spec5-reserved-names/blob/master/README.md for more information.
For more information on Whois status codes, please visit https://icann.org/epp
This whois service is provided by CentralNic Ltd and only contains
information pertaining to Internet domain names registered by our
our customers. By using this service you are agreeing (1) not to use any
information presented here for any purpose other than determining
ownership of domain names, (2) not to store or reproduce this data in
any way, (3) not to use any high-volume, automated, electronic processes
to obtain data from this service. Abuse of this service is monitored and
actions in contravention of these terms will result in being permanently
blacklisted. All data is (c) CentralNic Ltd https://www.centralnic.com/
Access to the whois service is rate limited. For more information, please
see https://registrar-console.centralnic.com/pub/whois_guidance.
Note that example.online
is a special domain, so its lookup result is a special message. Here is a lookup of my own domain homograph.online
:
For more information on Whois status codes, please visit https://icann.org/epp
This whois service is provided by CentralNic Ltd and only contains
information pertaining to Internet domain names registered by our
our customers. By using this service you are agreeing (1) not to use any
information presented here for any purpose other than determining
ownership of domain names, (2) not to store or reproduce this data in
any way, (3) not to use any high-volume, automated, electronic processes
to obtain data from this service. Abuse of this service is monitored and
actions in contravention of these terms will result in being permanently
blacklisted. All data is (c) CentralNic Ltd https://www.centralnic.com/
Access to the whois service is rate limited. For more information, please
see https://registrar-console.centralnic.com/pub/whois_guidance.
Also, there might be some other TLDs that are not supported, complete list of all currently registered TLDs can be obtained from IANA here (updated regularly). From what I (know)[https://www.iana.org/domains/reserved], example.tld
is registered by IANA in all open TLDs. Therefore, it should be pretty simple to request whois for example.tld
for all TLDs in the list and then see which fail and with what error. Unfortunately, I don't have time for this right now, but I might do it later and submit a PR, if you are interested.
I noticed you fixed the .com entry (#16), but the .net and .org servers are also duplicated in server.json.
Hello!
It would be great to have ability to merge own servers.json
(or an object) list with existing. For example I know some whois servers, that better match my requirements and existing server
options don't allow to do it for me 😞
I think there's a bug when whois lookup trying to get information from PendingDelete domain, Redemption domain, etc. There is an example:
WHOIS: https://cloudup.com/cVAZ-TbLLRl (no match, mean available)
WHO.IS/whois: https://cloudup.com/c6G1FEp57ZP (pendingdelete, mean taken)
Is there any solution?
coffee> whois.lookup('gettyimages.cn', (e, r) -> console.log r)
Domain Name: gettyimages.cn
ROID: 20050408s10001s05477444-cn
Domain Status: ok
Registrant ID: kg35-855516_00
(ed:,)eeft: e
f/f ie,e8
Registrant Contact Email: [email protected]
Sponsoring Registrar: e&␋(␍8 ␍:␍:±'°
!␍;=° ␋␊,␊8
Name Server: ns3.dns-diy.com
Name Server: ns4.dns-diy.com
Registration Date: 2005-04-08 14:09:43
Expiration Date: 2014-04-08 14:09:43
DNSSEC: unsigned
From command line whois:
$ whois gettyimages.cn
Domain Name: gettyimages.cn
ROID: 20050408s10001s05477444-cn
Domain Status: ok
Registrant ID: kg35-855516_00
Registrant: 华盖创意(北京)图像技术有限公司
Registrant Contact Email: [email protected]
Sponsoring Registrar: 厦门三五互联科技股份有限公司
Name Server: ns3.dns-diy.com
Name Server: ns4.dns-diy.com
Registration Date: 2005-04-08 14:09:43
Expiration Date: 2014-04-08 14:09:43
DNSSEC: unsigned
Hi,
I ran a test for node-whois, and it failed three of them. The package seems to fail retrieving all ".com" domains actually.
> mocha -u bdd -R spec -t 10000 -s 5000 --compilers coffee:coffee-script test.coffee
-
#lookup()
1) should work with google.com
✓ should work with 50.116.8.109
✓ should honor specified WHOIS server
✓ should honor specified WHOIS server with port override
2) should follow specified number of redirects for domain
✓ should follow specified number of redirects for IP address
✓ should work with nic.sh
✓ should work with nic.io
✓ should work with nic.ac
✓ should work with nic.tm
✓ should work with srs.net.nz
3) should work with redundant follow
9 passing (8s)
3 failing
1) #lookup() should work with google.com:
Uncaught Error: connect ECONNREFUSED
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)
2) #lookup() should follow specified number of redirects for domain:
Uncaught Error: connect ECONNREFUSED
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)
3) #lookup() should work with redundant follow:
Uncaught Error: connect ECONNREFUSED
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
Do we need to update the servers.json
file for this?
Does the 'bin' file that npm uses need a shebang?
#!/usr/bin/env node
I'm using whois
on Windows and it's just opening the index.js
file in a text editor, rather than executing it via node. See http://stackoverflow.com/a/10398567/319878.
Sample .cmd
file for Grunt, generated by npm:
type C:\Users\xxx\AppData\Roaming\npm\grunt.cmd
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\node_modules\grunt-cli\bin\grunt" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\node_modules\grunt-cli\bin\grunt" %*
)
The whois.cmd
file, generated by npm:
type C:\Users\xxx\AppData\Roaming\npm\whois.cmd
@"%~dp0\node_modules\whois\index.js" %*
I've copied the scaffolding from the Grunt file and it works fine, but I think the shebang needs to be in the generated index.js (or other bin file) in order for npm to generate the correct .cmd
file.
Please add support to .info domains, I tried to lookup "get.info", but nothing happens. It will be VERY cool, if node-whois will have parser too. Thx.
Data is returned both when the domain is available and when it is not. How does one detect whether it is?
In the "Usage" options section, proxy.ipaddress should be proxy.host to work with the latest [email protected]
module:
"proxy": { // (optional) SOCKS Proxy
"host": "",
Weirdly the server
option isn't working. Observe the output from:
whois.lookup('google.com', {server:'whois.geektools.com'}, function(err, rawData) {
console.log(rawData)
})
or
whois.lookup('google.com', {server:'whois.geektools.com:43'}, function(err, rawData) {
console.log(rawData)
})
Doesn't actually end up using this server
but instead the default one at MarkMonitor.
Does not support .space lookups. Also, any ideas on how I can derive all the registerable domain extensions from the servers.json file.
PS Thanks for this NPM!
"example.ac" and "example.tm" throw the following error:
node-whois/index.js:66
, trs = table.querySelectorAll('tr')
^
TypeError: Cannot call method 'querySelectorAll' of null
at IncomingMessage.<anonymous> (node-whois/index.js:66:29)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
I found setting the timeout option and did not take effect。
net.createConnection(options[, connectListener])
timeout If set, will be used to call socket.setTimeout(timeout) after the socket is created, but before it starts the connection.
socket.setTimeout(3000);
socket.on('timeout', () => {
console.log('socket timeout');
socket.end();
});
The error occurs for domain simo.so
net.js:955
throw new ERR_SOCKET_BAD_PORT(port);
^
RangeError [ERR_SOCKET_BAD_PORT]: Port should be >= 0 and < 65536. Received whois.nic.so.
at lookupAndConnect (net.js:955:13)
at Socket.connect (net.js:931:5)
at Object.connect (net.js:156:17)
at Object.lookup
When doing a lookup for theaternetz.org
whois.lookup('theaternetz.org', function(err, data) {
console.log(data)
})
The Following Error is given.
Socket {
connecting: true,
_hadError: false,
_handle:
TCP {
reading: false,
owner: [Circular],
onread: [Function: onread],
onconnection: null,
domain:
Domain {
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
members: [] } },
_parent: null,
_host: 'whois.pir.org',
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { length: 0 },
length: 0,
pipes: null,
pipesCount: 0,
flowing: true,
ended: false,
endEmitted: false,
reading: false,
sync: true,
needReadable: false,
emittedReadable: false,
readableListening: false,
resumeScheduled: true,
emitClose: false,
destroyed: false,
defaultEncoding: 'utf8',
awaitDrain: 0,
readingMore: false,
decoder: null,
encoding: null },
readable: false,
domain:
Domain {
domain: null,
_events:
{ removeListener: [Function: updateExceptionCapture],
newListener: [Function: updateExceptionCapture],
error: [Function: debugDomainError] },
_eventsCount: 3,
_maxListeners: undefined,
members: [] },
_events:
{ end: [Function: onReadableStreamEnd],
connect:
{ [Function: bound onceWrapper] listener: [Function: connect] },
data: [Function],
timeout: [Function],
error: [Function],
close: [Function] },
_eventsCount: 6,
_maxListeners: undefined,
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: false,
defaultEncoding: 'utf8',
length: 17,
writing: true,
corked: 0,
sync: false,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: [Function: nop],
writelen: 17,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 1,
prefinished: false,
errorEmitted: false,
emitClose: false,
bufferedRequestCount: 0,
corkedRequestsFree:
{ next: null,
entry: null,
finish: [Function: bound onCorkedFinish] } },
writable: true,
allowHalfOpen: false,
_sockname: null,
_pendingData: 'theaternetz.org\r\n',
_pendingEncoding: 'utf8',
server: null,
_server: null,
[Symbol(asyncId)]: 159,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]:
Timeout {
_called: false,
_idleTimeout: 60000,
_idlePrev:
TimersList {
_idleNext: [Circular],
_idlePrev: [Circular],
_unrefed: true,
msecs: 60000,
_timer: [Timer] },
_idleNext:
TimersList {
_idleNext: [Circular],
_idlePrev: [Circular],
_unrefed: true,
msecs: 60000,
_timer: [Timer] },
_idleStart: 3064,
_onTimeout: [Function: bound ],
_timerArgs: undefined,
_repeat: null,
_destroyed: false,
domain:
Domain {
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
members: [] },
[Symbol(unrefed)]: true,
[Symbol(asyncId)]: 162,
[Symbol(triggerId)]: 5 },
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0 }
RangeError [ERR_SOCKET_BAD_PORT]: Port should be > 0 and < 65536. Received //isp.cronon.net/whois-abfrage/.
at lookupAndConnect (net.js:1010:13)
at Socket.connect (net.js:986:5)
at Object.connect (net.js:152:35)
at Object.lookup (/home/hapax/github/XRayTrackerMapper/node_modules/whois/index.js:160:22)
``
When looking up an IDN .de domain, node-whois is trying to convert it into punyname before sending the actual whois request:
"data": "Domain: xn--kche-0ra.de\nStatus: invalid\n",
"server": {
"host": "whois.denic.de",
"port": 43,
"query": "$addr\r\n"
}
DENIC's whois server (whois.denic.de
) however expects the domain in the normal unicode format:
"data": "Domain: küche.de\nDomain-Ace: xn--kche-0ra.de\nStatus: connect\n",
"server": {
"host": "whois.denic.de",
"port": 43,
"query": "$addr\r\n"
}
For the result above I changed the following code:
- return socket.write(server.query.replace('$addr', punycode.toASCII(addr)));
+ return socket.write(server.query.replace('$addr', addr));
I have no clue if this is a special case or if it's the general way to lookup IDN domains in whois servers. Can anyone shed some light in here?
Why don't you add support for IPv6 addresses? It just works the same way as IPv4 on the same whois-server.
Pull request: #36
Might require the same fix as for .sh domains (same registrar - as is .ac - http://www.icb.co.uk/)
Came across a weird error. Thought I would let you know.
import whois from 'whois'
whois.lookup('judahfamily.org', (err, data) => {
});
net.js:1048
throw new RangeError('"port" option should be >= 0 and < 65536: ' + port);
^
RangeError: "port" option should be >= 0 and < 65536: //api.fastdomain.com/cgi/whois
at lookupAndConnect (net.js:1048:13)
at Socket.connect (net.js:1021:5)
at Object.connect (net.js:113:35)
at Object.lookup (\node_modules\whois\index.js:160:22)
at Socket.<anonymous> (\node_modules\whois\index.js:107:21)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at TCP._handle.close [as _onclose] (net.js:557:12)
nodejs version v8.11.2
whois version ^2.6.0
I can't reproduce this with any specific domain, but my script sometimes dies when using node-whois and produces the following output:
==== Stack trace ============================================
Security context: 0x3613462d <JS Object>#0#
1: getListeners [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/events.js:~168] (this=0x5c7993a5 <JS Function>#1#,target=0x217a2061 <JS Global Object>#2#,ty
pe=0x42815491 <String[5]: error>,capturing=0x361080b1 <true>)
2: dispatch [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/events.js:192] (this=0x5c7993a5 <JS Function>#1#,event=0x47c11e5d <JS Object>#3#,iterator=0x47c1
2115 <JS Function iterator>#4#,capturing=0x361080b1 <true>)
3: dispatchEvent [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/events.js:283] (this=0xb2c43be9 <JS Object>#5#,event=0x47c11e5d <JS Object>#3#)
4: dispatchEvent [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/html.js:~551] (this=0xb2c43be9 <JS Object>#5#,event=0x47c11e5d <JS Object>#3#)
5: /* anonymous */ [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/html.js:86] (this=0x361346d5 <JS Global Object>#6#,err=0x47c1172d <an Error>#7#,data=0x36
108091 <undefined>)
6: check [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/html.js:339] (this=0xb2c715dd <an Object>#8#)
7: /* anonymous */ [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/html.js:357] (this=0x361346d5 <JS Global Object>#6#,err=0x47c1172d <an Error>#7#,data=0x36108091 <undefined>)
8: arguments adaptor frame: 1->2
9: /* anonymous */ [fs.js:207] (this=0x361346d5 <JS Global Object>#6#,er=0x47c1172d <an Error>#7#,fd_=0x36108091 <undefined>)
10: arguments adaptor frame: 1->2
12: oncomplete [fs.js:107] (this=0x5c7d3735 <an Object>#9#)
13: arguments adaptor frame: 1->0
==== Details ================================================
[1]: getListeners [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/events.js:~168] (this=0x5c7993a5 <JS Function>#1#,target=0x217a2061 <JS Global Object>#2#,type=0x42815491 <String[5]: error>,capturing=0x361080b1 <true>) {
// optimized frame
}
[2]: dispatch [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/events.js:192] (this=0x5c7993a5 <JS Function>#1#,event=0x47c11e5d <JS Object>#3#,iterator=0x47c12115 <JS Function iterator>#4#,capturing=0x361080b1 <true>) {
// stack-allocated locals
var listeners = 0x36108091 <undefined>
var currentListener = 0x36108091 <undefined>
var target = 0x217a2061 <JS Global Object>#2#
// expression stack (top to bottom)
[07] : 0x361080b1 <true>
[06] : 0x42815491 <String[5]: error>
[05] : 0x217a2061 <JS Global Object>#2#
[04] : 0x5c7993a5 <JS Function>#1#
[03] : 0x5c7993fd <JS Function dispatch>#10#
--------- s o u r c e c o d e ---------
function dispatch(event, iterator, capturing) {? var listeners,? currentListener,? target = iterator();?? while (target && !event._stopPropagation) {? listeners = events.EventTarget.getListeners(target, event._type, capturing);? currentListener = listeners.length;? while (cur...
-----------------------------------------
}
[3]: dispatchEvent [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/events.js:283] (this=0xb2c43be9 <JS Object>#5#,event=0x47c11e5d <JS Object>#3#) {
// stack-allocated locals
var targetList = 0x47c12079 <JS Array[4]>#11#
var target = 0xb2c17e45 <an HTMLDocument>#12#
var targetParent = 0x217a2061 <JS Global Object>#2#
var iterator = 0x47c12115 <JS Function iterator>#4#
var i = 0x36108091 <undefined>
// expression stack (top to bottom)
[08] : 0x361080b1 <true>
[07] : 0x47c12115 <JS Function iterator>#4#
[06] : 0x47c11e5d <JS Object>#3#
[05] : 0x5c7993a5 <JS Function>#1#
--------- s o u r c e c o d e ---------
function (event) {? if (event == null) {? throw new events.EventException(0, "Null event");? }? if (event._type == null || event._type == "") {? throw new events.EventException(0, "Uninitialized event");? }?? var targetList = [];?? event._target...
-----------------------------------------
}
[4]: dispatchEvent [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/html.js:~551] (this=0xb2c43be9 <JS Object>#5#,event=0x47c11e5d <JS Object>#3#) {
// optimized frame
}
[5]: /* anonymous */ [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/html.js:86] (this=0x361346d5 <JS Global Object>#6#,err=0x47c1172d <an Error>#7#,data=0x36108091 <undefined>) {
// stack-allocated locals
var ev = 0x47c11e5d <JS Object>#3#
// expression stack (top to bottom)
[02] : 0x47c11e5d <JS Object>#3#
[01] : 0xb2c43be9 <JS Object>#5#
--------- s o u r c e c o d e ---------
function (err, data) {? var ev = doc.createEvent('HTMLEvents');?? if (!err) {? try {? callback.call(element, data, filename || doc.URL);? ev.initEvent('load', false, false);? }? catch(e) {? err = e;? }? }?? if (err) {? ev.initE...
-----------------------------------------
}
[6]: check [PROJECT_DIR/node_modules/node-whois/node_modules/jsdom/lib/jsdom/level2/html.js:339] (this=0xb2c715dd <an Object>#8#) {
// expression stack (top to bottom)
[03] : 0x36108091 <undefined>
[02] : 0x47c1172d <an Error>#7#
[01] : 0x361346d5 <JS Global Object>#6#
[00] : 0xb2c7632d <JS Function>#13#
--------- s o u r c e c o d e ---------
function () {? if (!q.paused && !this.prev && this.fired){? callback(this.err, this.data);? if (this.next) {? this.next.prev = null;? this.next.check();? }else{//q.tail===this?? q.tail = null;?? }? }? }
-----------------------------------------
require('whois').lookup('google.com', { verbose: true }, (err, data) => {
console.log(data);
});
Output:
$ node ./index.js
/app/whois-test/node_modules/whois/index.js:117
server: server.trim(),
^
TypeError: server.trim is not a function
at /app/whois-test/node_modules/whois/index.js:117:38
at /app/whois-test/node_modules/underscore/underscore.js:957:21
at Socket.<anonymous> (/app/whois-test/node_modules/whois/index.js:129:20)
at Socket.emit (events.js:189:13)
at TCP._handle.close (net.js:597:12)
whois version: 2.10.0
node version: 10.15.3 (LTS)
Using a socks proxy results in this error thrown at whois/index.js:138.
Example:
var whois = require('whois');
var opt = {
proxy:{
host: 'XXX.XXX.XXX.XXX,
port: 666,
type: 4
}
}
whois.lookup('google.com', opt, function(err, data) {
console.log(data)
})
[email protected]
Looks like the socks module has changed its signature. These changes in whois/index.js
should fix it:
line 11
socks = require('socks').SocksClient;
line 138
return socks.createConnection({
proxy: proxy,
destination: {
host: server.host,
port: server.port
},
command: 'connect',
timeout: timeout
}, function(err, info) {
if (err != null) {
return done(err);
}
if (timeout) {
info.socket.setTimeout(timeout);
}
_lookup(info.socket, done);
return info.socket.resume();
I'd submit a PR but I can't write coffeescript.
For whatever reason, the NZ WhoIs server doesn't respond to domain nodejs.geek.nz
. However it does respond to just nodejs.geek.nz
just fine.
I would love to do a PR for this for you, but first I'd just like to check if changing the "nz" string to an object of some sort in servers.json
is the right way of going about it.
(Note: I hacked index.js
to set command to this made it work fine:
command = addr + '\r\n'
Many thanks,
Andy
P.S. I've also enquired with the NZRS as to whether it should also respond to 'domain ' queries. :)
I am trying to fetch all whois data associated with a domain.
whois.lookup('google.com', { "verbose": true }, function(err, data){
if (err) throw err;
console.log(data);
console.log('-------------');
});
Even if I set verbose
to true
, the request is returning the minimal set of data.
Here is the response for google.com.
[ { server:
{ host: 'whois.verisign-grs.com',
query: 'DOMAIN $addr\r\n',
port: 43 },
data: ' Domain Name: GOOGLE.COM\r\n Registry Domain ID: 2138514_DOMAIN_COM-VRSN\r\n Registrar WHOIS Server: whois.markmonitor.com\r\n Registrar URL: http://www.markmonitor.com\r\n Updated Date: 2011-07-20T16:55:31Z\r\n Creation Date: 1997-09-15T04:00:00Z\r\n Registry Expiry Date: 2020-09-14T04:00:00Z\r\n Registrar: MarkMonitor Inc.\r\n Registrar IANA ID: 292\r\n Registrar Abuse Contact Email: [email protected]\r\n Registrar Abuse Contact Phone: +1.2083895740\r\n Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited\r\n Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited\r\n Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited\r\n Domain Status: serverDeleteProhibited https://icann.org/epp#serverDeleteProhibited\r\n Domain Status: serverTransferProhibited https://icann.org/epp#serverTransferProhibited\r\n Domain Status: serverUpdateProhibited https://icann.org/epp#serverUpdateProhibited\r\n Name Server: NS1.GOOGLE.COM\r\n Name Server: NS2.GOOGLE.COM\r\n Name Server: NS3.GOOGLE.COM\r\n Name Server: NS4.GOOGLE.COM\r\n DNSSEC: unsigned\r\n URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/\r\n>>> Last update of whois database: 2017-09-07T10:01:56Z <<<\r\n\r\nFor more information on Whois status codes, please visit https://icann.org/epp\r\n\r\nNOTICE: The expiration date displayed in this record is the date the\r\nregistrar\'s sponsorship of the domain name registration in the registry is\r\ncurrently set to expire. This date does not necessarily reflect the expiration\r\ndate of the domain name registrant\'s agreement with the sponsoring\r\nregistrar. Users may consult the sponsoring registrar\'s Whois database to\r\nview the registrar\'s reported date of expiration for this registration.\r\n\r\nTERMS OF USE: You are not authorized to access or query our Whois\r\ndatabase through the use of electronic processes that are high-volume and\r\nautomated except as reasonably necessary to register domain names or\r\nmodify existing registrations; the Data in VeriSign Global Registry\r\nServices\' ("VeriSign") Whois database is provided by VeriSign for\r\ninformation purposes only, and to assist persons in obtaining information\r\nabout or related to a domain name registration record. VeriSign does not\r\nguarantee its accuracy. By submitting a Whois query, you agree to abide\r\nby the following terms of use: You agree that you may use this Data only\r\nfor lawful purposes and that under no circumstances will you use this Data\r\nto: (1) allow, enable, or otherwise support the transmission of mass\r\nunsolicited, commercial advertising or solicitations via e-mail, telephone,\r\nor facsimile; or (2) enable high volume, automated, electronic processes\r\nthat apply to VeriSign (or its computer systems). The compilation,\r\nrepackaging, dissemination or other use of this Data is expressly\r\nprohibited without the prior written consent of VeriSign. You agree not to\r\nuse electronic processes that are automated and high-volume to access or\r\nquery the Whois database except as reasonably necessary to register\r\ndomain names or modify existing registrations. VeriSign reserves the right\r\nto restrict your access to the Whois database in its sole discretion to ensure\r\noperational stability. VeriSign may restrict or terminate your access to the\r\nWhois database for failure to abide by these terms of use. VeriSign\r\nreserves the right to modify these terms at any time.\r\n\r\nThe Registry database contains ONLY .COM, .NET, .EDU domains and\r\nRegistrars.\r\n' } ]
I want data for administrative/technical/registrant contact. I believe this module is able to return as I see it in the readme.
In several of cases when I query IPs/domains that belong to an organization with a name that contains accented Latin characters, these characters are not encoded properly.
I know the package uses utf-8 as the default encoding, but for some reason this issue only happens with accented Latin characters.
Example IP: 148.241.109.161
Expected output: Instituto Tecnológico y de Estudios Superiores de Monterrey
Received output: Instituto Tecnol�gico y de Estudios Superiores de Monterrey
When I hardcode socket.setEncoding('binary')
to your lib it actually fixes this issue, but then other unicode languages such as Chinese are not displayed correctly.
Is it possible to fix it? Or maybe even add an 'encoding' option, so I can pass a specific encoding in case the results contains unexpected characters.
Thanks
I'm running an identical script on a local server and a production server... I've checked and made sure of this, yet in production the return from the whois module is only containing the registrant name
field when locally I am getting way more fields. Are there any options I am missing?
Performing a whois on a .li domain (example: ward.li) return an error from the whois server if it is left to manually find the correct whois server. If you force it to use whois.nic.li you get a correct reply. It's odd because internally it looks like it is choosing that server itself.
I tried to use it on websites like cia.GOV, pcsteps.GR, etc. I guess it has an issue with TLDs. Can you fix it?
No error returned when using import in node project just a break that can not be caught.
this happens with ".ltd" domains, ie: "011gxk.ltd" a test on http://whois.nic.ltd/ shows it is working fine.
When using a proxy, the timeout option is not respected and certain errors (like ENOTFOUND ) are not getting thrown. The socket.setTimeout call is only getting made if a proxy isn't getting used. I think the setTimeout call could be moved to the _lookup function so it is always invoked.
I'm able to reproduce this on different machines on different networks:
coffee> whois = require 'node-whois'
{ lookup: [Function: lookup] }
coffee> whois.lookup('a 93', {server: {host: 'whois.arin.net'}}, console.log)
undefined
coffee> { [Error: connect ENOENT] code: 'ENOENT', errno: 'ENOENT', syscall: 'connect' }
Strangely it works with different queries, but with "a 93" I always get that error. Using the system whois client on the same machines gives the expected result:
$ whois -h whois.arin.net "a 93"
#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/whois_tou.html
#
#
# The following results may also be obtained via:
# http://whois.arin.net/rest/asns;q=93?showDetails=true&ext=netref2
#
ASNumber: 93
ASName: NTTA-93
ASHandle: AS93
RegDate: 2000-03-29
Updated: 2012-03-02
Ref: http://whois.arin.net/rest/asn/AS93
OrgName: NTT America, Inc.
OrgId: NTTAM-1
Address: 8300 E Maplewood Ave.
Address: Suite 400
City: Greenwood Village
StateProv: CO
PostalCode: 80111
Country: US
RegDate: 2005-12-08
Updated: 2011-10-18
Ref: http://whois.arin.net/rest/org/NTTAM-1
ReferralServer: rwhois://rwhois.gin.ntt.net:4321
OrgAbuseHandle: NAAC-ARIN
OrgAbuseName: NTT America Abuse Contact
OrgAbusePhone: +1-877-688-6625
OrgAbuseEmail: [email protected]
OrgAbuseRef: http://whois.arin.net/rest/poc/NAAC-ARIN
OrgNOCHandle: NASC-ARIN
OrgNOCName: NTT America Support Contact
OrgNOCPhone: +1-877-688-6625
OrgNOCEmail: [email protected]
OrgNOCRef: http://whois.arin.net/rest/poc/NASC-ARIN
OrgTechHandle: VIPAR-ARIN
OrgTechName: VIPAR
OrgTechPhone: +1-877-688-6625
OrgTechEmail: [email protected]
OrgTechRef: http://whois.arin.net/rest/poc/VIPAR-ARIN
RTechHandle: VIA4-ORG-ARIN
RTechName: VIPAR
RTechPhone: +1-877-688-6625
RTechEmail: [email protected]
RTechRef: http://whois.arin.net/rest/poc/VIA4-ORG-ARIN
#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/whois_tou.html
#
.global top domain is missing, Whois service is at whois.nic.global (https://www.iana.org/domains/root/db/global.html).
When I try to request IDN domains (I found the problem on .рф
domains and I don't know whether the problem exists on other IDN TLDs) I always get answer Invalid request
.
The problem is that your library sends domain name in Unicode (e.g. лицокнига.рф
) to whois server, but server waits for domain name in punycode (like XN--80AFOAJEQG5E.XN--P1AI
).
There is an error when query .digital domains using dynadot.com whois.
stack:"Error: getaddrinfo ENOTFOUND dynadot.com/whois dynadot.com/whois:43\n at errnoException (dns.js:50:10)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)"
But, when query using browser, it works.
Thanks
It seems that follow: 0
is the default. If I do whois.lookup('google.com', {follow: 0}, console.log)
I see the generic .com
whois lookup, that contains basically the whois server information, and a few relevant dates. If I do whois.lookup('google.com', {follow: 1}, console.log)
then I see the whois.markmonitor.com output, which is the actual google.com whois server.If I do whois.lookup('google.com', {follow: 2}, console.log)
(or any number greater than 1) then I get an empty string. It should never go beyond markmonitor though. I also think it'd make sense to default to a follow limit of 2 or 3, so you get the most detailed whois results back rather than the least detailed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.