This commit is contained in:
Suvodip
2024-07-06 21:19:02 +05:30
parent b9e2e40f11
commit d368213568
23 changed files with 879 additions and 591 deletions

34
ns-lookup.php Normal file
View File

@@ -0,0 +1,34 @@
<section class="diZContainer diZmxAuto">
<h2 class="diZBorderBottom">Domain DNS Information Viewer</h2>
</section>
<!-- <p class="diZTextJustify">NS Lookup simplifies checking DNS records. Enter any domain to instantly retrieve and explore its DNS details, including A, AAAA, MX, CNAME records, and more. Ideal for IT professionals and website administrators seeking quick and accurate DNS insights.</p> -->
<form method="post" class="diZToolsSection diZmt4 diZmb4 diZBorderRadius diZPadding5px">
<div class="diZFlexRowCol diZJustifyCenter diZItemsCenter">
<input class="diZmr2 diZw70" placeholder="Domain" name="domain" type="text" />
<input class="diZmr2" type="submit" value="Check" />
</div>
</form>
<?php
if(isset($_POST['domain']) && $_POST['domain']){
function validateDomain($domain) {
$regex = "/^(?!\-)(?:[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]\.)+[a-zA-Z]{2,}$/";
if (preg_match($regex, $domain)) {
return true;
} else {
return false;
}
}
$domain = isset($_POST['domain']) ? $_POST['domain'] : '';
if ($domain && validateDomain($domain)) {
$command = 'dig '.$_POST['domain']. ' NS';
$escaped_command = escapeshellcmd($command);
$output = shell_exec($escaped_command);
echo '<div class="diZContainer diZmxAuto diZPadding5px"><pre class="diZTextJustify" style="width: fit-content;"> ',$output, '</pre> <br><br></div>';
} else {
echo "Invalid domain.";
}
}
?>