Project

nic_ar

0.0
No commit activity in last 3 years
No release in over 3 years
A simple client for ".ar" (Argentina) domain names lookups
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 1.8

Runtime

 Project Readme

NicAr::Client¶ ↑

<img src=“https://travis-ci.org/vivaserver/nic_ar.png” /> <img src=“https://codeclimate.com/badge.png” />

The NicAr::Client class allows to you programatically extract information about any “.ar” (Argentina) domain name.

It uses the public information as is made available at the Dirección Nacional del Registro de Dominios de Internet (NIC.ar) website using the third-party nic!alert API webservice.

Usage¶ ↑

The client initialization is pretty straigt-forward, and the only argument is optional.

nic_ar = NicAr::Client.new

The optional argument is an API token that can be obtained to by-pass the CAPTCHA challenge that the NIC.ar website sometimes requests you to solve before answering your domain lookup. Please refer to the nic!alert API official documentation for more details.

nic_ar = NicAr::Client.new("234d3cdf979e04db3d709ed8")

The NicAr::Client class supports lookups for domain names. First, find out what kind of domain names you are allowed to looup.

nic_ar.whois

=> [".com.ar", ".gob.ar", ".int.ar", ".mil.ar", ".net.ar", ".org.ar", ".tur.ar"]

All the following lookups will raise a NicAr::NotFound exception if the requested resource could not be found.

nic_ar.whois("vivaserver.com.ar")

=> {
     "status"=> {
       "available"=>false,
       "delegated"=>true,
       "expiring"=>false,
       "pending"=>false,
       "registered"=>true},
     "name"=>"vivaserver.com.ar",
     "created_on"=>"2004-11-18",
     "expires_on"=>"2012-11-18",
     "contacts"=> {
       "registrant"=>{
         "name"=>"Cristian Renato Arroyo",
         "activity"=>"Diseno de Paginas Web",
         "addresss" =>{
           "local" =>{
              "address"=>"Pje. Vucetich 676. Ciudad De Nieva",
              "city"=>"S. S. de Jujuy",
              "province"=>"Jujuy",
              "zip_code"=>"4600",
              "country"=>"Argentina",
              "phone"=>"(0388)155827713",
              "fax"=>"(0388)155827713"
            }
           }
         }
       },
     "name_servers"=>[
       {"id"=>0,"host"=>"ns1.mydyndns.org", "ip"=>nil},
       {"id"=>1,"host"=>"ns2.mydyndns.org", "ip"=>nil},
       {"id"=>2,"host"=>"ns3.mydyndns.org", "ip"=>nil},
       {"id"=>4,"host"=>"ns4.mydyndns.org", "ip"=>nil},
     ]
   }

Please note that this output conforms to the latest update of the Nic.ar website (late 2013), which significantly reduces the contacts data details exposed, as opposed to the previous version.

Check a domain status¶ ↑

You can also check if a given domain name resolves OK to it’s DNS servers, thus effectively know if it’s available online or not.

nic_ar.status("www.nic.ar")

=> { 
      "status" => {
        "domain"=>"www.nic.ar", 
        "online"=>true, 
        "offline"=>false, 
        "ip"=>"200.16.109.19",
        "host"=>"firpo.nic.ar"
      }
    }

But also note that a domain name without the “www.” may or may not resolve in the same way.

nic_ar.status("nic.ar")

=> {
      "status" => {
        "domain"=>"nic.ar",
        "online"=>true,
        "offline"=>false,
        "ip"=>"200.16.109.25", 
        "host"=>"roldan.nic.ar"
      }
    }

Lastly, status checking only works for “.ar” (Argentina) domain names.

Full API reference¶ ↑

The full documentation of the public nic!alert API is available at api.nicalert.me/docs if you want to write your own client, use any other language, or just use CURL in a RESTful way.

Contributing¶ ↑

  1. Fork it

  2. Create your feature branch (‘git checkout -b my-new-feature`)

  3. Commit your changes (‘git commit -am ’Add some feature’‘)

  4. Push to the branch (‘git push origin my-new-feature`)

  5. Create new Pull Request

License¶ ↑

NicAr::Client is released under the MIT License.

Copyright ©2014 Cristian R. Arroyo