whois 3.4.2 → 3.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/README.md +91 -107
- data/bin/ruby-whois +2 -2
- data/data/tld.json +4 -4
- data/lib/whois/record/parser/base_cocca2.rb +1 -1
- data/lib/whois/record/parser/{whois.nic.cc.rb → base_verisign.rb} +23 -11
- data/lib/whois/record/parser/ccwhois.verisign-grs.com.rb +27 -0
- data/lib/whois/record/parser/jobswhois.verisign-grs.com.rb +2 -75
- data/lib/whois/record/parser/whois.hkirc.hk.rb +1 -1
- data/lib/whois/record/parser/whois.markmonitor.com.rb +5 -94
- data/lib/whois/record/parser/whois.nic.af.rb +0 -6
- data/lib/whois/record/parser/whois.nic.cd.rb +6 -0
- data/lib/whois/record/parser/whois.nic.dz.rb +3 -7
- data/lib/whois/record/parser/whois.nic.gl.rb +2 -2
- data/lib/whois/record/parser/whois.nic.gs.rb +6 -0
- data/lib/whois/record/parser/whois.nic.mu.rb +6 -0
- data/lib/whois/record/parser/whois.nic.name.rb +1 -1
- data/lib/whois/record/parser/whois.nic.net.ng.rb +6 -0
- data/lib/whois/record/parser/whois.nic.net.sb.rb +6 -0
- data/lib/whois/record/parser/whois.nic.tv.rb +6 -68
- data/lib/whois/record/parser/whois.pnina.ps.rb +8 -8
- data/lib/whois/record/parser/whois.rotld.ro.rb +3 -3
- data/lib/whois/record/parser/whois.tld.sy.rb +6 -0
- data/lib/whois/record/parser/whois.usp.ac.fj.rb +3 -2
- data/lib/whois/record/parser/whois.verisign-grs.com.rb +46 -0
- data/lib/whois/record/parser/{whois.samoanic.ws.rb → whois.website.ws.rb} +8 -10
- data/lib/whois/version.rb +1 -1
- data/whois.gemspec +5 -5
- metadata +7 -6
- data/lib/whois/record/parser/whois.crsnic.net.rb +0 -112
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d440fc4c1d38dd789676e9476281c9ac1597400
|
4
|
+
data.tar.gz: 329897f66061372ff1f9c2531ac9f859fa03a71e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 044f5336675cca6b663858f6f7580d93171accec1ef8c3185106b9e273b23c489d3d1a7bbd35c3c75e1013bc8230bbe8dfe7c28fab9347a7ebdae030048756a0
|
7
|
+
data.tar.gz: 2cccf7d7e509d0880be5be2318556a6868e07fb5d00153475bf03d360210e947757fca80cc7abef01c12630346563e78c5c27f9fb336fcdad0b09688cd886264
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,29 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
|
4
|
+
## Release 3.4.3
|
5
|
+
|
6
|
+
- SERVER: Updated .COM, .NET, .CC, .WS TLD definitions.
|
7
|
+
|
8
|
+
- FIXED: .HK domains not correctly identified as available (GH-290).
|
9
|
+
|
10
|
+
- CHANGED: Updated whois.nic.tv parser to the new response format (GH-283).
|
11
|
+
|
12
|
+
- CHANGED: Updated Verisign parsers, extract common parser.
|
13
|
+
|
14
|
+
- CHANGED: Updated whois.markmonitor.com parser to the new response format.
|
15
|
+
|
16
|
+
- CHANGED: Updated Cocca parsers to the new response format (GH-291).
|
17
|
+
|
18
|
+
- CHANGED: Updated whois.nic.dz parser to the new response format.
|
19
|
+
|
20
|
+
- CHANGED: Updated whois.rotld.ro parser to the new response format.
|
21
|
+
|
22
|
+
- CHANGED: Updated whois.pnina.ps parser to the new response format.
|
23
|
+
|
24
|
+
- CHANGED: Updated whois.nic.gl parser to the new response format.
|
25
|
+
|
26
|
+
|
4
27
|
## Release 3.4.2
|
5
28
|
|
6
29
|
- CHANGED: Updated whois.registry.net.za parser to the new response format.
|
data/README.md
CHANGED
@@ -1,23 +1,19 @@
|
|
1
1
|
# Whois
|
2
2
|
|
3
|
-
|
3
|
+
<tt>Whois</tt> is an intelligent pure Ruby WHOIS client and parser.
|
4
4
|
|
5
5
|
[![Build Status](https://secure.travis-ci.org/weppos/whois.png)](http://travis-ci.org/weppos/whois)
|
6
6
|
|
7
|
-
|
7
|
+
<tt>Whois</tt> is a OS-independent library and doesn't require any external binaries or C libraries: it is a 100% Ruby software.
|
8
8
|
|
9
|
-
This library was
|
9
|
+
This library was created to power [RoboWhois](https://www.robowhois.com/) and [RoboDomain](https://www.robodomain.com/). It has been performing queries in production since July 2009.
|
10
10
|
|
11
|
-
An extensive test suite is available to verify the library correctness but you must be aware that registrant might change WHOIS interfaces without notice and at any time causing queries to specific hosts to stop working.
|
12
11
|
|
12
|
+
## Donate a coffee
|
13
13
|
|
14
|
-
|
14
|
+
<p id="pledgie" class="alignright"><a href="https://pledgie.com/campaigns/11383"><img alt="Click here to lend your support to: whois and make a donation at pledgie.com !" src="https://pledgie.com/campaigns/11383.png?skin_name=chrome" border="0" style="max-width:100%;"></a></p>
|
15
15
|
|
16
|
-
[
|
17
|
-
|
18
|
-
<a href='https://pledgie.com/campaigns/11383'><img alt='Click here to lend your support to: whois and make a donation at pledgie.com !' src='https://pledgie.com/campaigns/11383.png?skin_name=chrome' border='0' ></a>
|
19
|
-
|
20
|
-
*Whois* is free software, but it costs money to write, test, and distribute it. You can support the development by sending a donation. **Any amount, even $5, is greatly appreciated**.
|
16
|
+
<tt>Whois</tt> is free software, but it requires a lot of coffee to write, test, and distribute it. You can support the development by [donating a coffee](https://pledgie.com/campaigns/11383).
|
21
17
|
|
22
18
|
|
23
19
|
## Features
|
@@ -34,75 +30,79 @@ An extensive test suite is available to verify the library correctness but you m
|
|
34
30
|
|
35
31
|
* Ruby >= 1.9.2
|
36
32
|
|
37
|
-
For older versions of Ruby, see the [CHANGELOG](CHANGELOG.md)
|
33
|
+
For older versions of Ruby, see the [CHANGELOG](CHANGELOG.md).
|
38
34
|
|
39
|
-
In addition to the standard Ruby interpreter (MRI),
|
40
|
-
Whois has been successfully tested against several
|
41
|
-
[Ruby implementations](http://www.ruby-whois.org/manual/interpreters/).
|
42
35
|
|
36
|
+
## Install
|
43
37
|
|
44
|
-
|
45
|
-
|
46
|
-
The best way to install *Whois* is via [RubyGems](https://rubygems.org/).
|
38
|
+
The best way to install <tt>Whois</tt> is via [RubyGems](https://rubygems.org/) - [Learn more](http://www.ruby-whois.org/manual/installing/)
|
47
39
|
|
48
40
|
$ gem install whois
|
49
41
|
|
50
|
-
|
42
|
+
For more details visit the [installation page](/manual/installing/).
|
51
43
|
|
52
44
|
|
53
45
|
## Getting Started
|
54
46
|
|
55
47
|
Note. This section covers only the essentials for getting started with the Whois library. The [documentation](http://www.ruby-whois.org/documentation/) provides a more accurate explanation including tutorials, more examples and technical details about the client/server/record/parser architecture.
|
56
48
|
|
57
|
-
### Querying
|
49
|
+
### Querying a WHOIS
|
58
50
|
|
59
|
-
Whois provides the ability to get WHOIS information for TLD, domain names, IPv4 and IPv6 addresses. The client is smart enough to guess the best WHOIS server according to given query, send the request and return the response.
|
51
|
+
<tt>Whois</tt> provides the ability to get WHOIS information for TLD, domain names, IPv4 and IPv6 addresses. The client is smart enough to guess the best WHOIS server according to given query, send the request and return the response.
|
60
52
|
|
61
53
|
Check out the following examples:
|
62
54
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
55
|
+
```ruby
|
56
|
+
# Domain WHOIS
|
57
|
+
w = Whois::Client.new
|
58
|
+
w.lookup("google.com")
|
59
|
+
# => #<Whois::Record>
|
67
60
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
61
|
+
# TLD WHOIS
|
62
|
+
w = Whois::Client.new
|
63
|
+
w.lookup(".com")
|
64
|
+
# => #<Whois::Record>
|
72
65
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
66
|
+
# IPv4 WHOIS
|
67
|
+
w = Whois::Client.new
|
68
|
+
w.lookup("74.125.67.100")
|
69
|
+
# => #<Whois::Record>
|
77
70
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
71
|
+
# IPv6 WHOIS
|
72
|
+
w = Whois::Client.new
|
73
|
+
w.lookup("2001:db8::1428:57ab")
|
74
|
+
# => #<Whois::Record>
|
75
|
+
```
|
82
76
|
|
83
77
|
The query method is stateless. For this reason, you can safely re-use the same client instance for multiple queries.
|
84
78
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
79
|
+
```ruby
|
80
|
+
w = Whois::Client.new
|
81
|
+
w.lookup("google.com")
|
82
|
+
w.lookup(".com")
|
83
|
+
w.lookup("74.125.67.100")
|
84
|
+
w.lookup("2001:db8::1428:57ab")
|
85
|
+
w.lookup("google.it")
|
86
|
+
```
|
91
87
|
|
92
|
-
If you just need a WHOIS response and you don't care about a full control of the WHOIS client, the
|
88
|
+
If you just need a WHOIS response and you don't care about a full control of the WHOIS client, the `Whois` module provides an all-in-one method called `Whois.whois`. This is the simplest way to send a WHOIS request.
|
93
89
|
|
94
|
-
|
95
|
-
|
90
|
+
```ruby
|
91
|
+
Whois.whois("google.com")
|
92
|
+
# => #<Whois::Record>
|
93
|
+
```
|
96
94
|
|
97
95
|
Did I mention you can even use blocks?
|
98
96
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
97
|
+
```ruby
|
98
|
+
Whois::Client.new do |w|
|
99
|
+
w.lookup("google.com")
|
100
|
+
w.lookup(".com")
|
101
|
+
w.lookup("74.125.67.100")
|
102
|
+
w.lookup("2001:db8::1428:57ab")
|
103
|
+
w.lookup("google.it")
|
104
|
+
end
|
105
|
+
```
|
106
106
|
|
107
107
|
### Consuming the Record
|
108
108
|
|
@@ -110,86 +110,70 @@ Any WHOIS query returns a `Whois::Record`. This object looks like a String, but
|
|
110
110
|
|
111
111
|
`Whois::Record` encapsulates a WHOIS record and provides the ability to parse the WHOIS response programmatically, by using an object oriented syntax.
|
112
112
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
r.available?
|
117
|
-
# => false
|
118
|
-
r.registered?
|
119
|
-
# => true
|
120
|
-
|
121
|
-
r.created_on
|
122
|
-
# => Fri Dec 10 00:00:00 +0100 1999
|
123
|
-
|
124
|
-
t = r.technical_contact
|
125
|
-
# => #<Whois::Record::Contact>
|
126
|
-
t.id
|
127
|
-
# => "TS7016-ITNIC"
|
128
|
-
t.name
|
129
|
-
# => "Technical Services"
|
130
|
-
|
131
|
-
r.nameservers.each do |nameserver|
|
132
|
-
puts nameserver
|
133
|
-
end
|
134
|
-
|
135
|
-
This feature is made possible by the *Whois* record parsers. Unfortunately, due to the lack of a global standard, each WHOIS server requires a specific parser. For this reason, the library doesn't support all existing WHOIS servers.
|
136
|
-
|
137
|
-
If you create a new parser, please consider releasing it to the public so that it can be included in a next version.
|
113
|
+
```ruby
|
114
|
+
r = Whois.whois("google.it")
|
115
|
+
# => #<Whois::Record>
|
138
116
|
|
139
|
-
|
117
|
+
r.available?
|
118
|
+
# => false
|
119
|
+
r.registered?
|
120
|
+
# => true
|
140
121
|
|
141
|
-
|
122
|
+
r.created_on
|
123
|
+
# => Fri Dec 10 00:00:00 +0100 1999
|
142
124
|
|
143
|
-
|
125
|
+
t = r.technical_contact
|
126
|
+
# => #<Whois::Record::Contact>
|
127
|
+
t.id
|
128
|
+
# => "TS7016-ITNIC"
|
129
|
+
t.name
|
130
|
+
# => "Technical Services"
|
144
131
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
w.lookup("google.com")
|
132
|
+
r.nameservers.each do |nameserver|
|
133
|
+
puts nameserver
|
134
|
+
end
|
135
|
+
```
|
151
136
|
|
137
|
+
This feature is made possible by the <tt>Whois</tt> record parsers. Unfortunately, due to the lack of a global standard, each WHOIS server requires a specific parser. For this reason, the library doesn't support all existing WHOIS servers.
|
152
138
|
|
153
|
-
|
139
|
+
If you create a new parser, please consider releasing it to the public so that it can be included in a next version.
|
154
140
|
|
155
|
-
|
141
|
+
### Timeout
|
156
142
|
|
157
|
-
|
143
|
+
By default, each query run though the client has a timeout value of 5 seconds. If the execution exceeds timeout limit, the client raises a `Timeout::Error` exception.
|
158
144
|
|
159
|
-
|
160
|
-
They didn't directly influence this library or any design decision, but they have been a really interesting code-reading.
|
145
|
+
Off course, you can customize the timeout value setting a different value. If timeout is `nil`, the client will until the response is sent back from the server or the process is killed. Don't disable the timeout unless you really know you are doing!
|
161
146
|
|
162
|
-
|
147
|
+
```ruby
|
148
|
+
w = Whois::Client.new(:timeout => 10)
|
149
|
+
w.timeout # => 10
|
150
|
+
w.timeout = 5
|
151
|
+
w.timeout # => 5
|
163
152
|
|
164
|
-
|
153
|
+
w.lookup("google.com")
|
154
|
+
```
|
165
155
|
|
166
156
|
|
167
157
|
## Credits
|
168
158
|
|
169
|
-
|
170
|
-
- [Contributors](https://github.com/weppos/whois/contributors)
|
159
|
+
<tt>Whois</tt> was created and is maintained by [Simone Carletti](http://www.simonecarletti.com/). Many improvements and bugfixes were contributed by the [open source community](https://github.com/weppos/whois/graphs/contributors).
|
171
160
|
|
172
161
|
|
173
|
-
##
|
162
|
+
## Contributing
|
174
163
|
|
175
|
-
Direct questions and discussions to
|
164
|
+
Direct questions and discussions to [Stack Overflow](http://stackoverflow.com/questions/tagged/whois-ruby).
|
176
165
|
|
177
|
-
Pull requests are very welcome! Please include spec and/or feature coverage for every patch, and create a topic branch for every separate change you make.
|
166
|
+
[Pull requests](https://github.com/weppos/whois/pulls) are very welcome! Please include spec and/or feature coverage for every patch, and create a topic branch for every separate change you make.
|
178
167
|
|
179
168
|
Report issues or feature requests to [GitHub Issues](https://github.com/weppos/whois/issues).
|
180
169
|
|
181
170
|
|
182
|
-
## More
|
171
|
+
## More Information
|
183
172
|
|
184
173
|
- [Homepage](http://www.ruby-whois.org/)
|
185
|
-
- [
|
186
|
-
- [
|
187
|
-
- [
|
188
|
-
|
189
|
-
|
190
|
-
## Changelog
|
191
|
-
|
192
|
-
See the [CHANGELOG](CHANGELOG.md) file for details.
|
174
|
+
- [RubyGems](https://rubygems.org/gems/whois)
|
175
|
+
- [Issues](https://github.com/weppos/whois)
|
176
|
+
- [Stack Overflow](http://stackoverflow.com/questions/tagged/whois-ruby)
|
193
177
|
|
194
178
|
|
195
179
|
## License
|
data/bin/ruby-whois
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/bin/env ruby -
|
1
|
+
#!/usr/bin/env ruby -w
|
2
2
|
|
3
3
|
$:.unshift(File.expand_path("../../lib", __FILE__))
|
4
4
|
|
@@ -59,6 +59,6 @@ begin
|
|
59
59
|
puts @client.lookup(object)
|
60
60
|
rescue Whois::Error => e
|
61
61
|
abort(e.message)
|
62
|
-
rescue Timeout::Error
|
62
|
+
rescue Timeout::Error
|
63
63
|
abort("Request Timeout")
|
64
64
|
end
|
data/data/tld.json
CHANGED
@@ -78,14 +78,14 @@
|
|
78
78
|
"host": "whois.centralnic.com"
|
79
79
|
},
|
80
80
|
".com": {
|
81
|
-
"host": "whois.
|
81
|
+
"host": "whois.verisign-grs.com",
|
82
82
|
"adapter": "verisign"
|
83
83
|
},
|
84
84
|
".za.net": {
|
85
85
|
"host": "whois.za.net"
|
86
86
|
},
|
87
87
|
".net": {
|
88
|
-
"host": "whois.
|
88
|
+
"host": "whois.verisign-grs.com",
|
89
89
|
"adapter": "verisign"
|
90
90
|
},
|
91
91
|
".eu.org": {
|
@@ -312,7 +312,7 @@
|
|
312
312
|
"host": "whois.cira.ca"
|
313
313
|
},
|
314
314
|
".cc": {
|
315
|
-
"host": "
|
315
|
+
"host": "ccwhois.verisign-grs.com",
|
316
316
|
"adapter": "verisign"
|
317
317
|
},
|
318
318
|
".cd": {
|
@@ -1152,7 +1152,7 @@
|
|
1152
1152
|
"host": "whois.nic.fr"
|
1153
1153
|
},
|
1154
1154
|
".ws": {
|
1155
|
-
"host": "whois.
|
1155
|
+
"host": "whois.website.ws"
|
1156
1156
|
},
|
1157
1157
|
".xxx": {
|
1158
1158
|
"host": "whois.nic.xxx"
|
@@ -15,8 +15,7 @@ module Whois
|
|
15
15
|
class Record
|
16
16
|
class Parser
|
17
17
|
|
18
|
-
|
19
|
-
class WhoisNicCc < Base
|
18
|
+
class BaseVerisign < Base
|
20
19
|
include Scanners::Scannable
|
21
20
|
|
22
21
|
self.scanner = Scanners::Verisign
|
@@ -37,11 +36,16 @@ module Whois
|
|
37
36
|
|
38
37
|
|
39
38
|
property_supported :status do
|
40
|
-
node("
|
39
|
+
# node("Status")
|
40
|
+
if available?
|
41
|
+
:available
|
42
|
+
else
|
43
|
+
:registered
|
44
|
+
end
|
41
45
|
end
|
42
46
|
|
43
47
|
property_supported :available? do
|
44
|
-
|
48
|
+
!!(content_for_scanner =~ /^No match for/)
|
45
49
|
end
|
46
50
|
|
47
51
|
property_supported :registered? do
|
@@ -65,10 +69,9 @@ module Whois
|
|
65
69
|
property_supported :registrar do
|
66
70
|
node("Sponsoring Registrar") do |value|
|
67
71
|
Whois::Record::Registrar.new(
|
68
|
-
:
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:url => referral_url
|
72
|
+
id: last_useful_item(node("Sponsoring Registrar IANA ID")),
|
73
|
+
name: last_useful_item(value),
|
74
|
+
url: referral_url
|
72
75
|
)
|
73
76
|
end
|
74
77
|
end
|
@@ -76,7 +79,7 @@ module Whois
|
|
76
79
|
|
77
80
|
property_supported :nameservers do
|
78
81
|
Array.wrap(node("Name Server")).reject { |value| value =~ /no nameserver/i }.map do |name|
|
79
|
-
|
82
|
+
Nameserver.new(name: name.downcase)
|
80
83
|
end
|
81
84
|
end
|
82
85
|
|
@@ -86,11 +89,20 @@ module Whois
|
|
86
89
|
end
|
87
90
|
|
88
91
|
def referral_url
|
89
|
-
node("Referral URL")
|
92
|
+
last_useful_item(node("Referral URL"))
|
93
|
+
end
|
94
|
+
|
95
|
+
|
96
|
+
private
|
97
|
+
|
98
|
+
# In case of "SPAM Response", the response contains more than one item
|
99
|
+
# for the same value and the value becomes an Array.
|
100
|
+
def last_useful_item(values)
|
101
|
+
values.is_a?(Array) ? values.last : values
|
90
102
|
end
|
91
103
|
|
92
104
|
end
|
93
105
|
|
94
106
|
end
|
95
107
|
end
|
96
|
-
end
|
108
|
+
end
|