도메인 검색에 대해... > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

도메인 검색에 대해... 정보

도메인 검색에 대해...

본문

몇시간전에 자작프로그램란에 도메인 검색기를 올렸는데...
신경 쓰이는 부분이 있어 질문드립니다...
링크1에 가서 검색실행해 보시면...검색결과와 상세보기팝업창을 연결해 놓은 상태에서..
영문도메인 ...com,...net,...org을 검색해서 팝업창을 띄우면
정보가 보이는 것도 있고 안 보이는 곳도 있던데요...
이건 신청자가 정보공개를 선택하지 않아서 안 나오는건가요...
프로그래밍상의 오류인가요???

일단 연결서버부분 소스를 올려봅니다...
---------------------------------------------------------------------------------------------------------------------
<?
if($mode) {
if ((!$domain)||(!check_domain($domain))) {
errmsg('도메인 규칙에 어긋납니다. 다시 입력해 주십시요!');
}

$miss=array(0=>"no match",1=>"not registered",2=>"no entries",3=>"not found",4=>"no records");
$cannot=array();
$can=array();

for ($i=0;$i<sizeof($tld);$i++) {
$result=array();
$fp=fsockopen("whois.internic.net",43);

if (!$fp) {
$cannot[]="$domain.".current($tld)."(WHOIS 접속 실패)";
next($tld);
continue;
}

fputs($fp,"$domain".".".current($tld)."\n");
$found=0;

while(!feof($fp)) {
$result[]=fgets($fp,100);
}

fclose($fp);

while (list($num,$value)=each($result)) {
for ($j=0;$j<sizeof($miss);$j++) {
if (eregi($miss[$j],$value))
$found=1;
}
}

if (!$found) {
$cannot[]="$domain.".current($tld);
}else {
$can[]="$domain.".current($tld);
}
next($tld);
}

for ($i=0;$i<sizeof($ctld);$i++) {
$result=array();
$fp=fsockopen("whois.nic.or.kr",43);

if (!$fp) {
$cannot[]="$domain.".current($ctld)."(WHOIS 접속 실패)";
next($ctld);
continue;
}
fputs($fp,"$domain".".".current($ctld)."\n");
$found=0;
while(!feof($fp)) {
$result[]=fgets($fp,100);
}
fclose($fp);
while (list($num,$value)=each($result)) {
for ($j=0;$j<sizeof($miss);$j++) {
if (eregi($miss[$j],$value))
$found=1;
}
}

if (!$found) {
$cannot[]="$domain.".current($ctld);
}else {
$can[]="$domain.".current($ctld);
}

next($ctld);
}

?>
-------------------------------------------------------------------------------------------------------------------------------



그리고 팝업창에서 정보를 받는부분....
-------------------------------------------------------------------------------------------------------------------------------
<?
 if ($mode=="Whois") {
 require "WhoisCheck.php";
 $if = new Whois;
 $if ->Search($site);
}
?>
------------------------------------------------------------------------------------------------------------------------------



그리고 WhoisCheck.php는 다음과 같습니다.....
------------------------------------------------------------------------------------------------------------------------------

<?
class Whois {
var $in_server="whois.nic.or.kr";
var $out_server="whois.networksolutions.com";

function Search($site) {
$site=eregi_replace("www\.","",$site);
$site.="\n";
if (eregi("\.kr",$site)) {
if (!($fp = fsockopen($this->in_server,43))) {
echo "WHOIS 서버( $this->in_server )에 접속할 수 없습니다.";
exit;
}
$i=0;
$result="";
fputs($fp,"$site");
while(!feof($fp)) {
if ($i>4 && $i!=26 && $i!=27 && $i!=28) $result.=fgets($fp,80);
else fgets($fp,80);
$i++;
}
echo nl2br($result);
}else {
if (!($fp = fsockopen($this->out_server,43))) {
echo "WHOIS 서버( $this->out_server )에 접속할 수 없습니다.";
exit;
}
$i=0;
$result=array();
fputs($fp,"$site");
while(!feof($fp)) {
if ($i>11) { $result[]=fgets($fp,80); }
else fgets($fp,80);
$i++;
}
if (!eregi("Registrant:",$result[0])) {
$check=0;
for ($j=0;$j<count($result)-2;$j++) {
if (eregi("Domain Name:",$result[$j])) $check=1;
if ($check) echo $result[$j]."<br>";
}
}else {
for ($j=0;$j<count($result)-2;$j++) {
echo $result[$j]."<br>";
}
}
}
fclose($fp);
}
}
?>
------------------------------------------------------------------------------------------------------------------------------

소스때문에 그런거라면 고언 부탁드립니다...

댓글 전체

WhoisCheck.php 소스파일에서 소스코드를 살짝 보았을때,
var $in_server="whois.nic.or.kr";
~와 같이 whois에서의 검색결과만 끌어오는 방식이라고 보여집니다.

혹시나 싶어서 whois.nic.or.kr에서 직접 조회해 봤습니다.
공개해 주신 소스는 whois 자체에서의 검색결과만을 보여주는 반면,
whois.nic.or.kr에서는 가능한 한 최대의 정보를 연계해서 출력해 줍니다.
(메타검색의 개념이랄까... 엠파스의 열린검색 개념이라고나 해야 할까...)

때문에 whois.nic.or.kr에 직접 등록되어 있지 않은 사이트의 정보는,
팝업창(상세정보)에서 가져올 수 없는 것 같습니다.

(예) : sir.co.kr은 공개해 주신 소스파일로 상세검색이 가능합니다.
naver.com, empas.com, paran.com 등은 whois.gabia.com에서 조회가 되며,
*.net 도메인이라 할지라도,
daum.net을 비롯한 곳은 whois.ibi.net에서 조회가 되고 있으며,
whois.ttpia.com에서 조회가 되는 곳도 있습니다.
*.org는 whois.publicinterestregistry.net 조회가 됩니다.


즉, 어떤 사이트(도메인 등록기관)에서 등록했느냐에 따라서,
상세검색이 되느냐 되지 않느냐의 차이를 보여줍니다.
전체 14 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT