<html>
<head><title>Gerador de Registro dns</title></head>
<body>
<form name="gerar_registro" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="POST">
<table>
<tr>
<td align="center">Bloco de IP</td>
<td align="center">Inicio</td>
<td align="center">Final</td>
<td align="center">Dominio</td>
<td align="center"></td>
</tr>
<tr>
<td><input type="text" name="bloco" id="bloco" size="25" /></td>
<td><input type="text" name="inicio" id="inicio" size="5" />-</td>
<td><input type="text" name="final" id="final" size="5" /></td>
<td><input type="text" name="dominio" id="dominio" size="40" /></td>
<td><input type="submit" name="gerar" id="gerar" value="Gerar" /></td>
</tr>
</table>
</form>
<?php
/**
* @author Elton Estevam
* @copyright 2013
*/
if(!empty($_POST['bloco'])){
$bloco = $_POST['bloco'];
$inicio = $_POST['inicio'];
$final = $_POST['final'];
$dominio = $_POST['dominio'];
echo "REGISTRO TIPO PTR <br /><br />";
echo "<form name='registros'>";
echo "<textarea rows=\"10\" cols=\"80\" onclick=\"focus();select();copy();\">";
for($i=$inicio; $i <= $final; $i++){
echo $i." IN PTR ".str_replace(".", "-", $bloco)."-".$i.".".$dominio.".\n";
//echo $bloco.".".$i."<br />";
}
echo "</textarea>";
echo "<br /><br />";
echo "REGISTRO TIPO A <br /><br />";
echo "<textarea rows=\"10\" cols=\"80\" onclick=\"focus();select();copy();\">";
for($i=$inicio; $i <= $final; $i++){
echo str_replace(".", "-", $bloco)."-".$i." A ".$bloco.".".$i."\n";
}
echo "</textarea>";
echo "</form>";
}
?>
</body>
</html>