Skip to content
This repository
Newer
Older
100644 203 lines (122 sloc) 8.158 kb
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
1 # Whois
c49b6f5d »
2009-07-23 Release Whois 0.1.0
2
6a4ee3ae »
2009-09-25 Updated the information in the README file
3 Whois is an intelligent pure Ruby WHOIS client and parser.
cf1f55ae »
2009-08-10 Improved documentation. Added Timeout section.
4
d0b985bf »
2010-08-18 Update features section
5 It is a OS-independent library and doesn't require external C libraries or Gems: it is a 100% Ruby software.
69496067 »
2009-07-26 Starting with some basic documentation
6
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
7 This software was developed to power [RoboDomain](http://www.robodomain.com) and, since July 2009, it ran more than thousands requests.
69496067 »
2009-07-26 Starting with some basic documentation
8
9 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.
10
11
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
12 ## Features
4cb5142a »
2009-08-08 Added feature list and expected roadmap
13
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
14 * Ability to query registry data for [IPv4, IPv6, TLDs, and domain names](http://www.ruby-whois.org/manual/usage.html#usage-objects)
15 * Ability to [parse WHOIS responses](http://www.ruby-whois.org/manual/parser.html)
16 * Flexible and extensible interface (e.g. You can define [custom servers](http://www.ruby-whois.org/manual/server.html) on the fly)
d0b985bf »
2010-08-18 Update features section
17 * Object oriented design, featuring 10 different design patterns
18 * Pure Ruby library, without any external dependency other than Ruby itself
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
19 * Compatible with [Ruby 1.8.7 and greater](http://www.ruby-whois.org/manual/installing.html#installation-requirements), including Ruby 1.9 branch
20 * Successfully tested against several [Ruby implementations](http://www.ruby-whois.org/manual/interpreters.html)
4cb5142a »
2009-08-08 Added feature list and expected roadmap
21
22
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
23 ## Requirements
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
24
afd063a3 »
2010-10-21 Minimum Ruby version is now 1.8.7
25 * Ruby >= 1.8.7
26
27 Whois >= 1.5 requires Ruby 1.8.7 or newer.
28 For older versions of Ruby, see the CHANGELOG.rdoc file.
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
29
f8156edc »
2010-09-09 More links. Delegate "Interpreters" details to the docs.
30 In addition to the standard Ruby interpreter (MRI),
31 Whois has been successfully tested against several
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
32 [Ruby implementations](http://www.ruby-whois.org/manual/interpreters.html).
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
33
34
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
35 ## Installation
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
36
0e5cf867 »
2009-12-01 Release Whois 0.9.0
37 This library is intended to be installed as a Gem.
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
38
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
39 $ gem install whois
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
40
41 You might need administrator privileges on your system to install it.
42
43
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
44 ## Upgrade
e959f0be »
2011-03-16 Add Upgrade information in the README.
45
46 Install the newer version via RubyGems.
47
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
48 $ gem install whois
e959f0be »
2011-03-16 Add Upgrade information in the README.
49
50 Minor and bugfix releases normally won't break backwards-compatibility. You can read the CHANGELOG.rdoc file to learn about the changes in each release.
51
14b0c988 »
2011-10-01 RDoc => MarkDown
52 Read the [Upgrading](http://www.ruby-whois.org/manual/upgrading.html) documentation page for detailed information about incompatible changes and further instructions.
e959f0be »
2011-03-16 Add Upgrade information in the README.
53
54
14b0c988 »
2011-10-01 RDoc => MarkDown
55 ## Getting Started
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
56
14b0c988 »
2011-10-01 RDoc => MarkDown
57 Note. This section covers only the essentials for getting started with the Whois library. The [documentation](http://www.ruby-whois.org/documentation.html) provides a more accurate explanation including tutorials, more examples and technical details about the client/server/record/parser architecture.
cf1f55ae »
2009-08-10 Improved documentation. Added Timeout section.
58
14b0c988 »
2011-10-01 RDoc => MarkDown
59 ### Querying the Server
6a4ee3ae »
2009-09-25 Updated the information in the README file
60
334801e5 »
2010-08-12 Added ability to query IANA for TLD WHOIS information. [aadlani]
61 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.
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
62
b369326d »
2010-01-26 Fix some errors in the README
63 Check out the following examples:
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
64
14b0c988 »
2011-10-01 RDoc => MarkDown
65 # Domain WHOIS
66 w = Whois::Client.new
67 w.query("google.com")
68 # => #<Whois::Record>
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
69
14b0c988 »
2011-10-01 RDoc => MarkDown
70 # TLD WHOIS
71 w = Whois::Client.new
72 w.query(".com")
73 # => #<Whois::Record>
334801e5 »
2010-08-12 Added ability to query IANA for TLD WHOIS information. [aadlani]
74
14b0c988 »
2011-10-01 RDoc => MarkDown
75 # IPv4 WHOIS
76 w = Whois::Client.new
77 w.query("74.125.67.100")
78 # => #<Whois::Record>
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
79
14b0c988 »
2011-10-01 RDoc => MarkDown
80 # IPv6 WHOIS
81 w = Whois::Client.new
82 w.query("2001:db8::1428:57ab")
83 # => #<Whois::Record>
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
84
85 The query method is stateless. For this reason, you can safely re-use the same client instance for multiple queries.
86
14b0c988 »
2011-10-01 RDoc => MarkDown
87 w = Whois::Client.new
334801e5 »
2010-08-12 Added ability to query IANA for TLD WHOIS information. [aadlani]
88 w.query("google.com")
89 w.query(".com")
90 w.query("74.125.67.100")
91 w.query("2001:db8::1428:57ab")
92 w.query("google.it")
93
14b0c988 »
2011-10-01 RDoc => MarkDown
94 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.
95
96 Whois.whois("google.com")
97 # => #<Whois::Record>
98
99 Did I mention you can even use blocks?
100
101 Whois::Client.new do |w|
102 w.query("google.com")
103 w.query(".com")
104 w.query("74.125.67.100")
105 w.query("2001:db8::1428:57ab")
106 w.query("google.it")
107 end
334801e5 »
2010-08-12 Added ability to query IANA for TLD WHOIS information. [aadlani]
108
14b0c988 »
2011-10-01 RDoc => MarkDown
109 ### Consuming the Record
6a4ee3ae »
2009-09-25 Updated the information in the README file
110
14b0c988 »
2011-10-01 RDoc => MarkDown
111 Any WHOIS query returns a {Whois::Record}. This object looks like a String, but it's way more powerful.
6a4ee3ae »
2009-09-25 Updated the information in the README file
112
14b0c988 »
2011-10-01 RDoc => MarkDown
113 {Whois::Record} encapsulates a WHOIS record and provides the ability to parse the WHOIS response programmatically, by using an object oriented syntax.
6a4ee3ae »
2009-09-25 Updated the information in the README file
114
14b0c988 »
2011-10-01 RDoc => MarkDown
115 r = Whois.whois("google.it")
116 # => #<Whois::Record>
6a4ee3ae »
2009-09-25 Updated the information in the README file
117
14b0c988 »
2011-10-01 RDoc => MarkDown
118 r.available?
119 # => false
120 r.registered?
121 # => true
6a4ee3ae »
2009-09-25 Updated the information in the README file
122
14b0c988 »
2011-10-01 RDoc => MarkDown
123 r.created_on
124 # => Fri Dec 10 00:00:00 +0100 1999
6a4ee3ae »
2009-09-25 Updated the information in the README file
125
14b0c988 »
2011-10-01 RDoc => MarkDown
126 t = r.technical_contact
127 # => #<Whois::Record::Contact>
128 t.id
129 # => "TS7016-ITNIC"
130 t.name
131 # => "Technical Services"
6a4ee3ae »
2009-09-25 Updated the information in the README file
132
14b0c988 »
2011-10-01 RDoc => MarkDown
133 r.nameservers.each do |nameserver|
134 puts nameserver
135 end
6a4ee3ae »
2009-09-25 Updated the information in the README file
136
14b0c988 »
2011-10-01 RDoc => MarkDown
137 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.
6a4ee3ae »
2009-09-25 Updated the information in the README file
138
139 If you create a new parser, please consider releasing it to the public so that it can be included in a next version.
140
14b0c988 »
2011-10-01 RDoc => MarkDown
141 ### Timeout
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
142
14b0c988 »
2011-10-01 RDoc => MarkDown
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.
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
144
14b0c988 »
2011-10-01 RDoc => MarkDown
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!
cf1f55ae »
2009-08-10 Improved documentation. Added Timeout section.
146
14b0c988 »
2011-10-01 RDoc => MarkDown
147 w = Whois::Client.new(:timeout => 10)
148 w.timeout # => 10
149 w.timeout = 5
150 w.timeout # => 5
cf1f55ae »
2009-08-10 Improved documentation. Added Timeout section.
151
14b0c988 »
2011-10-01 RDoc => MarkDown
152 w.query("google.com")
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
153
154
14b0c988 »
2011-10-01 RDoc => MarkDown
155 ## Acknowledgments
69496067 »
2009-07-26 Starting with some basic documentation
156
0a628258 »
2010-02-06 Removed Deprecated compatibility layer to Whois 0.4.2
157 First of all, I would like to express my most sincere thanks to Cyril Mougel, the author of the first Ruby Whois GEM that has been available since 2007. Cyril has been kind enough to yield me the privilege of using the RubyForge Whois project and the Whois package name to publish this library. To express all my gratitude, the release 0.5.0 and all sub sequential versions of the new Whois up to 0.9.x are 100% compatible with Cyril's Whois.
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
158
14b0c988 »
2011-10-01 RDoc => MarkDown
159 Whois is largely inspired by other notable Whois projects, most of all the Debian Whois library written and maintained by Marco D'Itri. Other good ideas and design decisions come from the PERL `Net::DRI` package.
69496067 »
2009-07-26 Starting with some basic documentation
160
161 I would lie if I say I'm completely unaware of the other Ruby Whois projects. Before starting this Ruby Whois library I deeply investigated the available resources and, despite none of them was a good candidate for a refactoring, some of them expose a really cool API.
162 They didn't directly influence this library or any design decision, but they have been a really interesting code-reading.
163
14b0c988 »
2011-10-01 RDoc => MarkDown
164 The parser architecture has been inspired by the [PHPWhois](http://phpwhois.sourceforge.net/) project. The authors puts lot of effort to create whois-specific parsers normalizing the different responses in a single tree-based structure. So far, this is the only one open source project that offers such this feature in all the programming language ecosystem.
69496067 »
2009-07-26 Starting with some basic documentation
165
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
166 Despite I spent weeks reading source code from the available whois libraries, Ruby Whois has been built from scratch trying to focus on long-term maintainability and flexibility and cannot be considered a Ruby port of any of other existing Whois libraries.
167
168
14b0c988 »
2011-10-01 RDoc => MarkDown
169 ## Author
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
170
14b0c988 »
2011-10-01 RDoc => MarkDown
171 Author: [Simone Carletti](http://www.simonecarletti.com/) <weppos@weppos.net>
fd2a150c »
2009-11-27 Give to Caesar what is Caesar's
172
173
14b0c988 »
2011-10-01 RDoc => MarkDown
174 ## Thanks to
fd2a150c »
2009-11-27 Give to Caesar what is Caesar's
175
14b0c988 »
2011-10-01 RDoc => MarkDown
176 Everyone [in this list](http://github.com/weppos/whois/contributors).
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
177
178
14b0c988 »
2011-10-01 RDoc => MarkDown
179 ## FeedBack and Bug reports
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
180
14b0c988 »
2011-10-01 RDoc => MarkDown
181 If you use this library and find yourself missing any functionality I have missed, please [let me know](mailto:weppos@weppos.net).
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
182
14b0c988 »
2011-10-01 RDoc => MarkDown
183 Bug reports and Feature suggestions [are welcomed](http://github.com/weppos/whois/issues).
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
184
185
14b0c988 »
2011-10-01 RDoc => MarkDown
186 ## More
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
187
14b0c988 »
2011-10-01 RDoc => MarkDown
188 * [Homepage](http://www.ruby-whois.org/)
189 * [Repository](http://github.com/weppos/whois)
190 * [Documentation](http://www.ruby-whois.org/documentation.html) - The official documentation, see also the [API Documentation](/api).
191 * [Discussion Group](http://groups.google.com/group/ruby-whois)
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
192
193
14b0c988 »
2011-10-01 RDoc => MarkDown
194 ## Changelog
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
195
196 See the CHANGELOG.rdoc file for details.
197
198
14b0c988 »
2011-10-01 RDoc => MarkDown
199 ## License
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
200
14b0c988 »
2011-10-01 RDoc => MarkDown
201 _Whois_ is copyright (c) 2009-2011 Simone Carletti.
202 This is Free Software distributed under the MIT license.
Something went wrong with that request. Please try again.