Domein checken

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Mitchel V

Mitchel V

04/03/2011 17:51:32
Quote Anchor link
Hallo.

Ik heb veel rond gezocht naar een domein checker...
maar kon niet echt iets gemakkelijk's vinden dus heb ik zelf wat geknutseld.

Het probleem is alsvolgt:
www.verschoof.nl bestaat, maar als ik die opzoek zegt hij dat hij niet bestaat.
wat gaat er fout in mijn script?
Voor de rest werkt hij prima.

Ik heb het volgende:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
function checkDomain($domain,$server,$findText){
    // Open a socket connection to the whois server
    $con = fsockopen($server, 43);
    if (!$con) return false;
    
    // Send the requested doman name
    fputs($con, $domain."\r\n");
    
    // Read and store the server response
    $response = ' :';
    while(!feof($con)) {
        $response .= fgets($con,128);
    }

    
    // Close the connection
    fclose($con);
    // Check the response stream whether the domain is available
    if (strpos($response, $findText)){
        return true;
    }
else{
        return false;  
    }
}
function
showDomainResult($domain,$server,$findText){
    if (checkDomain($domain,$server,$findText)){
        $antwoord = 'Het domein '.$domain.' is beschikbaar.';
    }
else{
        $antwoord = 'Het domein '.$domain.' is al bezet.';
    }

    
    return $antwoord;
}


$serverdefs= array(
    "com" => array("whois.crsnic.net","No match for"),
    "net" => array("whois.crsnic.net","No match for"),                
    "org" => array("whois.pir.org","NOT FOUND"),                    
    "biz" => array("whois.biz","Not found"),                    
    "info" => array("whois.afilias.net","NOT FOUND"),                    
    "co.uk" => array("whois.nic.uk","No match"),                    
    "co.ug" => array("wawa.eahd.or.ug","No entries found"),    
    "or.ug" => array("wawa.eahd.or.ug","No entries found"),
    "ac.ug" => array("wawa.eahd.or.ug","No entries found"),
    "ne.ug" => array("wawa.eahd.or.ug","No entries found"),
    "sc.ug" => array("wawa.eahd.or.ug","No entries found"),
    "nl"     => array("whois.domain-registry.nl","not a registered domain"),
    "ro" => array("whois.rotld.ro","No entries found for the selected"),
    "com.au" => array("whois.ausregistry.net.au","No data Found"),
    "ca" => array("whois.cira.ca", "AVAIL"),
    "org.uk" => array("whois.nic.uk","No match"),
    "name" => array("whois.nic.name","No match"),
    "us" => array("whois.nic.us","Not Found"),
    "ws" => array("whois.website.ws","No Match"),
    "be" => array("whois.ripe.net","No entries"),
    "com.cn" => array("whois.cnnic.cn","no matching record"),
    "net.cn" => array("whois.cnnic.cn","no matching record"),
    "org.cn" => array("whois.cnnic.cn","no matching record"),
    "no" => array("whois.norid.no","no matches"),
    "se" => array("whois.nic-se.se","No data found"),
    "nu" => array("whois.nic.nu","NO MATCH for"),
    "com.tw" => array("whois.twnic.net","No such Domain Name"),
    "net.tw" => array("whois.twnic.net","No such Domain Name"),
    "org.tw" => array("whois.twnic.net","No such Domain Name"),
    "cc" => array("whois.nic.cc","No match"),
    "nl" => array("whois.domain-registry.nl","is free"),
    "pl" => array("whois.dns.pl","No information about"),
    "pt" => array("whois.ripe.net","No entries found"),
    "de" => array("whois.denic.de","not found in database"),
    "in" => array("whois.inregistry.net","NOT FOUND"),
    "eu" => array("whois.eu","FREE"),
    "za.org" => array("whois.za.net","No such domain"),
    "za.net" => array("whois.za.net","No such domain"),
    "tv" => array("tvwhois.verisign-grs.com","No match for")
);

// The form was submitted
if ($_SERVER['REQUEST_METHOD'] == "POST"){
    $domainbase = $_POST['domainname'];
    $d_com = $_POST['com'];    
    
    // Check domains only if the base name is big enough
    if (strlen($domainbase)>2){
        if($serverdefs['com'] == ""){
            echo '.'.$_POST['com'].' bestaat niet';
        }
else{
            $i = 1;
            foreach($serverdefs['com'] AS $een){
                $waarde[$i] = $een;
                $i ++;
            }

        showDomainResult($domainbase.$_POST['com'], $waarde[1], $waarde[2]);
        }
    }
}

echo '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="domain">
Domain name:
<table>
<tr><td><input name="domainname" type="text" /><select name="com">'
;
foreach($serverdefs AS $domein => $anders){
    if($domein == "nl"){
        echo '<option SELECTED>.'.$domein.'</option>';
    }
else{
        echo '<option>.'.$domein.'</option>';
    }
}

echo '</select></td></tr>
<tr><td><input type="submit" value="Check domain"/></td></tr>
</table>  
</form>'
;
?>


Toevoeging op 05/03/2011 04:02:23:

Ik heb een nieuwe controle manier bedacht,
dat doe ik al volgt;

Ik haal de IP op van www.google.nl
$ip = 74.125.79.104;
dus hij vindt een ip, dat betekend dat hij bestaat, als hij niets vindt geeft hij het ip van je eigen domein.
dus dan weet je dat hij beschikbaar is, is dit een betrouwbare methode?


Toevoeging op 05/03/2011 04:02:34:

Ik heb een nieuwe controle manier bedacht,
dat doe ik al volgt;

Ik haal de IP op van www.google.nl
$ip = 74.125.79.104;
dus hij vindt een ip, dat betekend dat hij bestaat, als hij niets vindt geeft hij het ip van je eigen domein.
dus dan weet je dat hij beschikbaar is, is dit een betrouwbare methode?
 
PHP hulp

PHP hulp

06/05/2024 14:22:21
 
Michael Rozenbeek

Michael Rozenbeek

09/03/2011 12:49:12
 
Write Down

Write Down

09/03/2011 13:01:55
Quote Anchor link
Overigens is je methode niet 100% correct. Ik heb bijvoorbeeld een domein liggen dat ik nog niet gebruik. Bij mijn DNS is het domein nog naar geen enkele server gelinked, maar het bestaat dus wel. (en jij zal geen IP krijgen, want ik heb nog geen verbonden)
 
Mitchel V

Mitchel V

13/03/2011 00:34:10
Quote Anchor link
klopt ip methode heb ik er uit gehaald.
Maar hij klopt nog niet helemaal denk ik...

@micheal
dat script is 8 jaar geleden gepost..
ik ga er van uit dat ze nu andere/betere methodes gebruiken..
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.