A simple Whois server with a simple simple API and a front-end built with AngularJS.

James Peret: ecc3a52787 Readme API option преди 10 години
public 46d58a4053 J1X Whois Server modifications преди 10 години
views 46d58a4053 J1X Whois Server modifications преди 10 години
.DS_Store 46d58a4053 J1X Whois Server modifications преди 10 години
.gitignore 46d58a4053 J1X Whois Server modifications преди 10 години
.ruby-version 66912bc157 update this old bag of bones преди 10 години
Gemfile 54b0d0492b Added support for CORS преди 10 години
Gemfile.lock 54b0d0492b Added support for CORS преди 10 години
README.md ecc3a52787 Readme API option преди 10 години
config.ru 75fab7a59e Rack CORS re config fix 3 преди 10 години
json_parser.rb b34e0eb6b6 Whois API basic documentation преди 10 години
main.rb b34e0eb6b6 Whois API basic documentation преди 10 години

README.md

J1X Whois API

A simple WHOIS lookup API.

Based on the Whoiz application by Jason Ormand and using the Ruby Whois gem.

Example Domain Lookup

{
  "domain": "jamesperet.com",
  "owner": "James Peret",
  "registrar": "eNom Inc.",
  "expires_on": "2016-06-07T16:01:00.00Z",
  "update_on": "2015-05-13 00:00:00 -0300",
  "registered?": true,
  "available?": false
}

Accessing the API

Provide a url for the API and get a nicely formatted JSON response with the domain information.

Browser

http://whois.j1x.co
http://whois.j1x.co/lookup.json?url=jamesperet.com

curl

curl http://whois.j1x.co/lookup.json?url=jamesperet.com

Query Options

This are the options for querying the API:

  • url - The domain url that will be queried. Omit the http://www..
  • raw=true - the JSON response will include a raw version of the data received by the registrar
  • dev=true - Only basic information and the raw version will be included in the JSON response. No parsing will be done with the data. This is useful for debugging.

Example:

http://whois.j1x.co/lookup.json?url=google.com&raw=true

Install

Clone

git clone git://gitlab.j1x.co/j1x/whois-server.git

Restrict It

Edit main.rb:

before do
  response['Access-Control-Allow-Origin'] = 'http://yourwebsite.com'
end

Or use * to allow any website to access the API.

Deploy It

heroku create
git push heroku master
heroku open

Domain Support

For now the supported domains are: .com, .net, .com.br and .network. Support for more domains will come in the future.

The queries for .com.br domains usually come with limited information because of the registrar's API call allowance.

There is also a bug where some .com domains return an error (ex: google.com).

Development Resources

Tools

  • Rubular - a Ruby regular expression editor

Articles