tools/.hta_slug/mx-lookup.php

36 lines
2.4 KiB
PHP

<section class="diZContainer diZmxAuto">
<h2 class="diZBorderBottom">Domain MX Information Viewer</h2>
<p class="diZTextJustify diZmb4">The Domain MX Information Viewer is a powerful and easy-to-use tool designed to help IT professionals and website administrators retrieve detailed mail exchange (MX) records for any given domain. Simply enter a domain name, and this tool will perform a DNS lookup to fetch and display the MX records, providing insights into the domain's email routing information.</p>
<form method="post" class="diZToolsSection diZmt4 diZmb4 diZBorderRadius diZPadding5px ">
<div class="diZFlexRowCol diZJustifyCenter diZItemsCenter">
<input class="diZmr2 diZw70" placeholder="Domain Name" id="Domain" name="domain" type="text" required />
<button class="diZmr2" type="submit"><span>Check</span></button>
</div>
</form>
<?php
if (isset($_POST['domain']) && $_POST['domain']) {
function validateDomain($domain) {
return filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME);
}
$domain = $_POST['domain'];
if (validateDomain($domain)) {
$command = escapeshellcmd('dig ' . $domain . ' MX');
$output = shell_exec($command);
echo '<div class="diZContainer diZmxAuto diZPadding5px"><pre>' . htmlspecialchars($output, ENT_QUOTES, 'UTF-8') . '</pre></div>';
} else {
echo '<div class="diZContainer diZmxAuto diZPadding5px">Invalid domain.</div>';
}
}
?>
<div class="diZmy20">
<h3>Key Features:</h3>
<ul>
<li><strong>Accurate Domain Validation:</strong> Ensures the entered domain name is valid and properly formatted.</li>
<li><strong>Secure Processing:</strong> Utilizes command sanitization and output encoding to prevent security vulnerabilities like command injection and cross-site scripting (XSS).</li>
<li><strong>Instant Results:</strong> Quickly retrieves and displays MX records for the specified domain.</li>
<li><strong>User-Friendly Interface:</strong> Simplified input form for easy use without the need for additional styling.</li>
</ul>
<p>This tool is ideal for those seeking quick and reliable MX record information to manage and troubleshoot email delivery issues effectively.</p>
</div>
</section>