Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support for Non-Deep querying #112

Merged
merged 9 commits into from

3 participants

@Redth

I would like to be able to not parse the secondary whois server.

In the case of a .com domain, the first query almost always contains all the info I want. I'd like this query to get parsed into a Whois::Record and then I can decide whether or not I need to do a secondary query for more info.

@jaygen

+1, in some cases (ie when you have been blocked by the secondary server) querying the secondary server causes you to lose data from the primary result.

@weppos weppos was assigned
@weppos weppos merged commit 06c8426 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 404 additions and 218 deletions.
  1. +4 −0 CHANGELOG.md
  2. +14 −11 bin/ruby-whois
  3. +2 −0  lib/whois/client.rb
  4. +1 −1  lib/whois/record/parser/whois.aero.rb
  5. +1 −1  lib/whois/record/parser/whois.ati.tn.rb
  6. +1 −1  lib/whois/record/parser/whois.audns.net.au.rb
  7. +1 −1  lib/whois/record/parser/whois.cctld.by.rb
  8. +1 −1  lib/whois/record/parser/whois.cira.ca.rb
  9. +1 −1  lib/whois/record/parser/whois.co.ug.rb
  10. +1 −1  lib/whois/record/parser/whois.dk-hostmaster.dk.rb
  11. +1 −1  lib/whois/record/parser/whois.dns.be.rb
  12. +1 −1  lib/whois/record/parser/whois.dns.hr.rb
  13. +6 −8 lib/whois/record/parser/whois.dns.pt.rb
  14. +1 −1  lib/whois/record/parser/whois.domain-registry.nl.rb
  15. +1 −1  lib/whois/record/parser/whois.domainregistry.ie.rb
  16. +1 −1  lib/whois/record/parser/whois.fi.rb
  17. +3 −3 lib/whois/record/parser/whois.godaddy.com.rb
  18. +1 −1  lib/whois/record/parser/whois.nc.rb
  19. +1 −1  lib/whois/record/parser/whois.nic.at.rb
  20. +1 −1  lib/whois/record/parser/whois.nic.cz.rb
  21. +1 −1  lib/whois/record/parser/whois.nic.dm.rb
  22. +1 −1  lib/whois/record/parser/whois.nic.fo.rb
  23. +1 −1  lib/whois/record/parser/whois.nic.gov.rb
  24. +1 −1  lib/whois/record/parser/whois.nic.hn.rb
  25. +1 −1  lib/whois/record/parser/whois.nic.lk.rb
  26. +1 −1  lib/whois/record/parser/whois.nic.name.rb
  27. +31 −13 lib/whois/record/parser/whois.nic.pr.rb
  28. +1 −1  lib/whois/record/parser/whois.registry.om.rb
  29. +1 −1  lib/whois/record/parser/whois.registrypro.pro.rb
  30. +1 −1  lib/whois/record/parser/whois.rnids.rs.rb
  31. +1 −1  lib/whois/record/parser/whois.sx.rb
  32. +1 −1  lib/whois/record/parser/whois.tcinet.ru.rb
  33. +1 −1  lib/whois/record/parser/whois.tld.ee.rb
  34. +1 −1  lib/whois/record/parser/whois.tznic.or.tz.rb
  35. +7 −12 lib/whois/server/adapters/afilias.rb
  36. +10 −18 lib/whois/server/adapters/verisign.rb
  37. +1 −1  spec/fixtures/responses/whois.dns.pt/status_available.txt
  38. +1 −1  spec/fixtures/responses/whois.dns.pt/status_registered.expected
  39. +1 −1  spec/fixtures/responses/whois.dns.pt/status_registered.txt
  40. +22 −1 spec/fixtures/responses/whois.nic.pr/status_available.expected
  41. +23 −20 spec/fixtures/responses/whois.nic.pr/status_available.txt
  42. +32 −3 spec/fixtures/responses/whois.nic.pr/status_registered.expected
  43. +31 −62 spec/fixtures/responses/whois.nic.pr/status_registered.txt
  44. +14 −2 spec/fixtures/responses/whois.pnina.ps/status_available.txt
  45. +1 −1  spec/fixtures/responses/whois.pnina.ps/status_registered.expected
  46. +53 −3 spec/fixtures/responses/whois.pnina.ps/status_registered.txt
  47. +1 −1  spec/whois/record/parser/responses/whois.dns.pt/status_registered_spec.rb
  48. +32 −1 spec/whois/record/parser/responses/whois.nic.pr/status_available_spec.rb
  49. +42 −3 spec/whois/record/parser/responses/whois.nic.pr/status_registered_spec.rb
  50. +1 −1  spec/whois/record/parser/responses/whois.pnina.ps/status_registered_spec.rb
  51. +17 −7 spec/whois/server/adapters/afilias_spec.rb
  52. +27 −17 spec/whois/server/adapters/verisign_spec.rb
  53. 0  utils/compare-whois.rb
  54. 0  utils/fixupd.rb
View
4 CHANGELOG.md
@@ -15,6 +15,8 @@
- NEW: Added full whois.nic.pw parser.
+- NEW: Support for non-deep querying (GH-112)
+
- CHANGED: Dropped support for Ruby 1.8
- CHANGED: Renamed Whois::Record::Scanners::Ast to Renamed Whois::Record::Scanners::Nodable
@@ -53,6 +55,8 @@
- CHANGED: Removed deprecated options[:web] for :web adapter.
+- CHANGED: Updated whois.nic.pr parser to the new response format.
+
- FIXED: whois.domainregistry.ie should support status `Active - LOCKED`.
- FIXED: whois.nic.uk fails to parse registrars without URL (GH-188).
View
25 bin/ruby-whois
@@ -3,11 +3,10 @@
$:.unshift(File.expand_path("../../lib", __FILE__))
require 'optparse'
-require 'ostruct'
require 'whois'
-options = OpenStruct.new
+options = {}
OptionParser.new do |opts|
opts.banner = "Whois: an intelligent pure Ruby Whois client"
opts.define_head "Usage: ruby-whois [options] object"
@@ -18,20 +17,24 @@ OptionParser.new do |opts|
opts.separator ""
opts.separator "Options:"
- opts.on("-t", "--timeout [SECONDS]", Integer, "specify the timeout value") do |seconds|
- options.timeout = seconds
+ opts.on("-t", "--timeout [SECONDS]", Integer, "set the timeout") do |seconds|
+ options[:timeout] = seconds
end
- opts.on_tail("--help", "Show this message") do
- puts opts
- exit
+ opts.on("-h", "--host [HOST]", String, "connect to server HOST") do |host|
+ options[:host] = host
end
- opts.on("-h", "--host [HOST]", String, "connect to server HOST") do |host|
- options.host = host
+ opts.on("--[no-]referral", "skip referral queries") do |boolean|
+ options[:referral] = boolean
+ end
+
+ opts.on_tail("--help", "show this help and exit") do
+ puts opts
+ exit
end
- opts.on_tail("-v", "--version", "show version") do
+ opts.on_tail("--version", "output version information and exit") do
puts "#{Whois::NAME} #{Whois::VERSION}"
exit
end
@@ -52,7 +55,7 @@ end
object = ARGV.shift
begin
- @client = Whois::Client.new(:timeout => options.timeout, :host => options.host)
+ @client = Whois::Client.new(options)
puts @client.query(object)
rescue Whois::Error => e
abort(e.message)
View
2  lib/whois/client.rb
@@ -41,6 +41,8 @@ class Client
# to the specific local port.
# @option settings [String, nil] :host (nil)
# The server host to query. Leave it blank for intelligent detection.
+ # @option settings [Boolean, nil] :referral (nil)
+ # Set to +false+ to disable queries to referral WHOIS servers.
#
# @yield [self]
#
View
2  lib/whois/record/parser/whois.aero.rb
@@ -15,7 +15,7 @@ class Record
class Parser
# Parser for the whois.aero server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.ati.tn.rb
@@ -16,7 +16,7 @@ class Record
class Parser
# Parser for the whois.ati.tn server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.audns.net.au.rb
@@ -16,7 +16,7 @@ class Record
class Parser
# Parser for the whois.audns.net.au server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.cctld.by.rb
@@ -14,7 +14,7 @@ class Record
class Parser
# Parser for the whois.cctld.by server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.cira.ca.rb
@@ -16,7 +16,7 @@ class Record
class Parser
# Parser for the whois.cira.ca server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.co.ug.rb
@@ -19,7 +19,7 @@ class Parser
# @note This parser is just a stub and provides only a few basic methods
# to check for domain availability and get domain status.
# Please consider to contribute implementing missing methods.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.dk-hostmaster.dk.rb
@@ -19,7 +19,7 @@ class Parser
# @note This parser is just a stub and provides only a few basic methods
# to check for domain availability and get domain status.
# Please consider to contribute implementing missing methods.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.dns.be.rb
@@ -19,7 +19,7 @@ class Parser
# @note This parser is just a stub and provides only a few basic methods
# to check for domain availability and get domain status.
# Please consider to contribute implementing missing methods.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.dns.hr.rb
@@ -16,7 +16,7 @@ class Record
class Parser
# Parser for the whois.dns.hr server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
14 lib/whois/record/parser/whois.dns.pt.rb
@@ -14,16 +14,14 @@ module Whois
class Record
class Parser
- #
- # = whois.dns.pt parser
- #
# Parser for the whois.dns.pt server.
#
- # NOTE: This parser is just a stub and provides only a few basic methods
- # to check for domain availability and get domain status.
- # Please consider to contribute implementing missing methods.
- # See WhoisNicIt parser for an explanation of all available methods
- # and examples.
+ # @note This parser is just a stub and provides only a few basic methods
+ # to check for domain availability and get domain status.
+ # Please consider to contribute implementing missing methods.
+ #
+ # @see Whois::Record::Parser::Example
+ # The Example parser for the list of all available methods.
#
class WhoisDnsPt < Base
View
2  lib/whois/record/parser/whois.domain-registry.nl.rb
@@ -19,7 +19,7 @@ class Parser
# @note This parser is just a stub and provides only a few basic methods
# to check for domain availability and get domain status.
# Please consider to contribute implementing missing methods.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.domainregistry.ie.rb
@@ -16,7 +16,7 @@ class Record
class Parser
# Parser for the whois.domainregistry.ie server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.fi.rb
@@ -19,7 +19,7 @@ class Parser
# @note This parser is just a stub and provides only a few basic methods
# to check for domain availability and get domain status.
# Please consider to contribute implementing missing methods.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
6 lib/whois/record/parser/whois.godaddy.com.rb
@@ -15,7 +15,7 @@ class Record
class Parser
# Parser for the whois.godaddy.com server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
@@ -41,13 +41,13 @@ class WhoisGodaddyCom < Base
# Time.parse($1)
# end
# end
- #
+ #
# property_supported :updated_on do
# if content_for_scanner =~ /Last Updated on: (.+)\n/
# Time.parse($1)
# end
# end
- #
+ #
# property_supported :expires_on do
# if content_for_scanner =~ /Expires on: (.+)\n/
# Time.parse($1)
View
2  lib/whois/record/parser/whois.nc.rb
@@ -16,7 +16,7 @@ class Record
class Parser
# Parser for the whois.nc server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.nic.at.rb
@@ -19,7 +19,7 @@ class Parser
# @note This parser is just a stub and provides only a few basic methods
# to check for domain availability and get domain status.
# Please consider to contribute implementing missing methods.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.nic.cz.rb
@@ -15,7 +15,7 @@ class Record
class Parser
# Parser for the whois.nic.cz server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.nic.dm.rb
@@ -16,7 +16,7 @@ class Record
class Parser
# Parser for the whois.nic.dm server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.nic.fo.rb
@@ -15,7 +15,7 @@ class Record
class Parser
# Parser for the whois.nic.fo server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.nic.gov.rb
@@ -19,7 +19,7 @@ class Parser
# @note This parser is just a stub and provides only a few basic methods
# to check for domain availability and get domain status.
# Please consider to contribute implementing missing methods.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.nic.hn.rb
@@ -15,7 +15,7 @@ class Record
class Parser
# Parser for the whois.nic.hn server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.nic.lk.rb
@@ -15,7 +15,7 @@ class Record
class Parser
# Parser for the whois.nic.lk server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.nic.name.rb
@@ -19,7 +19,7 @@ class Parser
# @note This parser is just a stub and provides only a few basic methods
# to check for domain availability and get domain status.
# Please consider to contribute implementing missing methods.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
44 lib/whois/record/parser/whois.nic.pr.rb
@@ -14,19 +14,24 @@ module Whois
class Record
class Parser
+ # Parser for the whois.nic.pr server.
#
- # = whois.nic.pr parser
- #
- # Parser for the whois.nic.or server.
- #
- # NOTE: This parser is just a stub and provides only a few basic methods
- # to check for domain availability and get domain status.
- # Please consider to contribute implementing missing methods.
- # See WhoisNicIt parser for an explanation of all available methods
- # and examples.
+ # @see Whois::Record::Parser::Example
+ # The Example parser for the list of all available methods.
#
class WhoisNicPr < Base
+ property_supported :domain do
+ if content_for_scanner =~ /^Domain:\s+(.+)\n/
+ $1
+ elsif content_for_scanner =~ /^The domain (.+?) is not registered\.\n/
+ $1
+ end
+ end
+
+ property_not_supported :domain_id
+
+
property_supported :status do
if available?
:available
@@ -36,7 +41,7 @@ class WhoisNicPr < Base
end
property_supported :available? do
- !(content_for_scanner =~ /^Domain: (.+?)\n/)
+ !!(content_for_scanner =~ /^The domain (.+?) is not registered\.\n/)
end
property_supported :registered? do
@@ -45,7 +50,7 @@ class WhoisNicPr < Base
property_supported :created_on do
- if content_for_scanner =~ /Created on:(.+?)\n/
+ if content_for_scanner =~ /Created On:\s+(.+)\n/
Time.parse($1)
end
end
@@ -53,13 +58,26 @@ class WhoisNicPr < Base
property_not_supported :updated_on
property_supported :expires_on do
- if content_for_scanner =~ /Expires on:(.+?)\n/
+ if content_for_scanner =~ /Expires On:\s+(.+)\n/
Time.parse($1)
end
end
- property_not_supported :nameservers
+ property_not_supported :registrar
+
+ property_not_supported :registrant_contacts
+
+ property_not_supported :admin_contacts
+
+ property_not_supported :technical_contacts
+
+
+ property_supported :nameservers do
+ content_for_scanner.scan(/DNS:\s+(.+)\n/).flatten.map do |name|
+ Record::Nameserver.new(:name => name)
+ end
+ end
end
View
2  lib/whois/record/parser/whois.registry.om.rb
@@ -15,7 +15,7 @@ class Record
class Parser
# Parser for the whois.registry.om server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.registrypro.pro.rb
@@ -15,7 +15,7 @@ class Record
class Parser
# Parser for the whois.registrypro.pro server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.rnids.rs.rb
@@ -16,7 +16,7 @@ class Record
class Parser
# Parser for the whois.rnids.rs server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.sx.rb
@@ -16,7 +16,7 @@ class Record
class Parser
# Parser for the whois.sx server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.tcinet.ru.rb
@@ -19,7 +19,7 @@ class Parser
# @note This parser is just a stub and provides only a few basic methods
# to check for domain availability and get domain status.
# Please consider to contribute implementing missing methods.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.tld.ee.rb
@@ -16,7 +16,7 @@ class Record
class Parser
# Parser for the whois.tld.ee server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
2  lib/whois/record/parser/whois.tznic.or.tz.rb
@@ -15,7 +15,7 @@ class Record
class Parser
# Parser for the whois.tznic.or.tz server.
- #
+ #
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
View
19 lib/whois/server/adapters/afilias.rb
@@ -16,11 +16,6 @@ module Adapters
#
# Provides ability to query Afilias WHOIS interfaces.
#
- # The following WHOIS servers are currently known
- # to require the Afilias adapter:
- #
- # - whois.afilias-grs.info
- #
class Afilias < Base
# Executes a WHOIS query to the Afilias WHOIS interface,
@@ -34,20 +29,20 @@ def request(string)
response = query_the_socket(string, host)
buffer_append response, host
- if endpoint = extract_referral(response)
- response = query_the_socket(string, endpoint)
- buffer_append response, endpoint
+ if options[:referral] != false && referral = extract_referral(response)
+ response = query_the_socket(string, referral)
+ buffer_append(response, referral)
end
end
private
- def extract_referral(response)
- if response =~ /Domain Name:/ && response =~ /Whois Server:(\S+)/
- $1
- end
+ def extract_referral(response)
+ if response =~ /Domain Name:/
+ response.slice(/Whois Server:(\S+)/, 1)
end
+ end
end
View
28 lib/whois/server/adapters/verisign.rb
@@ -16,14 +16,6 @@ module Adapters
#
# Provides ability to query Verisign WHOIS interfaces.
#
- # The following WHOIS servers are currently known
- # to require the Verisign adapter:
- #
- # - whois.nic.tv
- # - whois.crsnic.net
- # - jobswhois.verisign-grs.com
- # - whois.nic.cc
- #
class Verisign < Base
# Executes a WHOIS query to the Verisign WHOIS interface,
@@ -37,23 +29,23 @@ def request(string)
response = query_the_socket("=#{string}", host)
buffer_append response, host
- if endpoint = extract_referral(response)
- response = query_the_socket(string, endpoint)
- buffer_append response, endpoint
+ if options[:referral] != false && referral = extract_referral(response)
+ response = query_the_socket(string, referral)
+ buffer_append(response, referral)
end
end
private
- def extract_referral(response)
- if response =~ /Domain Name:/
- endpoint = response.scan(/Whois Server: (.+?)$/).flatten.last
- endpoint.strip! if endpoint != nil
- endpoint = nil if endpoint == "not defined"
- endpoint
- end
+ def extract_referral(response)
+ if response =~ /Domain Name:/
+ server = response.scan(/Whois Server: (.+?)$/).flatten.last
+ server.strip! if server != nil
+ server = nil if server == "not defined"
+ server
end
+ end
end
View
2  spec/fixtures/responses/whois.dns.pt/status_available.txt
@@ -1 +1 @@
-u34jedzcq.pt no match
+u34jedzcq.pt no match
View
2  spec/fixtures/responses/whois.dns.pt/status_registered.expected
@@ -17,7 +17,7 @@
#expires_on
should: %s CLASS(time)
- should: %s == Time.parse("2012-02-29 00:00:00 UTC")
+ should: %s == Time.parse("2013-02-28 00:00:00 UTC")
#nameservers
View
2  spec/fixtures/responses/whois.dns.pt/status_registered.txt
@@ -1,6 +1,6 @@
Nome de domínio / Domain Name: google.pt
Data de registo / Creation Date (dd/mm/yyyy): 09/01/2003
-Data de expiração / Expiration Date (dd/mm/yyyy): 29/02/2012
+Data de expiração / Expiration Date (dd/mm/yyyy): 28/02/2013
Estado / Status: ACTIVE
Titular / Registrant
View
23 spec/fixtures/responses/whois.nic.pr/status_available.expected
@@ -1,3 +1,10 @@
+#domain
+ should: %s == "u34jedzcq.pr"
+
+#domain_id
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+
#status
should: %s == :available
@@ -18,5 +25,19 @@
should: %s == nil
-#nameservers
+#registrar
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+#registrant_contacts
should: %s raise_error(Whois::PropertyNotSupported)
+
+#admin_contacts
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+#technical_contacts
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+
+#nameservers
+ should: %s CLASS(array)
+ should: %s == []
View
43 spec/fixtures/responses/whois.nic.pr/status_available.txt
@@ -1,22 +1,25 @@
-
-
-Whois Disclaimer
-
-
-The data in nic.pr's WHOIS database is provided to you by nic.pr for information
-purposes only, that is to assist you in obtaining information about or related to
-a domain name registration record. Nic.pr makes this information available "as is",
-and does not guarantee its accuracy. By submitting a WHOIS query, you agree that you
-will use this data only for lawful purposes and that, under no circumstances will
-you use this data to: (1) allow, enable, or otherwise support the transmission of
-mass unsolicited, commercial advertising or solicitations via direct mail, electronic
-mail, including spam or by telephone; or (2) enable high volume, automated, electronic
-processes or robotic, including mining this data for your own personal or commercial
-purposes that apply to nic.pr (or its systems). The compilation, repackaging, dissemi-
-nation or other use of this data is expressly prohibited without the prior written
-consent of nic.pr. Nic.pr reserves the right to modify these terms at any time. By sub-
-mitting this query, you agree to abide by these terms.
-
-
+%
+% NIC.PR WHOIS server.
+%
+% Disclaimer
+% The data in NIC.PR's WHOIS database is provided to you by NIC.PR
+% for information purposes only, that is to assist you in obtaining
+% information about or related to a domain name registration record.
+% NIC.PR makes this information available "as is", and does not
+% guarantee its accuracy. By submitting a WHOIS query, you agree that
+% you will use this data only for lawful purposes and that, under no
+% circumstances will you use this data to: (1) allow, enable, or
+% otherwise support the transmission of mass unsolicited, commercial
+% advertising or solicitations via direct mail, electronic mail,
+% including spam or by telephone; or (2) enable high volume,
+% automated, electronic processes or robotic, including mining this
+% data for your own personal or commercial purposes that apply to
+% NIC.PR (or its systems). The compilation, repackaging, dissemination
+% or other use of this data is expressly prohibited without the prior
+% written consent of NIC.PR. NIC.PR reserves the right to modify
+% these terms at any time. By sub-mitting this query, you agree to
+% abide by these terms.
+
+The domain u34jedzcq.pr is not registered.
View
35 spec/fixtures/responses/whois.nic.pr/status_registered.expected
@@ -1,3 +1,10 @@
+#domain
+ should: %s == "google.pr"
+
+#domain_id
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+
#status
should: %s == :registered
@@ -10,15 +17,37 @@
#created_on
should: %s CLASS(time)
- should: %s == Time.parse("2003-01-25")
+ should: %s == Time.parse("2005-09-15")
#updated_on
should: %s raise_error(Whois::PropertyNotSupported)
#expires_on
should: %s CLASS(time)
- should: %s == Time.parse("2011-01-25")
+ should: %s == Time.parse("2013-09-15")
-#nameservers
+#registrar
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+#registrant_contacts
should: %s raise_error(Whois::PropertyNotSupported)
+
+#admin_contacts
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+#technical_contacts
+ should: %s raise_error(Whois::PropertyNotSupported)
+
+
+#nameservers
+ should: %s CLASS(array)
+ should: %s SIZE(4)
+ should: %s[0] CLASS(nameserver)
+ should: %s[0].name == "ns1.google.com"
+ should: %s[1] CLASS(nameserver)
+ should: %s[1].name == "ns2.google.com"
+ should: %s[2] CLASS(nameserver)
+ should: %s[2].name == "ns3.google.com"
+ should: %s[3] CLASS(nameserver)
+ should: %s[3].name == "ns4.google.com"
View
93 spec/fixtures/responses/whois.nic.pr/status_registered.txt
@@ -1,62 +1,31 @@
-
-
-Whois Disclaimer
-
-
-The data in nic.pr's WHOIS database is provided to you by nic.pr for information
-purposes only, that is to assist you in obtaining information about or related to
-a domain name registration record. Nic.pr makes this information available "as is",
-and does not guarantee its accuracy. By submitting a WHOIS query, you agree that you
-will use this data only for lawful purposes and that, under no circumstances will
-you use this data to: (1) allow, enable, or otherwise support the transmission of
-mass unsolicited, commercial advertising or solicitations via direct mail, electronic
-mail, including spam or by telephone; or (2) enable high volume, automated, electronic
-processes or robotic, including mining this data for your own personal or commercial
-purposes that apply to nic.pr (or its systems). The compilation, repackaging, dissemi-
-nation or other use of this data is expressly prohibited without the prior written
-consent of nic.pr. Nic.pr reserves the right to modify these terms at any time. By sub-
-mitting this query, you agree to abide by these terms.
-
-
-
-Domain: google.com.pr
-
-----Organization Contact:----
-Google Inc.
-1600 Amphitheatre Parkway
-Mountain View, CA, 94043
-US
-+1.6503300100
-+1.6503300100
-dns-admin@google.com
-
-----Administrative Contact:----
-DNS Admin
-Google Inc.
-1600 Amphitheatre Parkway
-Mountain View, CA, 94043
-US
-+1.6506181434
-+1.6503300100
-dns-admin@google.com
-
-----Technical Contact:----
-DNS Admin
-Google Inc.
-1600 Amphitheatre Parkway
-Mountain View, CA, 94043
-+1.6506181434
-+1.6503300100
-dns-admin@google.com
-
-----Billing Contact:----
-MarkMonitor
-PMB 155
-10400 Overland Road
-Boise, Idaho, 83709-1433
-+1 208 389 5799
-+1 208 389 5740
-dnbilling@alldomains.com
-Created on: 2003-01-25
-Expires on: 2011-01-25
-
+%
+% NIC.PR WHOIS server.
+%
+% Disclaimer
+% The data in NIC.PR's WHOIS database is provided to you by NIC.PR
+% for information purposes only, that is to assist you in obtaining
+% information about or related to a domain name registration record.
+% NIC.PR makes this information available "as is", and does not
+% guarantee its accuracy. By submitting a WHOIS query, you agree that
+% you will use this data only for lawful purposes and that, under no
+% circumstances will you use this data to: (1) allow, enable, or
+% otherwise support the transmission of mass unsolicited, commercial
+% advertising or solicitations via direct mail, electronic mail,
+% including spam or by telephone; or (2) enable high volume,
+% automated, electronic processes or robotic, including mining this
+% data for your own personal or commercial purposes that apply to
+% NIC.PR (or its systems). The compilation, repackaging, dissemination
+% or other use of this data is expressly prohibited without the prior
+% written consent of NIC.PR. NIC.PR reserves the right to modify
+% these terms at any time. By sub-mitting this query, you agree to
+% abide by these terms.
+
+Domain: google.pr
+
+Created On: 2005-09-15
+Expires On: 2013-09-15
+
+DNS: ns1.google.com
+DNS: ns2.google.com
+DNS: ns3.google.com
+DNS: ns4.google.com
View
16 spec/fixtures/responses/whois.pnina.ps/status_available.txt
@@ -1,6 +1,18 @@
-TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by PNINA as a service to the internet community on behalf of PNINA members. (http://www.pnina.ps/)
+TERMS OF USE: You are not authorized to access or query our Whois
+database through the use of electronic processes that are high-volume and
+automated. Whois database is provided by PNINA as a service to the internet
+community on behalf of PNINA and Its Certified Registrars (CR). (http://www.pnina.ps/registrars/registrars-list/)
-The data is for information purposes only. PNINA does not guarantee its accuracy. By submitting a Whois query, you agree to abide by the following terms of use: You agree that you may use this Data only for lawful purposes and that under no circumstances will you use this Data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes that apply to PNINA and it's registrars (or PNINA or registrars computer systems). The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.
+The data is for information purposes only. PNINA does not
+guarantee its accuracy. By submitting a Whois query, you agree to abide
+by the following terms of use: You agree that you may use this Data only
+for lawful purposes and that under no circumstances will you use this Data
+to: (1) allow, enable, or otherwise support the transmission of mass
+unsolicited, commercial advertising or solicitations via e-mail, telephone,
+or facsimile; or (2) enable high volume, automated, electronic processes
+that apply to PNINA and it's Certified Registrar's (or PNINA or CR computer systems). The
+compilation, repackaging, dissemination or other use of this Data is
+expressly prohibited.
Domain Information
Query: u34jedzcq.ps
View
2  spec/fixtures/responses/whois.pnina.ps/status_registered.expected
@@ -17,7 +17,7 @@
#expires_on
should: %s CLASS(time)
- should: %s == Time.parse("2011-05-19")
+ should: %s == Time.parse("2013-05-19")
#nameservers
View
56 spec/fixtures/responses/whois.pnina.ps/status_registered.txt
@@ -1,12 +1,24 @@
-TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated. Whois database is provided by PNINA as a service to the internet community on behalf of PNINA members. (http://www.pnina.ps/)
+TERMS OF USE: You are not authorized to access or query our Whois
+database through the use of electronic processes that are high-volume and
+automated. Whois database is provided by PNINA as a service to the internet
+community on behalf of PNINA and Its Certified Registrars (CR). (http://www.pnina.ps/registrars/registrars-list/)
-The data is for information purposes only. PNINA does not guarantee its accuracy. By submitting a Whois query, you agree to abide by the following terms of use: You agree that you may use this Data only for lawful purposes and that under no circumstances will you use this Data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes that apply to PNINA and it's registrars (or PNINA or registrars computer systems). The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.
+The data is for information purposes only. PNINA does not
+guarantee its accuracy. By submitting a Whois query, you agree to abide
+by the following terms of use: You agree that you may use this Data only
+for lawful purposes and that under no circumstances will you use this Data
+to: (1) allow, enable, or otherwise support the transmission of mass
+unsolicited, commercial advertising or solicitations via e-mail, telephone,
+or facsimile; or (2) enable high volume, automated, electronic processes
+that apply to PNINA and it's Certified Registrar's (or PNINA or CR computer systems). The
+compilation, repackaging, dissemination or other use of this Data is
+expressly prohibited.
Domain Information
Query: google.ps
Status: Active
Created: 19 May 2004
-Expires: 19 May 2011
+Expires: 19 May 2013
Name Servers:
ns1.google.com
ns2.google.com
@@ -14,7 +26,45 @@ Name Servers:
Registrar Information
Registrar Name: eMarkMonitor
+Address: 391-N.ANCESTOR PLACE BOISE,IDAHO USA
+Phone: +1-208-389-5740
+Fax: +1-208-389-5740
+Registrant:
+Name: Google Inc.
+Address:
+ 2400 E. Bayshore Pkwy Mountain View- CA- US 94043
+ CA US
+Phone Number: 001-6-503300100
+Fax Number: 001-6-506188571
+
+
+Admin Contact:
+Name: markmonitor-Inc
+Address:
+ 10400 Overland Rd- PMB 155- Boise-ID-US 83709-1433
+ Boise US
+Phone Number: 001-2-083895740
+Fax Number: 001-2-083895771
+
+
+Technical Contact:
+Name: markmonitor-Inc
+Address:
+ 10400 Overland Rd- PMB 155- Boise-ID-US 83709-1433
+ Boise US
+Phone Number: 001-2-083895740
+Fax Number: 001-2-083895771
+
+
+Billing Contact:
+Name: Google Inc.
+Address:
+ 2400 E. Bayshore Pkwy Mountain View- CA- US 94043
+ CA US
+Phone Number: 001-6-503300100
+Fax Number: 001-6-506188571
+
View
2  spec/whois/record/parser/responses/whois.dns.pt/status_registered_spec.rb
@@ -50,7 +50,7 @@
describe "#expires_on" do
it do
subject.expires_on.should be_a(Time)
- subject.expires_on.should == Time.parse("2012-02-29 00:00:00 UTC")
+ subject.expires_on.should == Time.parse("2013-02-28 00:00:00 UTC")
end
end
describe "#nameservers" do
View
33 spec/whois/record/parser/responses/whois.nic.pr/status_available_spec.rb
@@ -21,6 +21,16 @@
described_class.new(part)
end
+ describe "#domain" do
+ it do
+ subject.domain.should == "u34jedzcq.pr"
+ end
+ end
+ describe "#domain_id" do
+ it do
+ lambda { subject.domain_id }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
describe "#status" do
it do
subject.status.should == :available
@@ -51,9 +61,30 @@
subject.expires_on.should == nil
end
end
+ describe "#registrar" do
+ it do
+ lambda { subject.registrar }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
+ describe "#registrant_contacts" do
+ it do
+ lambda { subject.registrant_contacts }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
+ describe "#admin_contacts" do
+ it do
+ lambda { subject.admin_contacts }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
+ describe "#technical_contacts" do
+ it do
+ lambda { subject.technical_contacts }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
describe "#nameservers" do
it do
- lambda { subject.nameservers }.should raise_error(Whois::PropertyNotSupported)
+ subject.nameservers.should be_a(Array)
+ subject.nameservers.should == []
end
end
end
View
45 spec/whois/record/parser/responses/whois.nic.pr/status_registered_spec.rb
@@ -21,6 +21,16 @@
described_class.new(part)
end
+ describe "#domain" do
+ it do
+ subject.domain.should == "google.pr"
+ end
+ end
+ describe "#domain_id" do
+ it do
+ lambda { subject.domain_id }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
describe "#status" do
it do
subject.status.should == :registered
@@ -39,7 +49,7 @@
describe "#created_on" do
it do
subject.created_on.should be_a(Time)
- subject.created_on.should == Time.parse("2003-01-25")
+ subject.created_on.should == Time.parse("2005-09-15")
end
end
describe "#updated_on" do
@@ -50,12 +60,41 @@
describe "#expires_on" do
it do
subject.expires_on.should be_a(Time)
- subject.expires_on.should == Time.parse("2011-01-25")
+ subject.expires_on.should == Time.parse("2013-09-15")
+ end
+ end
+ describe "#registrar" do
+ it do
+ lambda { subject.registrar }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
+ describe "#registrant_contacts" do
+ it do
+ lambda { subject.registrant_contacts }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
+ describe "#admin_contacts" do
+ it do
+ lambda { subject.admin_contacts }.should raise_error(Whois::PropertyNotSupported)
+ end
+ end
+ describe "#technical_contacts" do
+ it do
+ lambda { subject.technical_contacts }.should raise_error(Whois::PropertyNotSupported)
end
end
describe "#nameservers" do
it do
- lambda { subject.nameservers }.should raise_error(Whois::PropertyNotSupported)
+ subject.nameservers.should be_a(Array)
+ subject.nameservers.should have(4).items
+ subject.nameservers[0].should be_a(Whois::Record::Nameserver)
+ subject.nameservers[0].name.should == "ns1.google.com"
+ subject.nameservers[1].should be_a(Whois::Record::Nameserver)
+ subject.nameservers[1].name.should == "ns2.google.com"
+ subject.nameservers[2].should be_a(Whois::Record::Nameserver)
+ subject.nameservers[2].name.should == "ns3.google.com"
+ subject.nameservers[3].should be_a(Whois::Record::Nameserver)
+ subject.nameservers[3].name.should == "ns4.google.com"
end
end
end
View
2  spec/whois/record/parser/responses/whois.pnina.ps/status_registered_spec.rb
@@ -50,7 +50,7 @@
describe "#expires_on" do
it do
subject.expires_on.should be_a(Time)
- subject.expires_on.should == Time.parse("2011-05-19")
+ subject.expires_on.should == Time.parse("2013-05-19")
end
end
describe "#nameservers" do
View
24 spec/whois/server/adapters/afilias_spec.rb
@@ -9,11 +9,11 @@
describe "#lookup" do
context "without referral" do
it "returns the WHOIS record" do
- response = "No match for DOMAIN.TEST."
+ response = "No match for example.test."
expected = response
- server.query_handler.expects(:call).with("domain.test", "whois.afilias-grs.info", 43).returns(response)
+ server.query_handler.expects(:call).with("example.test", "whois.afilias-grs.info", 43).returns(response)
- record = server.lookup("domain.test")
+ record = server.lookup("example.test")
record.to_s.should == expected
record.parts.should have(1).part
record.parts.should == [Whois::Record::Part.new(:body => response, :host => "whois.afilias-grs.info")]
@@ -23,16 +23,26 @@
context "with referral" do
it "follows all referrals" do
referral = File.read(fixture("referrals/afilias.bz.txt"))
- response = "Match for DOMAIN.TEST."
+ response = "Match for example.test."
expected = referral + "\n" + response
- server.query_handler.expects(:call).with("domain.test", "whois.afilias-grs.info", 43).returns(referral)
- server.query_handler.expects(:call).with("domain.test", "whois.belizenic.bz", 43).returns(response)
+ server.query_handler.expects(:call).with("example.test", "whois.afilias-grs.info", 43).returns(referral)
+ server.query_handler.expects(:call).with("example.test", "whois.belizenic.bz", 43).returns(response)
- record = server.lookup("domain.test")
+ record = server.lookup("example.test")
record.to_s.should == expected
record.parts.should have(2).parts
record.parts.should == [Whois::Record::Part.new(:body => referral, :host => "whois.afilias-grs.info"), Whois::Record::Part.new(:body => response, :host => "whois.belizenic.bz")]
end
+
+ it "ignores referral if options[:referral] is false" do
+ referral = File.read(fixture("referrals/afilias.bz.txt"))
+ server.options[:referral] = false
+ server.query_handler.expects(:call).with("example.test", "whois.afilias-grs.info", 43).returns(referral)
+ server.query_handler.expects(:call).with("example.test", "whois.belizenic.bz", 43).never
+
+ record = server.lookup("example.test")
+ record.parts.should have(1).part
+ end
end
end
View
44 spec/whois/server/adapters/verisign_spec.rb
@@ -9,11 +9,11 @@
describe "#lookup" do
context "without referral" do
it "returns the WHOIS record" do
- response = "No match for DOMAIN.TEST."
+ response = "No match for example.test."
expected = response
- server.query_handler.expects(:call).with("=domain.test", "whois.test", 43).returns(response)
+ server.query_handler.expects(:call).with("=example.test", "whois.test", 43).returns(response)
- record = server.lookup("domain.test")
+ record = server.lookup("example.test")
record.to_s.should == expected
record.parts.should have(1).part
record.parts.should == [Whois::Record::Part.new(:body => response, :host => "whois.test")]
@@ -23,43 +23,53 @@
context "with referral" do
it "follows all referrals" do
referral = File.read(fixture("referrals/crsnic.com.txt"))
- response = "Match for DOMAIN.TEST."
+ response = "Match for example.test."
expected = referral + "\n" + response
- server.query_handler.expects(:call).with("=domain.test", "whois.test", 43).returns(referral)
- server.query_handler.expects(:call).with("domain.test", "whois.markmonitor.com", 43).returns(response)
+ server.query_handler.expects(:call).with("=example.test", "whois.test", 43).returns(referral)
+ server.query_handler.expects(:call).with("example.test", "whois.markmonitor.com", 43).returns(response)
- record = server.lookup("domain.test")
+ record = server.lookup("example.test")
record.to_s.should == expected
record.parts.should have(2).parts
record.parts.should == [Whois::Record::Part.new(:body => referral, :host => "whois.test"), Whois::Record::Part.new(:body => response, :host => "whois.markmonitor.com")]
end
- it "extracts the closest referral when multiple referrals" do
+ it "extracts the closest referral if multiple referrals" do
referral = File.read(fixture("referrals/crsnic.com_referral_multiple.txt"))
- server.query_handler.expects(:call).with("=domain.test", "whois.test", 43).returns(referral)
- server.query_handler.expects(:call).with("domain.test", "whois.markmonitor.com", 43).returns("")
+ server.query_handler.expects(:call).with("=example.test", "whois.test", 43).returns(referral)
+ server.query_handler.expects(:call).with("example.test", "whois.markmonitor.com", 43).returns("")
- record = server.lookup("domain.test")
+ record = server.lookup("example.test")
record.parts.should have(2).parts
end
- it "ignores referral when is not defined" do
+ it "ignores referral if is not defined" do
referral = File.read(fixture("referrals/crsnic.com_referral_not_defined.txt"))
- server.query_handler.expects(:call).with("=domain.test", "whois.test", 43).returns(referral)
+ server.query_handler.expects(:call).with("=example.test", "whois.test", 43).returns(referral)
server.query_handler.expects(:call).never
- record = server.lookup("domain.test")
+ record = server.lookup("example.test")
+ record.parts.should have(1).part
+ end
+
+ it "ignores referral if options[:referral] is false" do
+ referral = File.read(fixture("referrals/crsnic.com_referral_not_defined.txt"))
+ # server.options[:referral] = false
+ server.query_handler.expects(:call).with("=example.test", "whois.test", 43).returns(referral)
+ server.query_handler.expects(:call).never
+
+ record = server.lookup("example.test")
record.parts.should have(1).part
end
# (see #103)
# This is the case of vrsn-20100925-dnssecmonitor86.net
- it "gracefully ignores referral when is missing" do
+ it "ignores referral (gracefully) if missing" do
referral = File.read(fixture("referrals/crsnic.com_referral_missing.txt"))
- server.query_handler.expects(:call).with("=domain.test", "whois.test", 43).returns(referral)
+ server.query_handler.expects(:call).with("=example.test", "whois.test", 43).returns(referral)
server.query_handler.expects(:call).never
- record = server.lookup("domain.test")
+ record = server.lookup("example.test")
record.parts.should have(1).part
end
end
View
0  utils/compare-whois.rb 100644 → 100755
File mode changed
View
0  utils/fixupd.rb 100644 → 100755
File mode changed
Something went wrong with that request. Please try again.