Giter Site home page Giter Site logo

whois.ex's Introduction

Whois Build Status

Pure Elixir WHOIS client and parser.

This library currently supports querying .com, .net, and .org WHOIS servers, and parsing the registrar, nameservers, and created_at, updated_at, and expires_at dates.

Installation

Add whois to your list of dependencies in mix.exs:

def deps do
  [{:whois, "~> 0.1.0"}]
end

Usage

iex(1)> Whois.lookup("google.com")
{:ok,
 %Whois.Record{
   contacts: %{
     administrator: %Whois.Contact{
       city: "Mountain View",
       country: "US",
       email: "[email protected]",
       fax: "+1.6502530001",
       name: "Domain Administrator",
       organization: "Google LLC",
       phone: "+1.6502530000",
       state: "CA",
       street: "1600 Amphitheatre Parkway,",
       zip: "94043"
     },
     registrant: %Whois.Contact{
       city: "Mountain View",
       country: "US",
       email: "[email protected]",
       fax: "+1.6502530001",
       name: "Domain Administrator",
       organization: "Google LLC",
       phone: "+1.6502530000",
       state: "CA",
       street: "1600 Amphitheatre Parkway,",
       zip: "94043"
     },
     technical: %Whois.Contact{
       city: "Mountain View",
       country: "US",
       email: "[email protected]",
       fax: "+1.6502530001",
       name: "Domain Administrator",
       organization: "Google LLC",
       phone: "+1.6502530000",
       state: "CA",
       street: "1600 Amphitheatre Parkway,",
       zip: "94043"
     }
   },
   created_at: ~N[1997-09-15 00:00:00],
   domain: "google.com",
   expires_at: ~N[2020-09-14 04:00:00],
   nameservers: ["ns1.google.com", "ns2.google.com", "ns3.google.com",
    "ns4.google.com"],
   raw: "…",
   registrar: "MarkMonitor, Inc.",
   updated_at: ~N[2018-02-21 10:45:07]
 }}

whois.ex's People

Contributors

utkarshkukreti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

whois.ex's Issues

Additional WHOIS lookup Servers

Hi,

Nice work on your library - I’ve added a bunch of TLD servers that we added on a similar Elixir WHOIS project exwhois.
Courtesy of iwantmyname

Wasn't able to submit a pull request so here they are:

@spec all :: map
  def all do
    %{
      "com" => %Server{host: "whois.verisign-grs.com", prefix: "="},
      "net" => %Server{host: "whois.verisign-grs.com"},
      "org" => %Server{host: "whois.pir.org"},
      "abogado"=> %Server{host: "whois-dub.mm-registry.com"},
      "ac"=> %Server{host: "whois.nic.ac"},
      "academy"=> %Server{host: "whois.donuts.co"},
      "accountant"=> %Server{host: "whois.nic.accountant"},
      "accountants"=> %Server{host: "whois.donuts.co"},
      "actor"=> %Server{host: "whois.unitedtld.com"},
      "ads"=> %Server{host: "domain-registry-whois.l.google.com"},
      "adult"=> %Server{host: "whois.afilias-srs.net"},
      "ae"=> %Server{host: "whois.aeda.net.ae"},
      "aero"=> %Server{host: "whois.aero"},
      "af"=> %Server{host: "whois.nic.af"},
      "ag"=> %Server{host: "whois.nic.ag"},
      "agency"=> %Server{host: "whois.donuts.co"},
      "ai"=> %Server{host: "whois.ai"},
      "airforce"=> %Server{host: "whois.unitedtld.com"},
      "alsace"=> %Server{host: "whois-alsace.nic.fr"},
      "am"=> %Server{host: "whois.amnic.net"},
      "apartments"=> %Server{host: "whois.donuts.co"},
      "app"=> %Server{host: "whois.nic.google"},
      "archi"=> %Server{host: "whois.ksregistry.net"},
      "army"=> %Server{host: "whois.rightside.co"},
      "as"=> %Server{host: "whois.nic.as"},
      "asia"=> %Server{host: "whois.nic.asia"},
      "associates"=> %Server{host: "whois.donuts.co"},
      "at"=> %Server{host: "whois.nic.at"},
      "attorney"=> %Server{host: "whois.rightside.co"},
      "auction"=> %Server{host: "whois.unitedtld.com"},
      "audio"=> %Server{host: "whois.uniregistry.net"},
      "auto"=> %Server{host: "whois.uniregistry.net"},
      "aw"=> %Server{host: "whois.nic.aw"},
      "ax"=> %Server{host: "whois.ax"},
      "band"=> %Server{host: "whois.rightside.co"},
      "bar"=> %Server{host: "whois.nic.bar"},
      "barcelona"=> %Server{host: "whois.nic.barcelona"},
      "bargains"=> %Server{host: "whois.donuts.co"},
      "bayern"=> %Server{host: "whois-dub.mm-registry.com"},
      "be"=> %Server{host: "whois.dns.be"},
      "beer"=> %Server{host: "whois-dub.mm-registry.com"},
      "berlin"=> %Server{host: "whois.nic.berlin"},
      "best"=> %Server{host: "whois.nic.best"},
      "bet"=> %Server{host: "whois.afilias.net"},
      "bg"=> %Server{host: "whois.register.bg"},
      "bi"=> %Server{host: "whois1.nic.bi"},
      "bid"=> %Server{host: "whois.nic.bid"},
      "bike"=> %Server{host: "whois.donuts.co"},
      "bingo"=> %Server{host: "whois.donuts.co"},
      "bio"=> %Server{host: "whois.ksregistry.net"},
      "biz"=> %Server{host: "whois.biz"},
      "bj"=> %Server{host: "whois.nic.bj"},
      "black"=> %Server{host: "whois.afilias.net"},
      "blackfriday"=> %Server{host: "whois.uniregistry.net"},
      "blue"=> %Server{host: "whois.afilias.net"},
      "bn"=> %Server{host: "whois.bnnic.bn"},
      "bo"=> %Server{host: "whois.nic.bo"},
      "boats"=> %Server{host: "whois.afilias-srs.net"},
      "boo"=> %Server{host: "domain-registry-whois.l.google.com"},
      "boutique"=> %Server{host: "whois.donuts.co"},
      "br"=> %Server{host: "whois.registro.br"},
      "broker"=> %Server{host: "whois.nic.broker"},
      "brussels"=> %Server{host: "whois.nic.brussels"},
      "budapest"=> %Server{host: "whois-dub.mm-registry.com"},
      "build"=> %Server{host: "whois.nic.build"},
      "builders"=> %Server{host: "whois.donuts.co"},
      "business"=> %Server{host: "whois.donuts.co"},
      "bw"=> %Server{host: "whois.nic.net.bw"},
      "by"=> %Server{host: "whois.cctld.by"},
      "bzh"=> %Server{host: "whois-bzh.nic.fr"},
      "ca"=> %Server{host: "whois.cira.ca"},
      "cab"=> %Server{host: "whois.donuts.co"},
      "cafe"=> %Server{host: "whois.donuts.co"},
      "camera"=> %Server{host: "whois.donuts.co"},
      "camp"=> %Server{host: "whois.donuts.co"},
      "capetown"=> %Server{host: "capetown-whois.registry.net.za"},
      "capital"=> %Server{host: "whois.donuts.co"},
      "car"=> %Server{host: "whois.uniregistry.net"},
      "cards"=> %Server{host: "whois.donuts.co"},
      "care"=> %Server{host: "whois.donuts.co"},
      "career"=> %Server{host: "whois.nic.career"},
      "careers"=> %Server{host: "whois.donuts.co"},
      "cars"=> %Server{host: "whois.uniregistry.net"},
      "casa"=> %Server{host: "whois-dub.mm-registry.com"},
      "cash"=> %Server{host: "whois.donuts.co"},
      "casino"=> %Server{host: "whois.donuts.co"},
      "cat"=> %Server{host: "whois.cat"},
      "catering"=> %Server{host: "whois.donuts.co"},
      "cc"=> %Server{host: "ccwhois.verisign-grs.com"},
      "center"=> %Server{host: "whois.donuts.co"},
      "ceo"=> %Server{host: "whois.nic.ceo"},
      "cf"=> %Server{host: "whois.dot.cf"},
      "ch"=> %Server{host: "whois.nic.ch"},
      "chat"=> %Server{host: "whois.donuts.co"},
      "cheap"=> %Server{host: "whois.donuts.co"},
      "christmas"=> %Server{host: "whois.uniregistry.net"},
      "church"=> %Server{host: "whois.donuts.co"},
      "ci"=> %Server{host: "whois.nic.ci"},
      "city"=> %Server{host: "whois.donuts.co"},
      "cl"=> %Server{host: "whois.nic.cl"},
      "claims"=> %Server{host: "whois.donuts.co"},
      "cleaning"=> %Server{host: "whois.donuts.co"},
      "click"=> %Server{host: "whois.uniregistry.net"},
      "clinic"=> %Server{host: "whois.donuts.co"},
      "clothing"=> %Server{host: "whois.donuts.co"},
      "cloud"=> %Server{host: "whois.nic.cloud"},
      "club"=> %Server{host: "whois.nic.club"},
      "cn"=> %Server{host: "whois.cnnic.cn"},
      "co"=> %Server{host: "whois.nic.co"},
      "coach"=> %Server{host: "whois.donuts.co"},
      "codes"=> %Server{host: "whois.donuts.co"},
      "coffee"=> %Server{host: "whois.donuts.co"},
      "college"=> %Server{host: "whois.nic.college"},
      "cologne"=> %Server{host: "whois-fe1.pdt.cologne.tango.knipp.de"},
      "community"=> %Server{host: "whois.donuts.co"},
      "company"=> %Server{host: "whois.donuts.co"},
      "computer"=> %Server{host: "whois.donuts.co"},
      "condos"=> %Server{host: "whois.donuts.co"},
      "construction"=> %Server{host: "whois.donuts.co"},
      "consulting"=> %Server{host: "whois.unitedtld.com"},
      "contractors"=> %Server{host: "whois.donuts.co"},
      "cooking"=> %Server{host: "whois-dub.mm-registry.com"},
      "cool"=> %Server{host: "whois.donuts.co"},
      "coop"=> %Server{host: "whois.nic.coop"},
      "corsica"=> %Server{host: "whois-corsica.nic.fr"},
      "country"=> %Server{host: "whois-dub.mm-registry.com"},
      "coupons"=> %Server{host: "whois.donuts.co"},
      "courses"=> %Server{host: "whois.aridnrs.net.au"},
      "cr"=> %Server{host: "whois.nic.cr"},
      "credit"=> %Server{host: "whois.donuts.co"},
      "cricket"=> %Server{host: "whois.nic.cricket"},
      "cruises"=> %Server{host: "whois.donuts.co"},
      "cx"=> %Server{host: "whois.nic.cx"},
      "cymru"=> %Server{host: "whois.nic.cymru"},
      "cz"=> %Server{host: "whois.nic.cz"},
      "dad"=> %Server{host: "domain-registry-whois.l.google.com"},
      "dance"=> %Server{host: "whois.unitedtld.com"},
      "date"=> %Server{host: "whois.nic.date"},
      "dating"=> %Server{host: "whois.donuts.co"},
      "day"=> %Server{host: "domain-registry-whois.l.google.com"},
      "de"=> %Server{host: "whois.denic.de"},
      "deals"=> %Server{host: "whois.donuts.co"},
      "degree"=> %Server{host: "whois.rightside.co"},
      "delivery"=> %Server{host: "whois.donuts.co"},
      "democrat"=> %Server{host: "whois.unitedtld.com"},
      "dental"=> %Server{host: "whois.donuts.co"},
      "dentist"=> %Server{host: "whois.rightside.co"},
      "desi"=> %Server{host: "whois.ksregistry.net"},
      "design"=> %Server{host: "whois.nic.design"},
      "diamonds"=> %Server{host: "whois.donuts.co"},
      "diet"=> %Server{host: "whois.uniregistry.net"},
      "digital"=> %Server{host: "whois.donuts.co"},
      "direct"=> %Server{host: "whois.donuts.co"},
      "directory"=> %Server{host: "whois.donuts.co"},
      "discount"=> %Server{host: "whois.donuts.co"},
      "dk"=> %Server{host: "whois.dk-hostmaster.dk"},
      "dm"=> %Server{host: "whois.nic.dm"},
      "docs"=> %Server{host: "domain-registry-whois.l.google.com"},
      "dog"=> %Server{host: "whois.donuts.co"},
      "domains"=> %Server{host: "whois.donuts.co"},
      "download"=> %Server{host: "whois.nic.download"},
      "durban"=> %Server{host: "durban-whois.registry.net.za"},
      "dz"=> %Server{host: "whois.nic.dz"},
      "eat"=> %Server{host: "domain-registry-whois.l.google.com"},
      "ec"=> %Server{host: "whois.nic.ec"},
      "edu"=> %Server{host: "whois.educause.edu"},
      "education"=> %Server{host: "whois.donuts.co"},
      "ee"=> %Server{host: "whois.tld.ee"},
      "email"=> %Server{host: "whois.donuts.co"},
      "energy"=> %Server{host: "whois.donuts.co"},
      "engineer"=> %Server{host: "whois.rightside.co"},
      "engineering"=> %Server{host: "whois.donuts.co"},
      "enterprises"=> %Server{host: "whois.donuts.co"},
      "equipment"=> %Server{host: "whois.donuts.co"},
      "es"=> %Server{host: "whois.nic.es"},
      "estate"=> %Server{host: "whois.donuts.co"},
      "eu"=> %Server{host: "whois.eu"},
      "eus"=> %Server{host: "whois.eus.coreregistry.net"},
      "events"=> %Server{host: "whois.donuts.co"},
      "exchange"=> %Server{host: "whois.donuts.co"},
      "expert"=> %Server{host: "whois.donuts.co"},
      "exposed"=> %Server{host: "whois.donuts.co"},
      "express"=> %Server{host: "whois.donuts.co"},
      "fail"=> %Server{host: "whois.donuts.co"},
      "faith"=> %Server{host: "whois.nic.faith"},
      "family"=> %Server{host: "whois.rightside.co"},
      "fan"=> %Server{host: "whois.nic.fan"},
      "fans"=> %Server{host: "whois.nic.fans"},
      "farm"=> %Server{host: "whois.donuts.co"},
      "fashion"=> %Server{host: "whois-dub.mm-registry.com"},
      "feedback"=> %Server{host: "whois.nic.feedback"},
      "fi"=> %Server{host: "whois.fi"},
      "film"=> %Server{host: "whois.nic.film"},
      "final"=> %Server{host: "whois.gtlds.nic.br"},
      "finance"=> %Server{host: "whois.donuts.co"},
      "financial"=> %Server{host: "whois.donuts.co"},
      "fish"=> %Server{host: "whois.donuts.co"},
      "fishing"=> %Server{host: "whois-dub.mm-registry.com"},
      "fit"=> %Server{host: "whois-dub.mm-registry.com"},
      "fitness"=> %Server{host: "whois.donuts.co"},
      "flights"=> %Server{host: "whois.donuts.co"},
      "florist"=> %Server{host: "whois.donuts.co"},
      "flowers"=> %Server{host: "whois.uniregistry.net"},
      "fly"=> %Server{host: "domain-registry-whois.l.google.com"},
      "fo"=> %Server{host: "whois.nic.fo"},
      "foo"=> %Server{host: "domain-registry-whois.l.google.com"},
      "football"=> %Server{host: "whois.donuts.co"},
      "forsale"=> %Server{host: "whois.unitedtld.com"},
      "forum"=> %Server{host: "whois.nic.forum"},
      "foundation"=> %Server{host: "whois.donuts.co"},
      "fr"=> %Server{host: "whois.nic.fr"},
      "frl"=> %Server{host: "whois.nic.frl"},
      "fund"=> %Server{host: "whois.donuts.co"},
      "furniture"=> %Server{host: "whois.donuts.co"},
      "futbol"=> %Server{host: "whois.unitedtld.com"},
      "fyi"=> %Server{host: "whois.donuts.co"},
      "gal"=> %Server{host: "whois.gal.coreregistry.net"},
      "gallery"=> %Server{host: "whois.donuts.co"},
      "game"=> %Server{host: "whois.uniregistry.net"},
      "garden"=> %Server{host: "whois-dub.mm-registry.com"},
      "gd"=> %Server{host: "whois.nic.gd"},
      "gent"=> %Server{host: "whois.nic.gent"},
      "gg"=> %Server{host: "whois.gg"},
      "gi"=> %Server{host: "whois2.afilias-grs.net"},
      "gift"=> %Server{host: "whois.uniregistry.net"},
      "gifts"=> %Server{host: "whois.donuts.co"},
      "gives"=> %Server{host: "whois.rightside.co"},
      "gl"=> %Server{host: "whois.nic.gl"},
      "glass"=> %Server{host: "whois.donuts.co"},
      "global"=> %Server{host: "whois.nic.global"},
      "gold"=> %Server{host: "whois.donuts.co"},
      "golf"=> %Server{host: "whois.donuts.co"},
      "gov"=> %Server{host: "whois.dotgov.gov"},
      "gq"=> %Server{host: "whois.dominio.gq"},
      "graphics"=> %Server{host: "whois.donuts.co"},
      "gratis"=> %Server{host: "whois.donuts.co"},
      "green"=> %Server{host: "whois.afilias.net"},
      "gripe"=> %Server{host: "whois.donuts.co"},
      "group"=> %Server{host: "whois.donuts.co"},
      "gs"=> %Server{host: "whois.nic.gs"},
      "guide"=> %Server{host: "whois.donuts.co"},
      "guitars"=> %Server{host: "whois.uniregistry.net"},
      "guru"=> %Server{host: "whois.donuts.co"},
      "gy"=> %Server{host: "whois.registry.gy"},
      "hamburg"=> %Server{host: "whois.nic.hamburg"},
      "haus"=> %Server{host: "whois.unitedtld.com"},
      "healthcare"=> %Server{host: "whois.donuts.co"},
      "help"=> %Server{host: "whois.uniregistry.net"},
      "here"=> %Server{host: "domain-registry-whois.l.google.com"},
      "hiphop"=> %Server{host: "whois.uniregistry.net"},
      "hiv"=> %Server{host: "whois.afilias-srs.net"},
      "hk"=> %Server{host: "whois.hkirc.hk"},
      "hm"=> %Server{host: "whois.registry.hm"},
      "hn"=> %Server{host: "whois.nic.hn"},
      "hockey"=> %Server{host: "whois.donuts.co"},
      "holdings"=> %Server{host: "whois.donuts.co"},
      "holiday"=> %Server{host: "whois.donuts.co"},
      "horse"=> %Server{host: "whois-dub.mm-registry.com"},
      "host"=> %Server{host: "whois.nic.host"},
      "hosting"=> %Server{host: "whois.uniregistry.net"},
      "house"=> %Server{host: "whois.donuts.co"},
      "how"=> %Server{host: "domain-registry-whois.l.google.com"},
      "hr"=> %Server{host: "whois.dns.hr"},
      "ht"=> %Server{host: "whois.nic.ht"},
      "hu"=> %Server{host: "whois.nic.hu"},
      "id"=> %Server{host: "whois.pandi.or.id"},
      "ie"=> %Server{host: "whois.domainregistry.ie"},
      "il"=> %Server{host: "whois.isoc.org.il"},
      "im"=> %Server{host: "whois.nic.im"},
      "immo"=> %Server{host: "whois.donuts.co"},
      "immobilien"=> %Server{host: "whois.unitedtld.com"},
      "in"=> %Server{host: "whois.inregistry.net"},
      "industries"=> %Server{host: "whois.donuts.co"},
      "info"=> %Server{host: "whois.afilias.net"},
      "ing"=> %Server{host: "domain-registry-whois.l.google.com"},
      "ink"=> %Server{host: "whois.centralnic.com"},
      "institute"=> %Server{host: "whois.donuts.co"},
      "insure"=> %Server{host: "whois.donuts.co"},
      "int"=> %Server{host: "whois.iana.org"},
      "international"=> %Server{host: "whois.donuts.co"},
      "investments"=> %Server{host: "whois.donuts.co"},
      "io"=> %Server{host: "whois.nic.io"},
      "iq"=> %Server{host: "whois.cmc.iq"},
      "ir"=> %Server{host: "whois.nic.ir"},
      "is"=> %Server{host: "whois.isnic.is"},
      "it"=> %Server{host: "whois.nic.it"},
      "je"=> %Server{host: "whois.je"},
      "jewelry"=> %Server{host: "whois.donuts.co"},
      "jobs"=> %Server{host: "jobswhois.verisign-grs.com"},
      "joburg"=> %Server{host: "joburg-whois.registry.net.za"},
      "jp"=> %Server{host: "whois.jprs.jp"},
      "juegos"=> %Server{host: "whois.uniregistry.net"},
      "kaufen"=> %Server{host: "whois.unitedtld.com"},
      "ke"=> %Server{host: "whois.kenic.or.ke"},
      "kg"=> %Server{host: "whois.domain.kg"},
      "ki"=> %Server{host: "whois.nic.ki"},
      "kim"=> %Server{host: "whois.afilias.net"},
      "kitchen"=> %Server{host: "whois.donuts.co"},
      "kiwi"=> %Server{host: "whois.nic.kiwi"},
      "koeln"=> %Server{host: "whois-fe1.pdt.koeln.tango.knipp.de"},
      "kr"=> %Server{host: "whois.kr"},
      "krd"=> %Server{host: "whois.aridnrs.net.au"},
      "ky"=> %Server{host: "whois.kyregistry.ky"},
      "kyoto"=> %Server{host: "whois.nic.kyoto"},
      "kz"=> %Server{host: "whois.nic.kz"},
      "la"=> %Server{host: "whois.nic.la"},
      "land"=> %Server{host: "whois.donuts.co"},
      "lat"=> %Server{host: "whois.nic.lat"},
      "law"=> %Server{host: "whois-dub.mm-registry.com"},
      "lawyer"=> %Server{host: "whois.rightside.co"},
      "lease"=> %Server{host: "whois.donuts.co"},
      "legal"=> %Server{host: "whois.donuts.co"},
      "lgbt"=> %Server{host: "whois.afilias.net"},
      "li"=> %Server{host: "whois.nic.li"},
      "life"=> %Server{host: "whois.donuts.co"},
      "lighting"=> %Server{host: "whois.donuts.co"},
      "limited"=> %Server{host: "whois.donuts.co"},
      "limo"=> %Server{host: "whois.donuts.co"},
      "link"=> %Server{host: "whois.uniregistry.net"},
      "live"=> %Server{host: "whois.rightside.co"},
      "loan"=> %Server{host: "whois.nic.loan"},
      "loans"=> %Server{host: "whois.donuts.co"},
      "lol"=> %Server{host: "whois.uniregistry.net"},
      "london"=> %Server{host: "whois-lon.mm-registry.com"},
      "love"=> %Server{host: "whois.nic.love"},
      "lt"=> %Server{host: "whois.domreg.lt"},
      "ltd"=> %Server{host: "whois.donuts.co"},
      "ltda"=> %Server{host: "whois.afilias-srs.net"},
      "lu"=> %Server{host: "whois.dns.lu"},
      "luxe"=> %Server{host: "whois-dub.mm-registry.com"},
      "luxury"=> %Server{host: "whois.nic.luxury"},
      "lv"=> %Server{host: "whois.nic.lv"},
      "ly"=> %Server{host: "whois.nic.ly"},
      "ma"=> %Server{host: "whois.registre.ma"},
      "madrid"=> %Server{host: "whois.madrid.rs.corenic.net"},
      "maison"=> %Server{host: "whois.donuts.co"},
      "management"=> %Server{host: "whois.donuts.co"},
      "market"=> %Server{host: "whois.rightside.co"},
      "marketing"=> %Server{host: "whois.donuts.co"},
      "mba"=> %Server{host: "whois.donuts.co"},
      "md"=> %Server{host: "whois.nic.md"},
      "me"=> %Server{host: "whois.nic.me"},
      "media"=> %Server{host: "whois.donuts.co"},
      "meet"=> %Server{host: "whois.afilias.net"},
      "melbourne"=> %Server{host: "whois.aridnrs.net.au"},
      "meme"=> %Server{host: "domain-registry-whois.l.google.com"},
      "memorial"=> %Server{host: "whois.donuts.co"},
      "men"=> %Server{host: "whois.nic.men"},
      "menu"=> %Server{host: "whois.nic.menu"},
      "mg"=> %Server{host: "whois.nic.mg"},
      "miami"=> %Server{host: "whois-dub.mm-registry.com"},
      "mk"=> %Server{host: "whois.marnet.mk"},
      "ml"=> %Server{host: "whois.dot.ml"},
      "mn"=> %Server{host: "whois.nic.mn"},
      "mo"=> %Server{host: "whois.monic.mo"},
      "mobi"=> %Server{host: "whois.dotmobiregistry.net"},
      "moda"=> %Server{host: "whois.unitedtld.com"},
      "moe"=> %Server{host: "whois.nic.moe"},
      "mom"=> %Server{host: "whois.uniregistry.net"},
      "money"=> %Server{host: "whois.donuts.co"},
      "mortgage"=> %Server{host: "whois.rightside.co"},
      "moscow"=> %Server{host: "whois.nic.moscow"},
      "mov"=> %Server{host: "domain-registry-whois.l.google.com"},
      "mp"=> %Server{host: "whois.nic.mp"},
      "ms"=> %Server{host: "whois.nic.ms"},
      "mu"=> %Server{host: "whois.nic.mu"},
      "museum"=> %Server{host: "whois.museum"},
      "mx"=> %Server{host: "whois.mx"},
      "my"=> %Server{host: "whois.mynic.my"},
      "mz"=> %Server{host: "whois.nic.mz"},
      "na"=> %Server{host: "whois.na-nic.com.na"},
      "name"=> %Server{host: "whois.nic.name"},
      "navy"=> %Server{host: "whois.rightside.co"},
      "nc"=> %Server{host: "whois.nc"},
      "network"=> %Server{host: "whois.donuts.co"},
      "new"=> %Server{host: "domain-registry-whois.l.google.com"},
      "news"=> %Server{host: "whois.rightside.co"},
      "nf"=> %Server{host: "whois.nic.nf"},
      "ng"=> %Server{host: "whois.nic.net.ng"},
      "ngo"=> %Server{host: "whois.publicinterestregistry.net"},
      "ninja"=> %Server{host: "whois.unitedtld.com"},
      "nl"=> %Server{host: "whois.domain-registry.nl"},
      "no"=> %Server{host: "whois.norid.no"},
      "nrw"=> %Server{host: "whois.nic.nrw"},
      "nu"=> %Server{host: "whois.iis.nu"},
      "nz"=> %Server{host: "whois.srs.net.nz"},
      "om"=> %Server{host: "whois.registry.om"},
      "one"=> %Server{host: "whois.nic.one"},
      "ong"=> %Server{host: "whois.publicinterestregistry.net"},
      "onl"=> %Server{host: "whois.afilias-srs.net"},
      "online"=> %Server{host: "whois.centralnic.com"},
      "organic"=> %Server{host: "whois.afilias.net"},
      "osaka"=> %Server{host: "whois.nic.osaka"},
      "paris"=> %Server{host: "whois-paris.nic.fr"},
      "partners"=> %Server{host: "whois.donuts.co"},
      "parts"=> %Server{host: "whois.donuts.co"},
      "party"=> %Server{host: "whois.nic.party"},
      "pe"=> %Server{host: "kero.yachay.pe"},
      "pet"=> %Server{host: "whois.afilias.net"},
      "pf"=> %Server{host: "whois.registry.pf"},
      "photo"=> %Server{host: "whois.uniregistry.net"},
      "photography"=> %Server{host: "whois.donuts.co"},
      "photos"=> %Server{host: "whois.donuts.co"},
      "physio"=> %Server{host: "whois.nic.physio"},
      "pics"=> %Server{host: "whois.uniregistry.net"},
      "pictures"=> %Server{host: "whois.donuts.co"},
      "pink"=> %Server{host: "whois.afilias.net"},
      "pizza"=> %Server{host: "whois.donuts.co"},
      "pl"=> %Server{host: "whois.dns.pl"},
      "place"=> %Server{host: "whois.donuts.co"},
      "play"=> %Server{host: "whois.nic.google"},
      "plumbing"=> %Server{host: "whois.donuts.co"},
      "plus"=> %Server{host: "whois.donuts.co"},
      "pm"=> %Server{host: "whois.nic.pm"},
      "poker"=> %Server{host: "whois.afilias.net"},
      "porn"=> %Server{host: "whois.afilias-srs.net"},
      "pr"=> %Server{host: "whois.nic.pr"},
      "press"=> %Server{host: "whois.nic.press"},
      "pro"=> %Server{host: "whois.dotproregistry.net"},
      "productions"=> %Server{host: "whois.donuts.co"},
      "properties"=> %Server{host: "whois.donuts.co"},
      "property"=> %Server{host: "whois.uniregistry.net"},
      "pt"=> %Server{host: "whois.dns.pt"},
      "pub"=> %Server{host: "whois.unitedtld.com"},
      "pw"=> %Server{host: "whois.nic.pw"},
      "qa"=> %Server{host: "whois.registry.qa"},
      "quebec"=> %Server{host: "whois.nic.quebec"},
      "racing"=> %Server{host: "whois.nic.racing"},
      "re"=> %Server{host: "whois.nic.re"},
      "realty"=> %Server{host: "whois.nic.realty"},
      "recipes"=> %Server{host: "whois.donuts.co"},
      "red"=> %Server{host: "whois.afilias.net"},
      "rehab"=> %Server{host: "whois.rightside.co"},
      "reise"=> %Server{host: "whois.nic.reise"},
      "reisen"=> %Server{host: "whois.donuts.co"},
      "rent"=> %Server{host: "whois.nic.rent"},
      "rentals"=> %Server{host: "whois.donuts.co"},
      "repair"=> %Server{host: "whois.donuts.co"},
      "report"=> %Server{host: "whois.donuts.co"},
      "republican"=> %Server{host: "whois.rightside.co"},
      "rest"=> %Server{host: "whois.nic.rest"},
      "restaurant"=> %Server{host: "whois.donuts.co"},
      "review"=> %Server{host: "whois.nic.review"},
      "reviews"=> %Server{host: "whois.unitedtld.com"},
      "rich"=> %Server{host: "whois.afilias-srs.net"},
      "rip"=> %Server{host: "whois.rightside.co"},
      "ro"=> %Server{host: "whois.rotld.ro"},
      "rocks"=> %Server{host: "whois.unitedtld.com"},
      "rodeo"=> %Server{host: "whois-dub.mm-registry.com"},
      "rs"=> %Server{host: "whois.rnids.rs"},
      "rsvp"=> %Server{host: "domain-registry-whois.l.google.com"},
      "ru"=> %Server{host: "whois.tcinet.ru"},
      "ruhr"=> %Server{host: "whois.nic.ruhr"},
      "run"=> %Server{host: "whois.donuts.co"},
      "sa"=> %Server{host: "whois.nic.net.sa"},
      "saarland"=> %Server{host: "whois.ksregistry.net"},
      "sale"=> %Server{host: "whois.rightside.co"},
      "sarl"=> %Server{host: "whois.donuts.co"},
      "sb"=> %Server{host: "whois.nic.net.sb"},
      "sc"=> %Server{host: "whois2.afilias-grs.net"},
      "school"=> %Server{host: "whois.donuts.co"},
      "schule"=> %Server{host: "whois.donuts.co"},
      "science"=> %Server{host: "whois.nic.science"},
      "scot"=> %Server{host: "whois.scot.coreregistry.net"},
      "se"=> %Server{host: "whois.iis.se"},
      "services"=> %Server{host: "whois.donuts.co"},
      "sexy"=> %Server{host: "whois.uniregistry.net"},
      "sg"=> %Server{host: "whois.sgnic.sg"},
      "sh"=> %Server{host: "whois.nic.sh"},
      "shiksha"=> %Server{host: "whois.afilias.net"},
      "shoes"=> %Server{host: "whois.donuts.co"},
      "show"=> %Server{host: "whois.donuts.co"},
      "si"=> %Server{host: "whois.register.si"},
      "singles"=> %Server{host: "whois.donuts.co"},
      "site"=> %Server{host: "whois.centralnic.com"},
      "sk"=> %Server{host: "whois.sk-nic.sk"},
      "ski"=> %Server{host: "whois.ksregistry.net"},
      "sm"=> %Server{host: "whois.nic.sm"},
      "sn"=> %Server{host: "whois.nic.sn"},
      "so"=> %Server{host: "whois.nic.so"},
      "soccer"=> %Server{host: "whois.donuts.co"},
      "social"=> %Server{host: "whois.unitedtld.com"},
      "software"=> %Server{host: "whois.rightside.co"},
      "solar"=> %Server{host: "whois.donuts.co"},
      "solutions"=> %Server{host: "whois.donuts.co"},
      "soy"=> %Server{host: "domain-registry-whois.l.google.com"},
      "space"=> %Server{host: "whois.nic.space"},
      "st"=> %Server{host: "whois.nic.st"},
      "studio"=> %Server{host: "whois.rightside.co"},
      "study"=> %Server{host: "whois.nic.study"},
      "style"=> %Server{host: "whois.donuts.co"},
      "su"=> %Server{host: "whois.tcinet.ru"},
      "supplies"=> %Server{host: "whois.donuts.co"},
      "supply"=> %Server{host: "whois.donuts.co"},
      "support"=> %Server{host: "whois.donuts.co"},
      "surf"=> %Server{host: "whois-dub.mm-registry.com"},
      "surgery"=> %Server{host: "whois.donuts.co"},
      "swiss"=> %Server{host: "whois.nic.swiss"},
      "sx"=> %Server{host: "whois.sx"},
      "sy"=> %Server{host: "whois.tld.sy"},
      "sydney"=> %Server{host: "whois.nic.sydney"},
      "systems"=> %Server{host: "whois.donuts.co"},
      "taipei"=> %Server{host: "whois.nic.taipei"},
      "tattoo"=> %Server{host: "whois.uniregistry.net"},
      "tax"=> %Server{host: "whois.donuts.co"},
      "taxi"=> %Server{host: "whois.donuts.co"},
      "tc"=> %Server{host: "whois.nic.tc"},
      "team"=> %Server{host: "whois.donuts.co"},
      "tech"=> %Server{host: "whois.nic.tech"},
      "technology"=> %Server{host: "whois.donuts.co"},
      "tel"=> %Server{host: "whois.nic.tel"},
      "tennis"=> %Server{host: "whois.donuts.co"},
      "tf"=> %Server{host: "whois.nic.tf"},
      "theater"=> %Server{host: "whois.donuts.co"},
      "tienda"=> %Server{host: "whois.donuts.co"},
      "tips"=> %Server{host: "whois.donuts.co"},
      "tires"=> %Server{host: "whois.donuts.co"},
      "tirol"=> %Server{host: "whois.nic.tirol"},
      "tk"=> %Server{host: "whois.dot.tk"},
      "tl"=> %Server{host: "whois.nic.tl"},
      "tm"=> %Server{host: "whois.nic.tm"},
      "tn"=> %Server{host: "whois.ati.tn"},
      "to"=> %Server{host: "whois.tonic.to"},
      "today"=> %Server{host: "whois.donuts.co"},
      "tools"=> %Server{host: "whois.donuts.co"},
      "top"=> %Server{host: "whois.nic.top"},
      "tours"=> %Server{host: "whois.donuts.co"},
      "town"=> %Server{host: "whois.donuts.co"},
      "toys"=> %Server{host: "whois.donuts.co"},
      "tr"=> %Server{host: "whois.nic.tr"},
      "trade"=> %Server{host: "whois.nic.trade"},
      "trading"=> %Server{host: "whois.nic.trading"},
      "training"=> %Server{host: "whois.donuts.co"},
      "travel"=> %Server{host: "whois.nic.travel"},
      "tv"=> %Server{host: "tvwhois.verisign-grs.com"},
      "tw"=> %Server{host: "whois.twnic.net.tw"},
      "tz"=> %Server{host: "whois.tznic.or.tz"},
      "ua"=> %Server{host: "whois.ua"},
      "ug"=> %Server{host: "whois.co.ug"},
      "uk"=> %Server{host: "whois.nic.uk"},
      "university"=> %Server{host: "whois.donuts.co"},
      "us"=> %Server{host: "whois.nic.us"},
      "uy"=> %Server{host: "whois.nic.org.uy"},
      "uz"=> %Server{host: "whois.cctld.uz"},
      "vacations"=> %Server{host: "whois.donuts.co"},
      "vc"=> %Server{host: "whois2.afilias-grs.net"},
      "ve"=> %Server{host: "whois.nic.ve"},
      "vegas"=> %Server{host: "whois.afilias-srs.net"},
      "ventures"=> %Server{host: "whois.donuts.co"},
      "versicherung"=> %Server{host: "whois.nic.versicherung"},
      "vet"=> %Server{host: "whois.rightside.co"},
      "vg"=> %Server{host: "whois.nic.vg"},
      "viajes"=> %Server{host: "whois.donuts.co"},
      "video"=> %Server{host: "whois.rightside.co"},
      "villas"=> %Server{host: "whois.donuts.co"},
      "vin"=> %Server{host: "whois.donuts.co"},
      "vision"=> %Server{host: "whois.donuts.co"},
      "vlaanderen"=> %Server{host: "whois.nic.vlaanderen"},
      "vodka"=> %Server{host: "whois-dub.mm-registry.com"},
      "vote"=> %Server{host: "whois.afilias.net"},
      "voting"=> %Server{host: "whois.voting.tld-box.at"},
      "voto"=> %Server{host: "whois.afilias.net"},
      "voyage"=> %Server{host: "whois.donuts.co"},
      "vu"=> %Server{host: "vunic.vu"},
      "wales"=> %Server{host: "whois.nic.wales"},
      "wang"=> %Server{host: "whois.gtld.knet.cn"},
      "watch"=> %Server{host: "whois.donuts.co"},
      "webcam"=> %Server{host: "whois.nic.webcam"},
      "website"=> %Server{host: "whois.nic.website"},
      "wed"=> %Server{host: "whois.nic.wed"},
      "wedding"=> %Server{host: "whois-dub.mm-registry.com"},
      "wf"=> %Server{host: "whois.nic.wf"},
      "whoswho"=> %Server{host: "whois.nic.whoswho"},
      "wien"=> %Server{host: "whois.nic.wien"},
      "wiki"=> %Server{host: "whois.nic.wiki"},
      "win"=> %Server{host: "whois.nic.win"},
      "wine"=> %Server{host: "whois.donuts.co"},
      "work"=> %Server{host: "whois-dub.mm-registry.com"},
      "works"=> %Server{host: "whois.donuts.co"},
      "world"=> %Server{host: "whois.donuts.co"},
      "ws"=> %Server{host: "whois.website.ws"},
      "wtf"=> %Server{host: "whois.donuts.co"},
      "xn--3bst00m"=> %Server{host: "whois.gtld.knet.cn"},
      "xn--3ds443g"=> %Server{host: "whois.afilias-srs.net"},
      "xn--4gbrim"=> %Server{host: "whois.afilias-srs.net"},
      "xn--55qw42g"=> %Server{host: "whois.conac.cn"},
      "xn--6frz82g"=> %Server{host: "whois.afilias.net"},
      "xn--6qq986b3xl"=> %Server{host: "whois.gtld.knet.cn"},
      "xn--80adxhks"=> %Server{host: "whois.nic.xn--80adxhks"},
      "xn--80asehdb"=> %Server{host: "whois.online.rs.corenic.net"},
      "xn--80aswg"=> %Server{host: "whois.site.rs.corenic.net"},
      "xn--c1avg"=> %Server{host: "whois.publicinterestregistry.net"},
      "xn--czru2d"=> %Server{host: "whois.gtld.knet.cn"},
      "xn--fiq228c5hs"=> %Server{host: "whois.afilias-srs.net"},
      "xn--i1b6b1a6a2e"=> %Server{host: "whois.publicinterestregistry.net"},
      "xn--io0a7i"=> %Server{host: "whois.ngtld.cn"},
      "xn--kput3i"=> %Server{host: "whois.afilias-srs.net"},
      "xn--mgbab2bd"=> %Server{host: "whois.bazaar.coreregistry.net"},
      "xn--ngbc5azd"=> %Server{host: "whois.nic.xn--ngbc5azd"},
      "xn--nqv7f"=> %Server{host: "whois.publicinterestregistry.net"},
      "xn--nqv7fs00ema"=> %Server{host: "whois.publicinterestregistry.net"},
      "xn--p1acf"=> %Server{host: "whois.nic.xn--p1acf"},
      "xn--q9jyb4c"=> %Server{host: "domain-registry-whois.l.google.com"},
      "xn--ses554g"=> %Server{host: "whois.registry.knet.cn"},
      "xn--unup4y"=> %Server{host: "whois.donuts.co"},
      "xn--vhquv"=> %Server{host: "whois.donuts.co"},
      "xxx"=> %Server{host: "whois.nic.xxx"},
      "xyz"=> %Server{host: "whois.nic.xyz"},
      "yachts"=> %Server{host: "whois.afilias-srs.net"},
      "yoga"=> %Server{host: "whois-dub.mm-registry.com"},
      "yt"=> %Server{host: "whois.nic.yt"},
      "zip"=> %Server{host: "domain-registry-whois.l.google.com"},
      "zm"=> %Server{host: "whois.nic.zm"},
      "zone"=> %Server{host: "whois.donuts.co"}
    }
  end

:badarg error when querying .co domain names

iex> Whois.lookup("test.co")
** (exit) :badarg
    (kernel 8.0) gen_tcp.erl:171: :gen_tcp.connect/4
    (whois 0.1.1) lib/whois.ex:33: Whois.lookup_raw/2
    (whois 0.1.1) lib/whois.ex:47: Whois.lookup_raw/2
    (whois 0.1.1) lib/whois.ex:13: Whois.lookup/2

The next_server case call returns an empty string which then gets catched by the last clause attempting a new lookup with a server host name that is an empty string, thus throwing the above error.

Doesn't work with a number of domains

I appreciate on the README it states this only works with .com/.org etc, but based on the tld.csv which implies wider coverage, I thought I would raise an issue.

Here are some failing test cases:

  • "wikijob.co.uk"
  • "manchester.ac.uk"

Looking at Server.ex, it seems like this module will only support TLDs with a single ..

As an aside, there's also this, which appears to be more up-to-date.

https://github.com/whois-server-list/whois-server-list

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.