Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

.org.ru domains whois #179

Closed
wants to merge 3 commits into from

2 participants

@yspro

No description provided.

@weppos
Owner

Hi @yspro, thanks for your patch!

I had a look at the whois.nic.ru whois interface and it appears to me that RU-CENTER is actually a registrar, not a registry. They offer the ability to register .org.ru domains and lookup whois data, but they are not maintaining them. Am I right?

Apparently, they also offer whois lookup for several other extensions.

I tried to lookup .org.ru and .net.org domains using the standard .ru registry database and they return no information.

$ ruby-whois darkk.net.ru
% By submitting a query to RIPN's Whois Service
% you agree to abide by the following terms of use:
% http://www.ripn.net/about/servpol.html#3.2 (in Russian) 
% http://www.ripn.net/about/en/servpol.html#3.2 (in English).

No entries found for the selected source(s).

Last updated on 2012.07.04 17:23:49 MSK

Is nic.ru the only source? Who's maintaining .org.ru domains? How many other .ru sub-zones are available out of there?

@yspro

Russian wikipedia page "http://ru.wikipedia.org/wiki/WHOIS" says (you can use translate.google.com), that it's recommended to use the official whois-server for a specific zone.
However this rule does not apply for domain names .org.ru, .net.ru, .msk.ru and some other geo-domains. Info on those domains is stored only on whois.nic.ru

@weppos
Owner

Then the question is if we want to add all these sub-domains or not. Adding only .org.ru doesn't make sense to me.

Can you extract a list of all these subdomains?

yspro added some commits
@yspro

Look at my updates: geodomains for RU-center registrar and .name tld additional info

@weppos
Owner

Here's my comments:

  1. Please don't add extra-features to the patch. If you want to supply a patch for the .name definition, open a different pull request.
  2. Why did you add the dependency to the public_suffix library?
  3. Please don't use loops inside the definition file. The file is going to be converted into JSON, please list the definitions one per line.
@yspro

Sorry. I haven't much experience with git. I'll try to fix all in nearest days

@yspro yspro closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 4, 2012
  1. @yspro
Commits on Jul 5, 2012
  1. @yspro

    Added .net.ru, .pp.ru, .com.ru support

    yspro authored
    Added nic.ru geodomains
Commits on Jul 9, 2012
  1. @yspro

    Altered adapter for .name tld

    yspro authored
    Added more info for .name
This page is out of date. Refresh to see the latest.
View
1  Rakefile
@@ -36,6 +36,7 @@ spec = Gem::Specification.new do |s|
s.add_development_dependency "rspec", "~> 2.10.0"
s.add_development_dependency "mocha"
s.add_development_dependency "yard"
+ s.add_dependency "public_suffix", "~> 1.1.1"
s.post_install_message = <<EOS
********************************************************************************
View
78 lib/whois/definitions/tlds.rb
@@ -45,7 +45,7 @@
Whois::Server.define :tld, ".jobs", "jobswhois.verisign-grs.com", { :adapter => :verisign }
Whois::Server.define :tld, ".mobi", "whois.dotmobiregistry.net"
Whois::Server.define :tld, ".museum", "whois.museum"
-Whois::Server.define :tld, ".name", "whois.nic.name"
+Whois::Server.define :tld, ".name", "whois.nic.name", { :adapter => :formatted, :format => "domain=%s" }
Whois::Server.define :tld, ".pro", "whois.registrypro.pro"
Whois::Server.define :tld, ".tel", "whois.nic.tel"
Whois::Server.define :tld, ".travel", "whois.nic.travel"
@@ -255,6 +255,82 @@
Whois::Server.define :tld, ".rs", "whois.rnids.rs"
Whois::Server.define :tld, ".edu.ru", "whois.informika.ru"
Whois::Server.define :tld, ".ru", "whois.tcinet.ru"
+Whois::Server.define :tld, ".org.ru", "whois.nic.ru"
+Whois::Server.define :tld, ".net.ru", "whois.nic.ru"
+Whois::Server.define :tld, ".pp.ru", "whois.nic.ru"
+Whois::Server.define :tld, ".com.ru", "whois.nic.ru"
+%w(
+abkhazia.su
+adygeya.ru
+adygeya.su
+aktyubinsk.su
+arkhangelsk.su
+armenia.su
+ashgabad.su
+azerbaijan.su
+balashov.su
+bashkiria.ru
+bashkiria.su
+bir.ru
+bryansk.su
+bukhara.su
+cbg.ru
+chimkent.su
+dagestan.ru
+dagestan.su
+east-kazakhstan.su
+georgia.su
+grozny.ru
+grozny.su
+ivanovo.su
+jambyl.su
+kalmykia.ru
+kalmykia.su
+kaluga.su
+karacol.su
+karaganda.su
+karelia.su
+khakassia.su
+krasnodar.su
+kurgan.su
+kustanai.ru
+kustanai.su
+mangyshlak.su
+marine.ru
+mordovia.ru
+mordovia.su
+msk.ru
+msk.su
+murmansk.su
+mytis.ru
+nalchik.ru
+nalchik.su
+navoi.su
+north-kazakhstan.su
+nov.ru
+nov.su
+obninsk.su
+penza.su
+pokrovsk.su
+pyatigorsk.ru
+sochi.su
+spb.ru
+spb.su
+tashkent.su
+termez.su
+togliatti.su
+troitsk.su
+tselinograd.su
+tula.su
+tuva.su
+vladikavkaz.ru
+vladikavkaz.su
+vladimir.ru
+vladimir.su
+vologda.su
+).each do |tld|
+ Whois::Server.define :tld, ".#{tld}", "whois.nic.ru"
+end
Whois::Server.define :tld, ".rw", nil, { :adapter => :web, :url => "http://www.nic.rw/cgi-bin/whois.pl"}
Whois::Server.define :tld, ".sa", "saudinic.net.sa"
Whois::Server.define :tld, ".sb", "whois.nic.net.sb"
View
25 lib/whois/record/parser/whois.nic.name.rb
@@ -40,14 +40,29 @@ class WhoisNicName < Base
end
- property_not_supported :created_on
-
- property_not_supported :updated_on
+ property_supported :created_on do
+ if content_for_scanner =~ /Created On:\s+(.*)\n/
+ Time.parse($1)
+ end
+ end
- property_not_supported :expires_on
+ property_supported :updated_on do
+ if content_for_scanner =~ /Updated On:\s+(.*)\n/
+ Time.parse($1)
+ end
+ end
+ property_supported :expires_on do
+ if content_for_scanner =~ /Expires On:\s+(.*)\n/
+ Time.parse($1)
+ end
+ end
- property_not_supported :nameservers
+ property_supported :nameservers do
+ content_for_scanner.scan(/Name Server:\s+(.+)\n/).flatten.map do |line|
+ Record::Nameserver.new(:name => $1.chomp)
+ end
+ end
end
View
83 lib/whois/record/parser/whois.nic.ru.rb
@@ -0,0 +1,83 @@
+#--
+# Ruby Whois
+#
+# An intelligent pure Ruby WHOIS client and parser.
+#
+# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
+#++
+
+
+require 'whois/record/parser/base'
+
+
+module Whois
+ class Record
+ class Parser
+
+ # Parser for the whois.nic.ru server.
+ #
+ # @see Whois::Record::Parser::Example
+ # The Example parser for the list of all available methods.
+ #
+ # @author Siarhei Lipchyk
+ # @author yspro <me@ys-pro.com>
+ # @since 2.6.3
+ class WhoisNicRu < Base
+ property_supported :created_on do
+ if content_for_scanner =~ /created:\s+(.*)\n/
+ Time.parse($1)
+ end
+ end
+
+ property_not_supported :updated_on
+
+ property_supported :expires_on do
+ if content_for_scanner =~ /paid-till:\s+(.*)\n/
+ Time.parse($1)
+ end
+ end
+
+ property_supported :registrar do
+ if content_for_scanner =~ /registrar:\s+(.*)\n/
+ Record::Registrar.new(
+ :id => $1
+ )
+ end
+ end
+
+
+ property_supported :admin_contacts do
+ content_for_scanner.scan(/e-mail:\s+(.+)\n/).flatten.map do |email|
+ Record::Contact.new(
+ :type => Record::Contact::TYPE_ADMIN,
+ :name => content_for_scanner[/person:\s+(.+)\n/, 1],
+ :organization => content_for_scanner[/org:\s+(.+)\n/, 1],
+ :phone => content_for_scanner[/phone:\s+(.+)\n/, 1],
+ :fax => content_for_scanner[/fax-no:\s+(.+)\n/, 1],
+ :email => email
+ )
+ end
+ end
+
+ property_not_supported :registrant_contacts
+
+ property_not_supported :technical_contacts
+
+
+ # Nameservers are listed in the following formats:
+ #
+ # nserver: ns.masterhost.ru.
+ # nserver: ns.masterhost.ru. 217.16.20.30
+ #
+ property_supported :nameservers do
+ content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |line|
+ name, ipv4 = line.split(/\s+/)
+ Record::Nameserver.new(:name => name.chomp("."), :ipv4 => ipv4)
+ end
+ end
+
+ end
+
+ end
+ end
+end
View
7 lib/whois/server.rb
@@ -8,7 +8,7 @@
require 'ipaddr'
-
+require 'public_suffix'
module Whois
@@ -264,6 +264,11 @@ def self.find_for_email(string)
end
def self.find_for_domain(string)
+ tld = ".#{::PublicSuffix.parse(string).tld}"
+ if definition = definitions(:tld).find { |definition| tld == definition[0] }
+ return factory(:tld, *definition)
+ end
+
definitions(:tld).each do |definition|
return factory(:tld, *definition) if /#{Regexp.escape(definition.first)}$/ =~ string
end
View
9 whois.gemspec
6 additions, 3 deletions not shown
Something went wrong with that request. Please try again.