查询域名是否注册的类

来源:互联网 发布:php动态网站开发 pdf 编辑:程序博客网 时间:2024/04/29 05:13

这是个我见过的最经典的算法
我已经用c#写了asp.net的版本
地址:

http://dingxsoft.com/whois/whois.aspx

<?php
// cWhois V1.52
// Copyright 2002 to 2003 Vibralogix
// You are licensed to use this on one domain only.
// Please email support@vibralogix.com for further details.

// List of who is servers for each domain type
// domain extension,whois server,not registered flag

$dtd[]=".ac,whois.nic.ac,no match";
$dtd[]=".af,whois.netnames.net,no match";
$dtd[]=".com.ag,whois.nic.ag,does not exist";
$dtd[]=".edu.ag,whois.nic.ag,does not exist";
$dtd[]=".gov.ag,whois.nic.ag,does not exist";
$dtd[]=".net.ag,whois.nic.ag,does not exist";
$dtd[]=".org.ag,whois.nic.ag,does not exist";
$dtd[]=".ag,whois.nic.ag,does not exist";
$dtd[]=".am,whois.nic.am,no match";
$dtd[]=".as,whois.nic.as,not found";
$dtd[]=".ac.at,whois.aco.net,nothing found";
$dtd[]=".co.at,whois.aco.net,nothing found";
$dtd[]=".gv.at,whois.aco.net,nothing found";
$dtd[]=".or.at,whois.aco.net,nothing found";
$dtd[]=".at,whois.aco.net,nothing found";
$dtd[]=".asn.au,whois.ausregistry.net.au,no data found";
$dtd[]=".com.au,whois.ausregistry.net.au,no data found";
$dtd[]=".edu.au,whois.aunic.net,no entries";
$dtd[]=".id.au,whois.ausregistry.net.au,no data found";
$dtd[]=".net.au,whois.ausregistry.net.au,no data found";
$dtd[]=".org.au,whois.ausregistry.net.au,no data found";
$dtd[]=".ac.be,*bewhois,free";
$dtd[]=".be,*bewhois,free";
$dtd[]=".bg,whois.ripe.net,no entries";
$dtd[]=".agr.br,whois.nic.br,no match";
$dtd[]=".am.br,whois.nic.br,no match";
$dtd[]=".art.br,whois.nic.br,no match";
$dtd[]=".com.br,whois.nic.br,no match";
$dtd[]=".coop.br,whois.nic.br,no match";
$dtd[]=".esp.br,whois.nic.br,no match";
$dtd[]=".etc.br,whois.nic.br,no match";
$dtd[]=".far.br,whois.nic.br,no match";
$dtd[]=".fm.br,whois.nic.br,no match";
$dtd[]=".g12.br,whois.nic.br,no match";
$dtd[]=".gov.br,whois.nic.br,no match";
$dtd[]=".imb.br,whois.nic.br,no match";
$dtd[]=".ind.br,whois.nic.br,no match";
$dtd[]=".inf.br,whois.nic.br,no match";
$dtd[]=".mil.br,whois.nic.br,no match";
$dtd[]=".net.br,whois.nic.br,no match";
$dtd[]=".org.br,whois.nic.br,no match";
$dtd[]=".psi.br,whois.nic.br,no match";
$dtd[]=".rec.br,whois.nic.br,no match";
$dtd[]=".srv.br,whois.nic.br,no match";
$dtd[]=".tmp.br,whois.nic.br,no match";
$dtd[]=".tur.br,whois.nic.br,no match";
$dtd[]=".tv.br,whois.nic.br,no match";
$dtd[]=".edu.br,whois.nic.br,no match";
$dtd[]=".nom.br,whois.nic.br,no match";
$dtd[]=".adm.br,whois.nic.br,no match";
$dtd[]=".adv.br,whois.nic.br,no match";
$dtd[]=".arq.br,whois.nic.br,no match";
$dtd[]=".ato.br,whois.nic.br,no match";
$dtd[]=".bio.br,whois.nic.br,no match";
$dtd[]=".bmd.br,whois.nic.br,no match";
$dtd[]=".cim.br,whois.nic.br,no match";
$dtd[]=".cng.br,whois.nic.br,no match";
$dtd[]=".cnt.br,whois.nic.br,no match";
$dtd[]=".ecn.br,whois.nic.br,no match";
$dtd[]=".eng.br,whois.nic.br,no match";
$dtd[]=".eti.br,whois.nic.br,no match";
$dtd[]=".fnd.br,whois.nic.br,no match";
$dtd[]=".fot.br,whois.nic.br,no match";
$dtd[]=".fst.br,whois.nic.br,no match";
$dtd[]=".ggf.br,whois.nic.br,no match";
$dtd[]=".jor.br,whois.nic.br,no match";
$dtd[]=".lel.br,whois.nic.br,no match";
$dtd[]=".mat.br,whois.nic.br,no match";
$dtd[]=".med.br,whois.nic.br,no match";
$dtd[]=".mus.br,whois.nic.br,no match";
$dtd[]=".not.br,whois.nic.br,no match";
$dtd[]=".ntr.br,whois.nic.br,no match";
$dtd[]=".odo.br,whois.nic.br,no match";
$dtd[]=".ppg.br,whois.nic.br,no match";
$dtd[]=".pro.br,whois.nic.br,no match";
$dtd[]=".psc.br,whois.nic.br,no match";
$dtd[]=".qsl.br,whois.nic.br,no match";
$dtd[]=".trd.br,whois.nic.br,no match";
$dtd[]=".vet.br,whois.nic.br,no match";
$dtd[]=".zlg.br,whois.nic.br,no match";
$dtd[]=".br,whois.nic.br,no match";
$dtd[]=".com.bz,whois.belizenic.bz,no match";
$dtd[]=".net.bz,whois.belizenic.bz,no match";
$dtd[]=".org.bz,whois.belizenic.bz,no match";
$dtd[]=".bz,whois.belizenic.bz,no match";
$dtd[]=".bc.ca,whois.cira.ca,status:         avail";
$dtd[]=".mb.ca,whois.cira.ca,status:         avail";
$dtd[]=".nb.ca,whois.cira.ca,status:         avail";
$dtd[]=".nf.ca,whois.cira.ca,status:         avail";
$dtd[]=".ns.ca,whois.cira.ca,status:         avail";
$dtd[]=".nt.ca,whois.cira.ca,status:         avail";
$dtd[]=".on.ca,whois.cira.ca,status:         avail";
$dtd[]=".pe.ca,whois.cira.ca,status:         avail";
$dtd[]=".qc.ca,whois.cira.ca,status:         avail";
$dtd[]=".sk.ca,whois.cira.ca,status:         avail";
$dtd[]=".yk.ca,whois.cira.ca,status:         avail";
$dtd[]=".ca,whois.cira.ca,status:         avail";
$dtd[]=".cd,whois.cd,no match";
$dtd[]=".cl,whois.nic.cl,no existe";
$dtd[]=".ch,whois.nic.ch,we do not have an entry";
$dtd[]=".co.ck,whois.ck-nic.org.ck,no entries found";
$dtd[]=".edu.ck,whois.ck-nic.org.ck,no entries found";
$dtd[]=".gov.ck,whois.ck-nic.org.ck,no entries found";
$dtd[]=".net.ck,whois.ck-nic.org.ck,no entries found";
$dtd[]=".org.ck,whois.ck-nic.org.ck,no entries found";
$dtd[]=".cm,whois.ripe,no entries found";
$dtd[]=".edu.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".ac.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".ah.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".bj.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".com.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".cq.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".gd.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".gov.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".gs.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".gx.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".gz.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".hb.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".he.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".hi.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".hk.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".hl.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".hn.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".jl.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".js.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".mo.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".net.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".nm.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".nx.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".ln.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".org.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".qh.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".sc.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".sh.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".sn.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".tj.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".tw.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".yn.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".xj.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".xz.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".zj.cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".cn,whois.cnnic.net.cn,no matching record";
$dtd[]=".cx,whois.nic.cx,no match";
$dtd[]=".cz,whois.ripe.net,no data found";
$dtd[]=".de,whois.denic.de,no entries";
$dtd[]=".dj,*djwhois,domain is available";
$dtd[]=".dk,whois.dk-hostmaster.dk,no entries";
$dtd[]=".es,*eswhois,encontrado";
$dtd[]=".ac.fj,whois.usp.ac.fj,was not found";
$dtd[]=".biz.fj,whois.usp.ac.fj,was not found";
$dtd[]=".com.fj,whois.usp.ac.fj,was not found";
$dtd[]=".gov.fj,whois.usp.ac.fj,was not found";
$dtd[]=".info.fj,whois.usp.ac.fj,was not found";
$dtd[]=".mil.fj,whois.usp.ac.fj,was not found";
$dtd[]=".name.fj,whois.usp.ac.fj,was not found";
$dtd[]=".net.fj,whois.usp.ac.fj,was not found";
$dtd[]=".org.fj,whois.usp.ac.fj,was not found";
$dtd[]=".pro.fj,whois.usp.ac.fj,was not found";
$dtd[]=".school.fj,whois.usp.ac.fj,was not found";
$dtd[]=".fm,*fmwhois,no match";
$dtd[]=".fo,whois.rotld.ro,no entries";
$dtd[]=".asso.fr,whois.nic.fr,no entries";
$dtd[]=".com.fr,whois.nic.fr,no entries";
$dtd[]=".nom.fr,whois.nic.fr,no entries";
$dtd[]=".prd.fr,whois.nic.fr,no entries";
$dtd[]=".presse.fr,whois.nic.fr,no entries";
$dtd[]=".tm.fr,whois.nic.fr,no entries";
$dtd[]=".fr,whois.nic.fr,no entries";
$dtd[]=".co.gg,whois.isles.net,domain not found";
$dtd[]=".gov.gg,whois.isles.net,domain not found";
$dtd[]=".net.gg,whois.isles.net,domain not found";
$dtd[]=".org.gg,whois.isles.net,domain not found";
$dtd[]=".sch.gg,whois.isles.net,domain not found";
$dtd[]=".gg,whois.isles.net,domain not found";
$dtd[]=".gl,whois.ripe.net,no entries found";
$dtd[]=".gm,whois.ripe.net,no entries found";
$dtd[]=".gr,*grwhois,no match";
$dtd[]=".co.gr,*grwhois,no match";
$dtd[]=".com.gr,*grwhois,no match";
$dtd[]=".net.gr,*grwhois,no match";
$dtd[]=".edu.gr,*grwhois,no match";
$dtd[]=".org.gr,*grwhois,no match";
$dtd[]=".gs,whois.adamsnames.tc,not registered";
$dtd[]=".com.hk,whois.hkdnr.net.hk,no match";
$dtd[]=".edu.hk,whois.hkdnr.net.hk,no match";
$dtd[]=".gov.hk,whois.hkdnr.net.hk,no match";
$dtd[]=".net.hk,whois.hkdnr.net.hk,no match";
$dtd[]=".org.hk,whois.hkdnr.net.hk,no match";
$dtd[]=".hm,whois.registry.hm,(null)";
$dtd[]=".co.hu,whois.ripe.net,object shown below is not";
$dtd[]=".info.hu,whois.ripe.net,object shown below is not";
$dtd[]=".org.hu,whois.ripe.net,object shown below is not";
$dtd[]=".priv.hu,whois.ripe.net,object shown below is not";
$dtd[]=".sport.hu,whois.ripe.net,object shown below is not";
$dtd[]=".tm.hu,whois.ripe.net,object shown below is not";
$dtd[]=".hu,whois.ripe.net,object shown below is not";
$dtd[]=".ie,whois.domainregistry.ie,no match";
$dtd[]=".ac.il,whois.isoc.org.il,no data was found";
$dtd[]=".co.il,whois.isoc.org.il,no data was found";
$dtd[]=".gov.il,whois.isoc.org.il,no data was found";
$dtd[]=".idf.il,whois.isoc.org.il,no data was found";
$dtd[]=".k12.il,whois.isoc.org.il,no data was found";
$dtd[]=".muni.il,whois.isoc.org.il,no data was found";
$dtd[]=".net.il,whois.isoc.org.il,no data was found";
$dtd[]=".org.il,whois.isoc.org.il,no data was found";
$dtd[]=".ac.ir,whois.nic.ir,no entries found";
$dtd[]=".co.ir,whois.nic.ir,no entries found";
$dtd[]=".gov.ir,whois.nic.ir,no entries found";
$dtd[]=".id.ir,whois.nic.ir,no entries found";
$dtd[]=".net.ir,whois.nic.ir,no entries found";
$dtd[]=".org.ir,whois.nic.ir,no entries found";
$dtd[]=".sch.ir,whois.nic.ir,no entries found";
$dtd[]=".ir,whois.nic.ir,no entries found";
$dtd[]=".is,whois.isnet.is,no entries found";
$dtd[]=".it,whois.nic.it,no entries found";
$dtd[]=".je,whois.isles.net,domain not found";
$dtd[]=".ac.jp,whois.nic.ad.jp,no match";
$dtd[]=".ad.jp,whois.nic.ad.jp,no match";
$dtd[]=".co.jp,whois.nic.ad.jp,no match";
$dtd[]=".ed.jp,whois.nic.ad.jp,no match";
$dtd[]=".go.jp,whois.nic.ad.jp,no match";
$dtd[]=".ne.jp,whois.nic.ad.jp,no match";
$dtd[]=".or.jp,whois.nic.ad.jp,no match";
$dtd[]=".geo.jp,whois.nic.ad.jp,no match";
$dtd[]=".ac.kr,whois.krnic.net,domain name is not";
$dtd[]=".co.kr,whois.krnic.net,domain name is not";
$dtd[]=".go.kr,whois.krnic.net,domain name is not";
$dtd[]=".ne.kr,whois.krnic.net,domain name is not";
$dtd[]=".or.kr,whois.krnic.net,domain name is not";
$dtd[]=".pe.kr,whois.krnic.net,domain name is not";
$dtd[]=".re.kr,whois.krnic.net,domain name is not";
$dtd[]=".seoul.kr,whois.krnic.net,domain name is not";
$dtd[]=".kyonggi.kr,whois.krnic.net,domain name is not";
$dtd[]=".la,whois.nic.la,no match";
$dtd[]=".li,whois.nic.li,do not have an entry";
$dtd[]=".lt,whois.ripe.net,no matches found";
$dtd[]=".lu,whois.dns.lu,no entries found";
$dtd[]=".asn.lv,whois.ripe.net,no entries found";
$dtd[]=".com.lv,whois.ripe.net,no entries found";
$dtd[]=".conf.lv,whois.ripe.net,no entries found";
$dtd[]=".edu.lv,whois.ripe.net,no entries found";
$dtd[]=".gov.lv,whois.ripe.net,no entries found";
$dtd[]=".id.lv,whois.ripe.net,no entries found";
$dtd[]=".mil.lv,whois.ripe.net,no entries found";
$dtd[]=".net.lv,whois.ripe.net,no entries found";
$dtd[]=".org.lv,whois.ripe.net,no entries found";
$dtd[]=".lv,whois.ripe.net,no entries found";
$dtd[]=".tm.mc,whois.ripe.net,no entries found";
$dtd[]=".asso.mc,whois.ripe.net,no entries found";
$dtd[]=".mc,whois.ripe.net,no entries found";
$dtd[]=".ms,whois.adamsnames.tc,not registered";
$dtd[]=".com.mt,whois.ripe.net,no entries found";
$dtd[]=".edu.mt,whois.ripe.net,no entries found";
$dtd[]=".net.mt,whois.ripe.net,no entries found";
$dtd[]=".org.mt,whois.ripe.net,no entries found";
$dtd[]=".tm.mt,whois.ripe.net,no entries found";
$dtd[]=".uu.mt,whois.ripe.net,no entries found";
$dtd[]=".mt,whois.ripe.net,no entries found";
$dtd[]=".com.mx,whois.nic.mx,no encontradas";
$dtd[]=".edu.mx,whois.nic.mx,no encontradas";
$dtd[]=".gob.mx,whois.nic.mx,no encontradas";
$dtd[]=".net.mx,whois.nic.mx,no encontradas";
$dtd[]=".org.mx,whois.nic.mx,no encontradas";
$dtd[]=".mx,whois.nic.mx,no encontradas";
$dtd[]=".com.my,*mywhois,does not exist";
$dtd[]=".net.my,*mywhois,does not exist";
$dtd[]=".org.my,*mywhois,does not exist";
$dtd[]=".gov.my,*mywhois,does not exist";
$dtd[]=".edu.my,*mywhois,does not exist";
$dtd[]=".mil.my,*mywhois,does not exist";
$dtd[]=".my,*mywhois,does not exist";
$dtd[]=".nl,*nlwhois,free";
$dtd[]=".no,whois.norid.no,no matches";
$dtd[]=".nu,whois.nic.nu,no match";
$dtd[]=".biz.pl,whois.dns.pl,no information";
$dtd[]=".com.pl,whois.dns.pl,no information";
$dtd[]=".net.pl,whois.dns.pl,no information";
$dtd[]=".org.pl,whois.dns.pl,no information";
$dtd[]=".pl,whois.dns.pl,does not exist";
$dtd[]=".ac.nz,whois.domainz.net.nz,available";
$dtd[]=".co.nz,whois.domainz.net.nz,available";
$dtd[]=".cri.nz,whois.domainz.net.nz,available";
$dtd[]=".gen.nz,whois.domainz.net.nz,available";
$dtd[]=".govt.nz,whois.domainz.net.nz,available";
$dtd[]=".iwi.nz,whois.domainz.net.nz,available";
$dtd[]=".net.nz,whois.domainz.net.nz,available";
$dtd[]=".org.nz,whois.domainz.net.nz,available";
$dtd[]=".mil.nz,whois.domainz.net.nz,available";
$dtd[]=".pm,whois.nic.fr,no entries found";
$dtd[]=".school.nz,whois.domainz.net.nz,not listed";
$dtd[]=".re,whois.nic.fr,no entries found";
$dtd[]=".arts.ro,whois.rotld.ro,no entries";
$dtd[]=".com.ro,whois.rotld.ro,no entries";
$dtd[]=".firm.ro,whois.rotld.ro,no entries";
$dtd[]=".info.ro,whois.rotld.ro,no entries";
$dtd[]=".nom.ro,whois.rotld.ro,no entries";
$dtd[]=".nt.ro,whois.rotld.ro,no entries";
$dtd[]=".org.ro,whois.rotld.ro,no entries";
$dtd[]=".rec.ro,whois.rotld.ro,no entries";
$dtd[]=".store.ro,whois.rotld.ro,no entries";
$dtd[]=".tm.ro,whois.rotld.ro,no entries";
$dtd[]=".www.ro,whois.rotld.ro,no entries";
$dtd[]=".ro,whois.rotld.ro,no entries";
$dtd[]=".com.ru,whois.ripn.ru,no entries found";
$dtd[]=".net.ru,whois.ripn.ru,no entries found";
$dtd[]=".org.ru,whois.ripn.ru,no entries found";
$dtd[]=".ru,whois.ripn.ru,no entries found";
$dtd[]=".com.sa,*sawhois,not registered";
$dtd[]=".edu.sa,*sawhois,not registered";
$dtd[]=".gov.sa,*sawhois,not registered";
$dtd[]=".med.sa,*sawhois,not registered";
$dtd[]=".net.sa,*sawhois,not registered";
$dtd[]=".org.sa,*sawhois,not registered";
$dtd[]=".pub.sa,*sawhois,not registered";
$dtd[]=".sch.sa,*sawhois,not registered";
$dtd[]=".pp.se,whois.nic-se.se,no data found";
$dtd[]=".press.se,whois.nic-se.se,no data found";
$dtd[]=".org.se,whois.nic-se.se,no data found";
$dtd[]=".se,whois.nic-se.se,no data found";
$dtd[]=".com.sg,whois.nic.net.sg,nomatch";
$dtd[]=".edu.sg,whois.nic.net.sg,nomatch";
$dtd[]=".gov.sg,whois.nic.net.sg,nomatch";
$dtd[]=".not.sg,whois.nic.net.sg,nomatch";
$dtd[]=".org.sg,whois.nic.net.sg,nomatch";
$dtd[]=".per.sg,whois.nic.net.sg,nomatch";
$dtd[]=".com.sh,whois.nic.sh,no match";
$dtd[]=".co.sh,whois.nic.sh,no match";
$dtd[]=".net.sh,whois.nic.sh,no match";
$dtd[]=".org.sh,whois.nic.sh,no match";
$dtd[]=".edu.sh,whois.nic.sh,no match";
$dtd[]=".gov.sh,whois.nic.sh,no match";
$dtd[]=".mil.sh,whois.nic.sh,no match";
$dtd[]=".sh,whois.nic.sh,no match";
$dtd[]=".si,whois.arnes.si,no entries";
$dtd[]=".sk,whois.ripe.net,no entries found";
$dtd[]=".sm,whois.ripe.net,no entries found";
$dtd[]=".st,whois.nic.st,no entries found";
$dtd[]=".su,whois.ripn.net,no entries";
$dtd[]=".tc,whois.adamsnames.tc,not registered";
$dtd[]=".tf,whois.adamsnames.tc,not registered";
$dtd[]=".ac.th,whois.thnic.net,no entries found";
$dtd[]=".co.th,whois.thnic.net,no entries found";
$dtd[]=".go.th,whois.thnic.net,no entries found";
$dtd[]=".in.th,whois.thnic.net,no entries found";
$dtd[]=".mi.th,whois.thnic.net,no entries found";
$dtd[]=".net.th,whois.thnic.net,no entries found";
$dtd[]=".or.th,whois.thnic.net,no entries found";
$dtd[]=".tj,whois.nic.tj,no match for";
$dtd[]=".tm,whois.nic.tm,no match";
$dtd[]=".to,whois.tonic.to,no match";
$dtd[]=".bbs.tr,whois.ripe.net,not found in database";
$dtd[]=".com.tr,whois.ripe.net,not found in database";
$dtd[]=".edu.tr,whois.ripe.net,not found in database";
$dtd[]=".gen.tr,whois.ripe.net,not found in database";
$dtd[]=".gov.tr,whois.ripe.net,not found in database";
$dtd[]=".k12.tr,whois.ripe.net,not found in database";
$dtd[]=".mil.tr,whois.ripe.net,not found in database";
$dtd[]=".net.tr,whois.ripe.net,not found in database";
$dtd[]=".nom.tr,whois.ripe.net,not found in database";
$dtd[]=".org.tr,whois.ripe.net,not found in database";
$dtd[]=".tv,*tvwhois,is available";
$dtd[]=".com.tw,whois.twnic.net,no match";
$dtd[]=".idv.tw,whois.twnic.net,no match";
$dtd[]=".net.tw,whois.twnic.net,no match";
$dtd[]=".org.tw,whois.twnic.net,no match";
$dtd[]=".com.ua,whois.ripe.net,no entries found";
$dtd[]=".edu.ua,whois.ripe.net,no entries found";
$dtd[]=".gov.ua,whois.ripe.net,no entries found";
$dtd[]=".org.ua,whois.ripe.net,no entries found";
$dtd[]=".net.ua,whois.ripe.net,no entries found";
$dtd[]=".co.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".or.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".ac.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".sc.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".go.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".ne.ug,wawa.eahd.or.ug,no entries found";
$dtd[]=".ac.uk,whois.ja.net,no entries were found";
$dtd[]=".co.uk,whois.nic.uk,no match";
$dtd[]=".gov.uk,whois.ja.net,no entries were found";
$dtd[]=".ltd.uk,whois.nic.uk,no match";
$dtd[]=".me.uk,whois.nic.uk,no match";
$dtd[]=".net.uk,whois.nic.uk,no match";
$dtd[]=".org.uk,whois.nic.uk,no match";
$dtd[]=".plc.uk,whois.nic.uk,no match";
$dtd[]=".sch.uk,whois.nic.uk,no match";
$dtd[]=".uk.co,whois.uk.co,no matches";
$dtd[]=".us,whois.nic.us,not found";
$dtd[]=".va,whois.ripe.net,no entries found";
$dtd[]=".vg,whois.adamsnames.tc,not registered";
$dtd[]=".com.ws,whois.worldsite.ws,no match";
$dtd[]=".edu.ws,whois.worldsite.ws,no match";
$dtd[]=".gov.ws,whois.worldsite.ws,no match";
$dtd[]=".net.ws,whois.worldsite.ws,no match";
$dtd[]=".org.ws,whois.worldsite.ws,no match";
$dtd[]=".ws,whois.worldsite.ws,no match";
$dtd[]=".br.com,whois.centralnic.com,no match";
$dtd[]=".cn.com,whois.centralnic.com,no match";
$dtd[]=".de.com,whois.centralnic.com,no match";
$dtd[]=".eu.com,whois.centralnic.com,no match";
$dtd[]=".gb.com,whois.centralnic.com,no match";
$dtd[]=".gb.net,whois.centralnic.com,no match";
$dtd[]=".hu.com,whois.centralnic.com,no match";
$dtd[]=".no.com,whois.centralnic.com,no match";
$dtd[]=".qc.com,whois.centralnic.com,no match";
$dtd[]=".ru.com,whois.centralnic.com,no match";
$dtd[]=".sa.com,whois.centralnic.com,no match";
$dtd[]=".se.com,whois.centralnic.com,no match";
$dtd[]=".se.net,whois.centralnic.com,no match";
$dtd[]=".uk.com,whois.centralnic.com,no match";
$dtd[]=".uk.net,whois.centralnic.com,no match";
$dtd[]=".us.com,whois.centralnic.com,no match";
$dtd[]=".uy.com,whois.centralnic.com,no match";
$dtd[]=".za.com,whois.centralnic.com,no match";
$dtd[]=".com,whois.crsnic.net,no match";
$dtd[]=".net,whois.crsnic.net,no match";
$dtd[]=".org,whois.publicinterestregistry.net,not found";
$dtd[]=".info,whois.afilias.net,not found";
$dtd[]=".name,whois.nic.name,no match";
$dtd[]=".biz,whois.neulevel.biz,not found";
$dtd[]=".cc,whois.nic.cc,no match";
$dtd[]=".edu,whois.educause.net,no match";
$dtd[]=".mil,whois.nic.mil,no match";
$dtd[]=".int,whois.iana.org,not found";
$dtd[]=".coop,whois.nic.coop,no objects found";

function cWhois($dom,$domt,&$RegDetails)
{
  global $dtd;
  $dom=trim($dom);
  $domt=trim($domt);
  // Check referer
  if (1!=CheckReferer())
  {
    return(4); // Referer is  not allowed
  }
  $dom=strtolower($dom);
  $domt=strtolower($domt);
  // Remove
http://www. or www. if user added this
  if (strcmp("
http://www.",substr($dom,0,11))==0)
  {
    $dom=substr($dom,11,strlen($dom)-11);
  }
  if (strcmp("
www.",substr($dom,0,4))==0)
  {
    $dom=substr($dom,4,strlen($dom)-4);
  }
  // If $domt is blank then try to get it
  $found=0;
  if ($domt=="")
  {
    // Treat .name slightly differently
    if (substr($dom,strlen($dom)-5,5)==".name")
    {
      $domt=".name";
      $dom=substr($dom,0,strlen($dom)-5);
      $found=1;
    }
    else
    {
      // Get domain extension by taking everything from first '.'
      $pos=strpos($dom,".");
      if (is_integer($pos))
      {
        $pdomt=substr($dom,$pos,strlen($dom)-$pos);
      }
      for ($index=0;$index<count($dtd);$index++)
      {
        $dt=strtok($dtd[$index],",");
        if (strcasecmp($dt,$pdomt)==0)
        {
          $domt=$pdomt;
          $dom=substr($dom,0,strlen($dom)-strlen($dt));
          $found=1;
          break;
        }
      }
    }
    if ($found==0)
    {
      return(2); // Domain extension not recognised
    }
  }
  if (1!=CheckValidDomain($dom,$domt))
  {
    return(3); // Not a valid domain name
  }
  $serv="";
  for ($index=0;$index<count($dtd);$index++)
  {
    if (strtok($dtd[$index],",")==$domt)
    {
      $serv=strtok(",");
      $no=strtok(",");
      break;
    }
  }
  if ($serv=="")
  {
    return(2); // Domain type not recognised
  }
  $available=0;
  // Add support for domains that have no whois server but use a script to perform lookup.
  // Whois server is actually a function name flagged with a * as the first character which we remove.
  if (substr($serv,0,1)!="*")
  {
    //exec("whois -h $serv $dom$domt",$RegDetails,$ReturnValue);
    //exec("fwhois
$dom$domt@$serv",$RegDetails,$ReturnValue);
    $rsck=wh($serv,$dom.$domt,$RegDetails);
  }
  else
  {
    $func=substr($serv,1,strlen($serv)-1);
    return($func($dom,$domt,$RegDetails)); // Return direct from handling function
  }
  $noserv2=0;
  if ($RegDetails=="*")
  {
    $RegDetails="";
    $noserv2=1;
  }
  // If checking .com or .net then also try whois.internic.net instead if failed
  if (($domt==".com") || ($domt==".net"))
  {
   if ((count($RegDetails)<=1) || ($rsck==0))
   {
       $rsck=wh("whois.internic.net",$dom.$domt,$RegDetails);
     if ((count($RegDetails)<=1) || ($rsck==0))
          return(5); // No connection of blocked etc for .com or .net
   }
  }
  if ((count($RegDetails)==0) || ($rsck==0))
  {
    return(5); // No connection to whois server made
  }
  $serv2="";
  for($index=0;$index<count($RegDetails);$index++)
  {
    $lne=strtolower($RegDetails[$index]);
    $pos=strpos($lne,"whois server:");
    if (is_integer($pos))
    {
      $serv2=substr($lne,$pos+13,strlen($RegDetails[$index])-13);
      $serv2=trim($serv2);
    }
    $pos=strpos($lne,$no);
    if (is_integer($pos))
    {
      $available=1;
    }
  }
  if ($available==1)
  {
    return(0); // Domain is not registered
  }
  if ($noserv2==1)
    return(1); // Return now as full whois not required for the following extensions
  if (($domt==".com") || ($domt==".net") || ($domt==".org") || ($domt==".cc"))
  {
    if ($serv2!="")
    {
      // exec("whois -h $serv2 $dom$domt",$RegDetails,$ReturnValue);
      // exec("fwhois
$dom$domt@$serv2",$RegDetails,$ReturnValue);
      $rsck=wh($serv2,$dom.$domt,$RegDetails2);
   // if checking .com or .net and whois fails then try whois.networksolutions.com instead
      if ((count($RegDetails2)<=1) || ($rsck==0))
      {
      if (($domt==".com") || ($domt==".net"))
        {
        $rsck=wh("whois.networksolutions.com",$dom.$domt,$RegDetails2);
        }
      }
      if ((count($RegDetails2)<=1) || ($rsck==0))
      {
        return(1); // No connection to second whois server made but return that domain is registered
      }
      $RegDetails=$RegDetails2;
    }
  }
  return(1); // Domain is registered
}

function wh($serv,$dom,&$regdet)
{
  $regdet="";
 
$connection=@fsockopen($serv,43,$errorno,$errordesc);
  if ($connection)
  {
    fputs($connection,"$dom/r/n");
    while(!feof($connection))
    {
      $regdet[]=fgets($connection,255);
    }
    fclose($connection);
    return(1);
  }
  else
    return(0);
}

function CheckReferer()
{
  global $HTTP_REFERER,$allowed;
  if ($allowed=="")
  {
    return(1); // Don't care who called us
  }
  $ref=strtolower($HTTP_REFERER);
  $allowed=strtolower($allowed);
  $refall=split(",",$allowed,100);
  for ($index=0;$index<count($refall);$index++)
  {
    $pos=strpos($HTTP_REFERER,$refall[$index]);
    if (is_integer($pos))
    {
      if ($pos==0)
      {
        return(1); // Referer allowed access
      }
    }
  }
  return(0);
}

function CheckValidDomain($dom,$domt)
{
  $dom=strtolower($dom);
  $domt=strtolower($domt);
  // Handle .name seperately
  if ($domt==".name")
  {
   $first=strtok($dom,".");
    $last=strtok(".");
    if (ereg("^[-a-zA-Z0-9]{1,63}$",$first)!=True)
      return(0);
    if (($first[0]=="-") || ($first[strlen($first)-1]=="-"))
      return(0);
    if (ereg("^[-a-zA-Z0-9]{3,63}$",$last)!=True)
      return(0);
    if (($last[0]=="-") || ($last[strlen($last)-1]=="-"))
      return(0);
    return(1);
  }
  // .ac.uk, .gov.uk, .ltd.uk, .plc.uk and .sch.uk do not allow 1 character domain names
  if (($domt==".ac.uk") || ($domt==".gov.uk") || ($domt==".ltd.uk") || ($domt==".plc.uk") || ($domt==".sch.uk"))
  {
    if (strlen($dom)<=1)
      return(0);
  }
  // .co.uk, .me.uk, .org.uk and .net.uk do not allow 1 character domain names
  if (($domt==".co.uk") || ($domt==".me.uk") || ($domt==".org.uk") || ($domt==".net.uk"))
  {
    if (strlen($dom)<=2)
      return(0);
  }
  // .info and .biz dont allow 1 and 2 character domain names
  if (($domt==".info") || ($domt==".biz"))
  {
    if (strlen($dom)<=2)
      return(0);
  }
  // All other domain extensions
  if (ereg("^[-a-zA-Z0-9]{1,63}$",$dom)!=True)
    return(0);
  if (($dom[0]=="-") || ($dom[strlen($dom)-1]=="-"))
    return(0);
  return(1);
}

function sendToHost($host,$method,$path,$data,&$buf,$useragent=0)
{
  // Supply a default method of GET if the one passed was empty
  if (empty($method))
   $method = 'GET';
  $method = strtoupper($method);
  $fp = fsockopen($host,80);
  if ($method == 'GET')
   $path .= '?' . $data;
  fputs($fp, "$method $path HTTP/1.1/n");
  fputs($fp, "Host: $host/n");
  fputs($fp, "Content-type: application/x-www-form-urlencoded/n");
  fputs($fp, "Content-length: " . strlen($data) . "/n");
  if ($useragent)
   fputs($fp, "User-Agent: MSIE/n");
  fputs($fp, "Connection: close/n/n");
  if ($method == 'POST')
   fputs($fp, $data);
  while (!feof($fp))
   $buf[]=fgets($fp,128);
  fclose($fp);
  return $buf;
}

function sendToHost2($host,$method,$path,$data,&$buf,$useragent=0)
{
  // Reads webpage in one big buffer
  // Supply a default method of GET if the one passed was empty
  if (empty($method))
   $method = 'GET';
  $method = strtoupper($method);
  $fp = fsockopen($host,80);
  if ($method == 'GET')
   $path .= '?' . $data;
  fputs($fp, "$method $path HTTP/1.1/n");
  fputs($fp, "Host: $host/n");
  fputs($fp, "Content-type: application/x-www-form-urlencoded/n");
  fputs($fp, "Content-length: " . strlen($data) . "/n");
  if ($useragent)
   fputs($fp, "User-Agent: MSIE/n");
  fputs($fp, "Connection: close/n/n");
  if ($method == 'POST')
   fputs($fp, $data);
  $buf=fread($fp,100000);
  fclose($fp);
  return $buf;
}

function mywhois($dom,$domt,&$regdet)
{
  $regdet="";
  sendToHost('www.mynic.net.my','post','/mynic/search/dname.cfm','domainname='.$dom.'&domaintype='.$domt,$buf);
  $start=0;
  for ($k=0;$k<count($buf);$k++)
  {
    $buf[$k]=strip_tags($buf[$k]);
    $buf[$k]=trim($buf[$k]);
    // Get rid of lines we don't need
    if (is_integer(strpos($buf[$k],"MYNIC")))
      $start=1;
    if (is_integer(strpos($buf[$k],"MYNIC Handle: -->")))
      $skip=1;
    if (is_integer(strpos($buf[$k],"MYNIC Homepage")))
      $skip=1;
    if (is_integer(strpos($buf[$k],"td>")))
      $skip=1;
    if (strlen($buf[$k])<4)
      $skip=1;
    // Add blank line to seperate sections
    if (is_integer(strpos($buf[$k],"Lookup Result")))
      $regdet[]=" ";
    if (is_integer(strpos($buf[$k],"MYNIC Registration No.")))
      $regdet[]=" ";
    if (is_integer(strpos($buf[$k],"Registrant")))
      $regdet[]=" ";
    if (is_integer(strpos($buf[$k],"Administrative Contact")))
      $regdet[]=" ";
    if (is_integer(strpos($buf[$k],"Technical Contact")))
      $regdet[]=" ";
    if (is_integer(strpos($buf[$k],"Billing Contact")))
      $regdet[]=" ";
    if (is_integer(strpos($buf[$k],"Primary Name Server")))
      $regdet[]=" ";
    if (is_integer(strpos($buf[$k],"Secondary Name Server")))
      $regdet[]=" ";
    if (is_integer(strpos($buf[$k],"Developed and maintained by")))
      $regdet[]=" ";
    // Now output line if not skipped and already started
    if ((strlen($buf[$k])>1) && ($start==1) && ($skip==0))
      $regdet[]=$buf[$k];
    $skip=0;
  }
  // Get rid of one spurious output line
  $i=count($regdet);
  if ($i>5)
    $regdet[$i-5]=" ";
  // If whois not contactable
  if (count($regdet)==0)
    return(5); // No connection to whois server made
  $available=0;
  for($index=0;$index<count($regdet);$index++)
  {
    $lne=strtolower($regdet[$index]);
    $pos=strpos($lne,"does not exist");
    if (is_integer($pos))
    {
      $available=1;
    }
  }
  if ($available==1)
    return(0); // Domain is not registered
  return(1);
}

function grwhois($dom,$domt,&$regdet)
{
  $regdet="";
  if (!(
$fh=@fopen("http://www.hostmaster.gr/servlet/gr.hostmaster.form.Check_Domain_Servlet?domain=".$dom.$domt,"r")))
    return(5);
  $buf="";
  while (!feof($fh))
   $buf[]=fgets($fh,128);
  fclose($fh);
  $avail=0;
  for ($k=0;$k<count($buf);$k++)
  {
    $buf[$k]=strip_tags($buf[$k]);
    $buf[$k]=trim($buf[$k]);
    $pos=strpos($buf[$k],$dom.$domt." not Exists");
    if (is_integer($pos))
    {
      $regdet[]=$dom.$domt." no match";
      break;
    }
  }
  $regdet[]="Full whois for ".$domt." domains not available";
  $available=0;
  for($index=0;$index<count($regdet);$index++)
  {
    $lne=strtolower($regdet[$index]);
    $pos=strpos($lne,"no match");
    if (is_integer($pos))
    {
      $available=1;
    }
  }
  if ($available==1)
    return(0); // Domain is not registered
  return(1);
}

function sawhois($dom,$domt,&$regdet)
{
  $regdet="";
  if (!(
$fh=@fopen("http://www.saudinic.net.sa/cgi-bin/whois.cgi?Domain=".$dom."&Level=".$domt,"r")))
    return(5);
  $buf="";
  while (!feof($fh))
   $buf[]=fgets($fh,128);
  fclose($fh);
  $fnd=0;
  for ($k=0;$k<count($buf);$k++)
  {
    $buf[$k]=strip_tags($buf[$k]);
    $buf[$k]=trim($buf[$k]);
    $pos=strpos($buf[$k],$dom.$domt);
    $pos2=strpos($buf[$k],"@saudinic.net.sa");
    if ((is_integer($pos)) && (is_integer($pos2)==False))
      $fnd=1;
    if ($fnd==1)
      $regdet[]=$buf[$k];
  }
  $available=0;
  for($index=0;$index<count($regdet);$index++)
  {
    $lne=strtolower($regdet[$index]);
    $pos=strpos($lne,"not registered");
    if (is_integer($pos))
    {
      $available=1;
    }
  }
  if ($available==1)
    return(0); // Domain is not registered
  return(1);
}

function eswhois($dom,$domt,&$regdet)
{
  $regdet="";
  if (!(
$fh=@fopen("http://ineco.nic.es/cgi-bin/consulta.whois?list=Dominios&key=".$dom.$domt."&tipo=procesar","r")))
    return(5);
  $buf="";
 $buf=fread($fh,100000);
  fclose($fh);
  $buf=eregi_replace("</tr>","/n",$buf);
  $buf=strip_tags($buf);
  $buf2=explode("/n",$buf);
 $blankflag=0;
  for ($k=0;$k<count($buf2);$k++)
  {
    $buf2[$k]=trim($buf2[$k]);
    if (($buf2[$k]!="") && (strlen($buf2[$k])>1))
    {
     $blankflag=0;
      $regdet[]=$buf2[$k];
    }
    if (($buf2[$k]=="") && ($blankflag==0))
    {
     $blankflag=1;
      $regdet[]=$buf2[$k];
    }
  }
  $available=0;
  for($index=0;$index<count($regdet);$index++)
  {
    $lne=strtolower($regdet[$index]);
    $pos=strpos($lne,"encontrado");
    if (is_integer($pos))
    {
      $available=1;
    }
  }
  if ($available==1)
    return(0); // Domain is not registered
  return(1);
}

function fmwhois($dom,$domt,&$regdet)
{
  $regdet="";
  if (!(
$fh=@fopen("http://www.dot.fm/whois.cfm?domain=".$dom.$domt,"r")))
    return(5);
  $buf="";
 $buf=fread($fh,100000);
  fclose($fh);
  $buf=strip_tags($buf);
  $buf2=explode("/n",$buf);
 $blankflag=0;
  for ($k=0;$k<count($buf2);$k++)
  {
    $buf2[$k]=trim($buf2[$k]);
    if (($buf2[$k]!="") && (strlen($buf2[$k])>1))
    {
     $blankflag=0;
      $regdet[]=$buf2[$k];
    }
    if (($buf2[$k]=="") && ($blankflag==0))
    {
     $blankflag=1;
      $regdet[]=$buf2[$k];
    }
  }
  $available=0;
 $premium="";
  for($index=0;$index<count($regdet);$index++)
  {
    $lne=strtolower($regdet[$index]);
    $pos=strpos($lne,"no match");
    if (is_integer($pos))
    {
      $available=1;
    }
    $pos=strpos($lne,"1st year registration:");
    if (is_integer($pos))
    {
      $premium=substr($lne,$pos+24,strlen($lne)-$pos-24);
    }
  }
  if ($premium!="")
  {
   $premium=sprintf("%01.2f",$premium);
    $regdet[]=$premium;
    return(6); // Return available at premium
  }
  if ($available==1)
    return(0); // Domain is not registered
  return(1);
}

function tvwhois($dom,$domt,&$regdet)
{
  $regdet="";
  if (!(
$fh=@fopen("http://www.tv/en-def-5e58a43774d2/cgi-bin/multilookup.cgi?domain=".$dom."&tv=1","r")))
  {
    return(5);
  }
  $buf="";
 $buf=fread($fh,100000);
  fclose($fh);
  $buf=strip_tags($buf);
  $pos=strpos($buf,$dom.$domt." is not available");
  if (is_integer($pos))
  {
  $regdet[]=$dom.$domt."  is not available";
   $regdet[]="Full whois for ".$domt." domains not available";
    return(1);
  }
  $pos=strpos($buf,$dom.$domt."  is available");
  if (is_integer($pos))
  {
  $regdet[]=$dom.$domt." is available";
    return(0);
  }
  $pos=strpos($buf,$dom.$domt."  is an available premium name");
  if (is_integer($pos))
  {
  $regdet[]=$dom.$domt." is an available premium name";
   $pos=strpos($buf,"$",$pos);
   $pos2=strpos($buf," ",$pos);
  $premium=substr($buf,$pos+1,$pos2-$pos-1);
   $premium=eregi_replace(",","",$premium);
   $premium=sprintf("%01.2f",$premium);
    $regdet[]=$premium;
    return(6);
  }
  return(1);
}

function djwhois($dom,$domt,&$regdet)
{
  $regdet="";
  sendToHost('www.dj-domains.com','post','/chk/index.php','domain_name='.$dom,$buf);
  if (count($buf)==0)
    return(5); // No connection to whois server made
  $available=0;
  $premium=0;
  for ($k=0;$k<count($buf);$k++)
  {
    $pos=strpos(strtolower($buf[$k]),"domain is available");
    if (is_integer($pos))
      $available=1;
    // See if premium domain
    $pos=strpos(strtolower($buf[$k]),"this is a /"premium/" domain name");
    if (is_integer($pos))
      $premium=1;
    // Get premium price
    $pos=strpos(strtolower($buf[$k]),"dname=".$dom."&price=");
    if (is_integer($pos))
    {
     $pos2=strpos(strtolower($buf[$k]),",",$pos);
      $price=substr($buf[$k],$pos+strlen("dname=".$dom."&price="),$pos2-$pos-strlen("dname=".$dom."&price=")+3);
      $price=strtr($price,",",".");
    }
  }
  // If whois not contactable
  if (($premium==1) && ($available==1))
  {
    $regdet[]="Domain is available at a premium. Price in Euro's is ".$price;
    $regdet[]=$price;
    return(6);
  }
  if ($available==1)
  {
    $regdet[]=$dom.".dj is available";
    return(0);
  }
  if (($available==0) && ($regdet!="*"))
  {
   sendToHost2('www.dj-domains.com','post','/whois/index.php','whoisdname='.$dom."&action=chk_whois",$buf);
   $buf=eregi_replace("<br>","/n",$buf);
   $buf=strip_tags($buf);
   $buf2=explode("/n",$buf);
    $start=0;
    $finish=0;
    for ($k=0;$k<count($buf2);$k++)
    {
     if (($start==1) && (trim($buf2[$k])!=""))
       $regdet[]=$buf2[$k];
     $pos=strpos(strtolower($buf2[$k]),"result:");
     if (is_integer($pos))
    $start=1;
     $pos=strpos(strtolower($buf2[$k]),"name server:");
     if (is_integer($pos))
    $finish=1;
      if (($finish==1) && (trim($buf2[$k])==""))
        break;
    }
  }
  return(1);
}

function bewhois($dom,$domt,&$regdet)
{
  if ($regdet=="*")
  {
   $regdet="";
  
$connection=@fsockopen("whois.dns.be",4343,$errorno,$errordesc);
   if ($connection)
   {
     fputs($connection,"GET 1.0 $dom/r/n");
     while(!feof($connection))
     {
       $regdet[]=fgets($connection,255);
     }
     fclose($connection);
  &, nbsp;  if (count($regdet)<2)
       return(5);
      $registered=1;
     for($index=0;$index<count($regdet);$index++)
     {
       $lne=strtolower($regdet[$index]);
       $pos=strpos($lne,"free");
       if (is_integer($pos))
        {
         $registered=0;
          break;
        }
     }
      return($registered);
   }
   else
     return(5);
  }
  else
  {
   $regdet="";
  
$connection=@fsockopen("whois.dns.be",43,$errorno,$errordesc);
   if ($connection)
   {
     fputs($connection,$dom.$domt."/r/n");
     while(!feof($connection))
     {
       $regdet[]=fgets($connection,255);
     }
     fclose($connection);
     if (count($regdet)<2)
       return(5);
      $registered=1;
     for($index=0;$index<count($regdet);$index++)
     {
       $lne=strtolower($regdet[$index]);
       $pos=strpos($lne,"no such domain");
       if (is_integer($pos))
        {
         $registered=0;
          break;
        }
     }
      return($available);
   }
   else
     return(5);
  }
}

function nlwhois($dom,$domt,&$regdet)
{
  if ($regdet=="*")
  {
   $regdet="";
  
$connection=@fsockopen("whois.domain-registry.nl",43,$errorno,$errordesc);
   if ($connection)
   {
     fputs($connection,"Is ".$dom.$domt."/r/n");
     while(!feof($connection))
     {
       $regdet[]=fgets($connection,255);
     }
     fclose($connection);
     if (count($regdet)<2)
       return(5);
      $registered=1;
     for($index=0;$index<count($regdet);$index++)
     {
       $lne=strtolower($regdet[$index]);
       $pos=strpos($lne,"free");
       if (is_integer($pos))
        {
         $registered=0;
          break;
        }
     }
      return($registered);
   }
   else
     return(5);
  }
  else
  {
   $regdet="";
  
$connection=@fsockopen("whois.domain-registry.nl",43,$errorno,$errordesc);
   if ($connection)
   {
     fputs($connection,$dom.$domt."/r/n");
     while(!feof($connection))
     {
       $regdet[]=fgets($connection,255);
     }
     fclose($connection);
     if (count($regdet)<2)
       return(5);
      $registered=1;
     for($index=0;$index<count($regdet);$index++)
     {
       $lne=strtolower($regdet[$index]);
       $pos=strpos($lne,"not a registered domain");
       if (is_integer($pos))
        {
         $registered=0;
          break;
        }
     }
      return($available);
   }
   else
     return(5);
  }
}
?>