Scriptje om een lijst van domeinen af te gaan om hun IP adressen te krijgen.
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class getIPs {
private function ip($host) {
return gethostbyname($host);
}
public function start($file) {
$file = file_get_contents($file);
$file = explode("n", $file);
foreach($file AS $line) {
$line = preg_replace(/s+/, , $line);
file_put_contents("ips.txt", file_get_contents("ips.txt") . "n" . $this->ip(($line[strlen($line) - 1] == / ? substr_replace($line ,,-1) : $line)));
}
}
}
$Yahoo = new getIPs();
$Yahoo->start(domains.txt);
Codeblok (voorbeeld.php):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class getIPs {
private function ip($host) {
return gethostbyname($host);
}
public function start($file) {
$file = file_get_contents($file);
$file = explode("n", $file);
foreach($file AS $line) {
$line = preg_replace(/s+/, , $line);
file_put_contents("ips.txt", file_get_contents("ips.txt") . "n" . $this->ip(($line[strlen($line) - 1] == / ? substr_replace($line ,,-1) : $line)));
}
}
}
$Yahoo = new getIPs();
$Yahoo->start(domains.txt);


Maar dit is dan sowieso een veel betere versie (en voor een andere server) 
