Sep 202012
 

java로 whois 클라이언트를 하나 만들었습니다.
기존의 UNIX 환경에서 사용하던 whois와 유사한 기능으로 구현을 했습니다.

http://blog.sukmoonlee.com/jWhois/jWhois.jar

자바의 문자열이 유니코드로 처리되는 특징을 이용해서, 로컬문자로 제공되는 WHOIS 서비스를 자바의 유니코드로 변환해서 읽은 다음에 사용자의 환경에 따라서 결과를 출력하도록 되어 있습니다.
그래서 UTF-8 환경에서 다양한 WHOIS 서버의 문자를 처리해서 결과를 아래와 같이 얻을수 있습니다.
(일단 현재 버전에서는 kr과 jp만 지원합니다. 나머지 서버들은 대부분 영문으로 제공을 하더군요.)

[smlee@localhost jWhois]$ java -jar jWhois.jar --help
jWhois version 0.9.1-20120918, Copyright (C) 2012 SukmoonLee.

Usage: java -jar jWhois.jar  [OPTIONS] [QUERY]
          --version                  display version number and patch level
          --help                     display this help
          -h HOST, --host=HOST       explicitly query HOST
          -n, --no-redirect          disable content redirection
          -i, --display-redirections display all redirects instead of hiding them
          -p PORT                    use port number PORT (in conjunction with HOST)


        Report bugs to smlee@sukmoonlee.com


[smlee@localhost jWhois]$ java -jar jWhois.jar netpia.com
[Querying netpia.com]
[Redirected to whois.verisign-grs.com] - 330 msec
[Querying netpia.com]
[Redirected to whois.ibi.net] - 621 msec
[Querying netpia.com]
[whois.ibi.net] - 2177 msec
Welcome to NETPIA.COM's WHOIS Server


# ENGLISH

Registrant:
    Netpia
    Gangseo-gu 16F, WoolimBlue9 Bldg. A, 240-21, Yeomchang-dong, Seoul

    Domain Name: netpia.com
    Registrar: NETPIA.COM, INC.(http://www.ibi.net)

    Administrative Contact:
        Netpia     webmaster@ibi.net
        Gangseo-gu 16F, WoolimBlue9 Bldg. A, 240-21, Yeomchang-dong, Seoul,  KR
        +82.0236651233

    Technical Contact:
        Netpia     webmaster@ibi.net
        Gangseo-gu 16F, WoolimBlue9 Bldg. A, 240-21, Yeomchang-dong, Seoul,  KR
        +82.0236651233

     Billing Contact:
        Netpia     webmaster@ibi.net
        Gangseo-gu 16F, WoolimBlue9 Bldg. A, 240-21, Yeomchang-dong, Seoul,  KR
        +82.0236651233

     Record created on........: 31-Mar-1998 EDT.
     Record expires on........: 31-Mar-2013 EDT.
     Record last updated on...: 10-Mar-2012 EDT.

     Domain Name Servers in listed order:
     NS.NETPIA.COM      61.82.71.230
     NS2.NETPIA.COM

# KOREAN(UTF-8)

등록인:
    Netpia
    Gangseo-gu 16F, WoolimBlue9 Bldg. A, 240-21, Yeomchang-dong, Seoul

    도메인이름: netpia.com
    등록대행자: NETPIA.COM, INC.(http://www.ibi.net)

    관리담당자:
        Netpia     webmaster@ibi.net
        Gangseo-gu 16F, WoolimBlue9 Bldg. A, 240-21, Yeomchang-dong, Seoul,  KR
        +82.0236651233

    기술담당자:
        Netpia     webmaster@ibi.net
        Gangseo-gu 16F, WoolimBlue9 Bldg. A, 240-21, Yeomchang-dong, Seoul,  KR
        +82.0236651233

    과금담당자:
        Netpia     webmaster@ibi.net
        Gangseo-gu 16F, WoolimBlue9 Bldg. A, 240-21, Yeomchang-dong, Seoul,  KR
        +82.0236651233

     등록일........: 31-Mar-1998 EDT.
     사용 종료일...: 31-Mar-2013 EDT.
     최근 변경일...: 10-Mar-2012 EDT.

     네임서버 정보:
     NS.NETPIA.COM      61.82.71.230
     NS2.NETPIA.COM



Please register domain name at www.ibi.net [smlee@localhost jWhois]$ java -jar jWhois.jar netpia.kr [Querying netpia.kr] [Redirected to whois.kr] - 364 msec [Querying netpia.kr] [whois.kr] - 126 msec query: netpia.kr # KOREAN 도메인이름 : netpia.kr 등록인 : 김태영 책임자 : 김태영 책임자 전자우편 : tim@solf.co.kr 등록일 : 2007. 02. 28. 최근 정보 변경일 : 2008. 04. 12. 사용 종료일 : 2013. 02. 28. 정보공개여부 : N 등록대행자 : (주)아이네임즈(http://www.inames.co.kr) 1차 네임서버 정보 호스트이름 : ns1.uhost.co.kr IP 주소 : 202.31.186.220 2차 네임서버 정보 호스트이름 : ns2.uhost.co.kr IP 주소 : 118.129.168.68 네임서버 이름이 .kr이 아닌 경우는 IP주소가 보이지 않습니다. # ENGLISH Domain Name : netpia.kr Registrant : TAE YEONG KIM Administrative Contact(AC) : TAE YEONG KIM AC E-Mail : tim@solf.co.kr Registered Date : 2007. 02. 28. Last updated Date : 2008. 04. 12. Expiration Date : 2013. 02. 28. Publishes : N Authorized Agency : Inames Co., Ltd.(http://www.inames.co.kr) Primary Name Server Host Name : ns1.uhost.co.kr IP Address : 202.31.186.220 Secondary Name Server Host Name : ns2.uhost.co.kr IP Address : 118.129.168.68 - KISA/KRNIC Whois Service - [smlee@localhost jWhois]$ java -jar jWhois.jar netpia.jp [Querying netpia.jp] [Redirected to whois.jprs.jp] - 365 msec [Querying netpia.jp] [whois.jprs.jp] - 178 msec [ JPRS database provides information on network administration. Its use is ] [ restricted to network administration purposes. For further information, ] [ use 'whois -h whois.jprs.jp help'. To suppress Japanese output, add'/e' ] [ at the end of command, e.g. 'whois -h whois.jprs.jp xxx/e'. ] Domain Information: [ドメイン情報] [Domain Name] NETPIA.JP [登録者名] (有)ハンドインハンド [Registrant] Hand in Hand Inc. [Name Server] m1.stage21.net [Name Server] y2.netpia.ne.jp [Signing Key] [登録年月日] 2001/03/26 [有効期限] 2013/03/31 [状態] Active [最終更新] 2012/04/01 01:05:00 (JST) Contact Information: [公開連絡窓口] [名前] (有)ハンドインハンド [Name] Hand in Hand Inc. [Email] kanri-domain@netpia.jp [Web Page] [郵便番号] 242-0018 [住所] 神奈川県大和市深見西2-1-1 [Postal Address] 2-1-1, Fukami-Nishi, Yamato-City, Kanagawa [電話番号] 046-265-1700 [FAX番号] 020-4622-6502
Sep 192012
 

DNS 관련일을 하게 되면 자연적으로 도메인과 많은 관련성이 있습니다.

특히 도메인을 이해하기 위해서는 Registry-Registrar 개념과 DNS 위임구조를 알아야 합니다.
도메인의 위임정보를 알기 위해서 WHOIS라는 서비스를 제공하고 있습니다.

아주 오래된 프로토콜로 TCP 43번 포트로 제공하고 있는 프로토콜입니다.
(DNS가 53번이므로 외우기도 쉽습니다.)

해당 프로토콜에 대해서는 영문위키를 보면 금방 이해를 할수 있으며, 간단히 telnet 으로도 확인이 가능합니다.
Socket에서 TCP Client 정도만 제작가능하시면 바로 제작이 가능합니다.

http://en.wikipedia.org/wiki/Whois

이러한 WHOIS 정보는 TLD별로 제공이 되고 있으며, 아래와 같은 규칙을 가지고 있습니다.

whois-servers.net provides DNS alias records (CNAME) for TLD WHOIS servers of the form .whois-servers.net.

[stone@localhost ~]$ telnet com.whois-servers.net 43
Trying 199.7.49.74...
Connected to com.whois-servers.net (199.7.49.74).
Escape character is '^]'.
netpia.com

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

   Domain Name: NETPIA.COM
   Registrar: NETPIA.COM, INC.
   Whois Server: whois.ibi.net
   Referral URL: http://www.ibi.net
   Name Server: NS.NETPIA.COM
   Name Server: NS2.NETPIA.COM
   Status: clientDeleteProhibited
   Status: clientTransferProhibited
   Updated Date: 10-mar-2012
   Creation Date: 01-apr-1998
   Expiration Date: 31-mar-2013

>>> Last update of whois database: Mon, 17 Sep 2012 15:01:00 UTC <<<

NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the registry is
currently set to expire. This date does not necessarily reflect the expiration
date of the domain name registrant's agreement with the sponsoring
registrar.  Users may consult the sponsoring registrar's Whois database to
view the registrar's reported date of expiration for this registration.

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 except as reasonably necessary to register domain names or
modify existing registrations; the Data in VeriSign Global Registry
Services' ("VeriSign") Whois database is provided by VeriSign for
information purposes only, and to assist persons in obtaining information
about or related to a domain name registration record. VeriSign 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 VeriSign (or its computer systems). The compilation,
repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of VeriSign. You agree not to
use electronic processes that are automated and high-volume to access or
query the Whois database except as reasonably necessary to register
domain names or modify existing registrations. VeriSign reserves the right
to restrict your access to the Whois database in its sole discretion to ensure
operational stability.  VeriSign may restrict or terminate your access to the
Whois database for failure to abide by these terms of use. VeriSign
reserves the right to modify these terms at any time.

The Registry database contains ONLY .COM, .NET, .EDU domains and
Registrars.Connection closed by foreign host.
[stone@localhost ~]$

보다 확실한 방법은 IP와 주소 정보를 관할하는 IANA의 WHOIS 서버를 통해서 확인을 하면 보다 확실합니다.

The IANA whois server at whois.iana.org provides information on each TLD including the whois server.

[stone@localhost~]$ telnet whois.iana.org 43
Trying 192.0.47.59...
Connected to whois.iana.org (192.0.47.59).
Escape character is '^]'.
kr
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object

domain:       KR

organisation: Korea Internet & Security Agency (KISA)
address:      12F, Daedong Bldg, 109 Jungdae-ro, Songpa-gu
address:      Seoul  138-950
address:      Korea, Republic Of

contact:      administrative
name:         Kilnam Chon
organisation: Korea Network Information Center (KRNIC)
address:      12F, Daedong Bldg, 109 Jungdae-ro, Songpa-gu
address:      Seoul  138-950
address:      Korea, Republic Of
phone:        +82 10 8581 3514
fax-no:       +82 2 405 5419
e-mail:       chonkn@gmail.com

contact:      technical
name:         Director of Internet Technology Team
organisation: Korea Internet & Security Agency (KISA)
address:      12F, Daedong Bldg
address:      109 Jungdae-ro, Songpa-gu
address:      Seoul 138-950
address:      Korea, Republic Of
phone:        +82 2 405 6470
fax-no:       +82 2 405 5119
e-mail:       techc@kisa.or.kr

nserver:      B.DNS.KR 61.74.75.1
nserver:      C.DNS.KR 203.248.246.220
nserver:      D.DNS.KR 203.83.159.1
nserver:      E.DNS.KR 2001:dcc:5:0:0:0:0:100 202.30.124.100
nserver:      F.DNS.KR 218.38.181.90
nserver:      G.DNS.KR 2001:dc5:a:0:0:0:0:1 202.31.190.1
ds-rdata:     17625 7 2 FB939059F4B67BBA1E8AC37E35811E506488B2D8CFF807AF873B2116B5676B5C

whois:        whois.kr

status:       ACTIVE
remarks:      Registration information: http://www.nic.or.kr/

created:      1986-09-29
changed:      2011-11-23
source:       IANA

Connection closed by foreign host.
[stone@localhost ~]$
Plugin from the creators of Brindes :: More at Plulz Wordpress Plugins