Skip to content
This repository
Newer
Older
100644 210 lines (126 sloc) 8.97 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
67196a8b »
2011-12-22 Update README.md
3 *Whois* is an intelligent pure Ruby WHOIS client and parser.
cf1f55ae »
2009-08-10 Improved documentation. Added Timeout section.
4
c8af3e1b »
2011-12-22 Add build status.
5 [![Build Status](https://secure.travis-ci.org/weppos/whois.png)](http://travis-ci.org/weppos/whois)
6
67196a8b »
2011-12-22 Update README.md
7 *Whois* is a OS-independent library and doesn't require any external binaries or C libraries: it is a 100% Ruby software.
69496067 »
2009-07-26 Starting with some basic documentation
8
1c515d0a »
2012-09-19 RoboWhois is now HTTPS
9 This library was developed to power [RoboWhois](https://www.robowhois.com/) and [RoboDomain](https://www.robodomain.com/). It has been performing queries in production since July 2009.
69496067 »
2009-07-26 Starting with some basic documentation
10
67196a8b »
2011-12-22 Update README.md
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.
69496067 »
2009-07-26 Starting with some basic documentation
12
13
235a703e »
2012-06-27 Move donations section at the top.
14 ## Donations
15
16 [Support Whois at Pledgie](http://www.pledgie.com/campaigns/11383).
17
18 <a href='http://www.pledgie.com/campaigns/11383'><img alt='Click here to lend your support to: whois and make a donation at www.pledgie.com !' src='http://www.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**.
21
22
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
23 ## Features
4cb5142a »
2009-08-08 Added feature list and expected roadmap
24
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
25 * Ability to query registry data for [IPv4, IPv6, TLDs, and domain names](http://www.ruby-whois.org/manual/usage.html#usage-objects)
26 * Ability to [parse WHOIS responses](http://www.ruby-whois.org/manual/parser.html)
27 * 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
28 * Object oriented design, featuring 10 different design patterns
29 * 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)
30 * Compatible with [Ruby 1.8.7 and greater](http://www.ruby-whois.org/manual/installing.html#installation-requirements), including Ruby 1.9 branch
31 * Successfully tested against several [Ruby implementations](http://www.ruby-whois.org/manual/interpreters.html)
4cb5142a »
2009-08-08 Added feature list and expected roadmap
32
33
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
34 ## Requirements
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
35
afd063a3 »
2010-10-21 Minimum Ruby version is now 1.8.7
36 * Ruby >= 1.8.7
37
67196a8b »
2011-12-22 Update README.md
38 *Whois* >= 1.5 requires Ruby 1.8.7 or newer.
afd063a3 »
2010-10-21 Minimum Ruby version is now 1.8.7
39 For older versions of Ruby, see the CHANGELOG.rdoc file.
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
40
f8156edc »
2010-09-09 More links. Delegate "Interpreters" details to the docs.
41 In addition to the standard Ruby interpreter (MRI),
42 Whois has been successfully tested against several
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
43 [Ruby implementations](http://www.ruby-whois.org/manual/interpreters.html).
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
44
45
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
46 ## Installation
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
47
5446f485 »
2011-12-24 Standardize README
48 The best way to install *Whois* is via [RubyGems](https://rubygems.org/).
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
49
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
50 $ gem install whois
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
51
5446f485 »
2011-12-24 Standardize README
52 You might need administrator privileges on your system to install the gem.
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
53
54
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
55 ## Upgrade
e959f0be »
2011-03-16 Add Upgrade information in the README.
56
57 Install the newer version via RubyGems.
58
ae631041 »
2011-10-01 whois.nic.ki parser must support `Delegated' status (closes #119)
59 $ gem install whois
e959f0be »
2011-03-16 Add Upgrade information in the README.
60
826d25b7 »
2012-03-06 Add donations section.
61 Minor and bugfix releases normally won't break backwards-compatibility. You can read the CHANGELOG.md file to learn about the changes in each release.
e959f0be »
2011-03-16 Add Upgrade information in the README.
62
14b0c988 »
2011-10-01 RDoc => MarkDown
63 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.
64
65
14b0c988 »
2011-10-01 RDoc => MarkDown
66 ## Getting Started
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
67
14b0c988 »
2011-10-01 RDoc => MarkDown
68 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.
69
14b0c988 »
2011-10-01 RDoc => MarkDown
70 ### Querying the Server
6a4ee3ae »
2009-09-25 Updated the information in the README file
71
334801e5 »
2010-08-12 Added ability to query IANA for TLD WHOIS information. [aadlani]
72 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.
73
b369326d » soult
2010-01-26 Fix some errors in the README
74 Check out the following examples:
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
75
14b0c988 »
2011-10-01 RDoc => MarkDown
76 # Domain WHOIS
77 w = Whois::Client.new
78 w.query("google.com")
79 # => #<Whois::Record>
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
80
14b0c988 »
2011-10-01 RDoc => MarkDown
81 # TLD WHOIS
82 w = Whois::Client.new
83 w.query(".com")
84 # => #<Whois::Record>
334801e5 »
2010-08-12 Added ability to query IANA for TLD WHOIS information. [aadlani]
85
14b0c988 »
2011-10-01 RDoc => MarkDown
86 # IPv4 WHOIS
87 w = Whois::Client.new
88 w.query("74.125.67.100")
89 # => #<Whois::Record>
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
90
14b0c988 »
2011-10-01 RDoc => MarkDown
91 # IPv6 WHOIS
92 w = Whois::Client.new
93 w.query("2001:db8::1428:57ab")
94 # => #<Whois::Record>
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
95
96 The query method is stateless. For this reason, you can safely re-use the same client instance for multiple queries.
97
14b0c988 »
2011-10-01 RDoc => MarkDown
98 w = Whois::Client.new
334801e5 »
2010-08-12 Added ability to query IANA for TLD WHOIS information. [aadlani]
99 w.query("google.com")
100 w.query(".com")
101 w.query("74.125.67.100")
102 w.query("2001:db8::1428:57ab")
103 w.query("google.it")
104
14b0c988 »
2011-10-01 RDoc => MarkDown
105 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.
106
107 Whois.whois("google.com")
108 # => #<Whois::Record>
109
110 Did I mention you can even use blocks?
111
112 Whois::Client.new do |w|
113 w.query("google.com")
114 w.query(".com")
115 w.query("74.125.67.100")
116 w.query("2001:db8::1428:57ab")
117 w.query("google.it")
118 end
334801e5 »
2010-08-12 Added ability to query IANA for TLD WHOIS information. [aadlani]
119
14b0c988 »
2011-10-01 RDoc => MarkDown
120 ### Consuming the Record
6a4ee3ae »
2009-09-25 Updated the information in the README file
121
826d25b7 »
2012-03-06 Add donations section.
122 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
123
826d25b7 »
2012-03-06 Add donations section.
124 `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
125
14b0c988 »
2011-10-01 RDoc => MarkDown
126 r = Whois.whois("google.it")
127 # => #<Whois::Record>
6a4ee3ae »
2009-09-25 Updated the information in the README file
128
14b0c988 »
2011-10-01 RDoc => MarkDown
129 r.available?
130 # => false
131 r.registered?
132 # => true
6a4ee3ae »
2009-09-25 Updated the information in the README file
133
14b0c988 »
2011-10-01 RDoc => MarkDown
134 r.created_on
135 # => Fri Dec 10 00:00:00 +0100 1999
6a4ee3ae »
2009-09-25 Updated the information in the README file
136
14b0c988 »
2011-10-01 RDoc => MarkDown
137 t = r.technical_contact
138 # => #<Whois::Record::Contact>
139 t.id
140 # => "TS7016-ITNIC"
141 t.name
142 # => "Technical Services"
6a4ee3ae »
2009-09-25 Updated the information in the README file
143
14b0c988 »
2011-10-01 RDoc => MarkDown
144 r.nameservers.each do |nameserver|
145 puts nameserver
146 end
6a4ee3ae »
2009-09-25 Updated the information in the README file
147
67196a8b »
2011-12-22 Update README.md
148 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
149
150 If you create a new parser, please consider releasing it to the public so that it can be included in a next version.
151
14b0c988 »
2011-10-01 RDoc => MarkDown
152 ### Timeout
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
153
826d25b7 »
2012-03-06 Add donations section.
154 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.
155
14b0c988 »
2011-10-01 RDoc => MarkDown
156 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.
157
14b0c988 »
2011-10-01 RDoc => MarkDown
158 w = Whois::Client.new(:timeout => 10)
159 w.timeout # => 10
160 w.timeout = 5
161 w.timeout # => 5
cf1f55ae »
2009-08-10 Improved documentation. Added Timeout section.
162
14b0c988 »
2011-10-01 RDoc => MarkDown
163 w.query("google.com")
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
164
165
14b0c988 »
2011-10-01 RDoc => MarkDown
166 ## Acknowledgments
69496067 »
2009-07-26 Starting with some basic documentation
167
67196a8b »
2011-12-22 Update README.md
168 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.
169
14b0c988 »
2011-10-01 RDoc => MarkDown
170 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
171
172 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.
173 They didn't directly influence this library or any design decision, but they have been a really interesting code-reading.
174
14b0c988 »
2011-10-01 RDoc => MarkDown
175 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
176
67196a8b »
2011-12-22 Update README.md
177 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.
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
178
179
826d25b7 »
2012-03-06 Add donations section.
180 ## Credits
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
181
826d25b7 »
2012-03-06 Add donations section.
182 - [Simone Carletti](http://www.simonecarletti.com/) <weppos@weppos.net> - Author
183 - [Contributors](https://github.com/weppos/whois/contributors)
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
184
185
67196a8b »
2011-12-22 Update README.md
186 ## Contribute
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
187
67196a8b »
2011-12-22 Update README.md
188 Direct questions and discussions to the [mailing list](http://groups.google.com/group/ruby-whois).
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
189
67196a8b »
2011-12-22 Update README.md
190 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.
191
192 Report issues or feature requests to [GitHub Issues](https://github.com/weppos/whois/issues).
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
193
194
14b0c988 »
2011-10-01 RDoc => MarkDown
195 ## More
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
196
826d25b7 »
2012-03-06 Add donations section.
197 - [Homepage](http://www.ruby-whois.org/)
198 - [Repository](https://github.com/weppos/whois)
2e3a4d05 »
2012-03-06 Fix link to /api
199 - [Documentation](http://www.ruby-whois.org/documentation.html) - The official documentation, see also the [API Documentation](http://www.ruby-whois.org/api).
826d25b7 »
2012-03-06 Add donations section.
200 - [Discussion Group](http://groups.google.com/group/ruby-whois)
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
201
202
14b0c988 »
2011-10-01 RDoc => MarkDown
203 ## Changelog
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
204
b8df0433 »
2012-05-23 Add link to CHANGELOG.md file
205 See the [CHANGELOG](CHANGELOG.md) file for details.
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
206
207
14b0c988 »
2011-10-01 RDoc => MarkDown
208 ## License
44d4a24f »
2009-08-06 Initial documentation including information about the old Whois library.
209
8ca88114 »
2012-06-27 Change YARD `@api internal` to `@api private` to trigger "private api…
210 Copyright (c) 2009-2012 Simone Carletti. This is Free Software distributed under the MIT license.
Something went wrong with that request. Please try again.