Added dns functionality

This commit is contained in:
Slatian
2023-02-12 01:24:39 +01:00
parent afdec2b8a2
commit b21aa5192f
5 changed files with 436 additions and 2 deletions

39
templates/dig.html Normal file
View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<title>Dig: {{ dig_query }}</title>
</head>
<body>
<h1>Lookup for: {{ dig_query }}</h1>
{% if dig_result.a %}
<p>A (IPv4) records:</p>
<ul>
{% for address in dig_result.a%}
<li><code>{{address}}</code></li>
{% endfor %}
</ul>
{% endif %}
{% if dig_result.aaaa %}
<p>AAAA (IPv6) records:</p>
<ul>
{% for address in dig_result.aaaa%}
<li><code>{{address}}</code></li>
{% endfor %}
</ul>
{% endif %}
{% if dig_result.mx %}
<p>MX (Mail Exchange) records:</p>
<ul>
{% for mx in dig_result.mx%}
<li>{{mx.preference}} <code><a href="/dig?name={{mx.exchange}}">{{mx.exchange}}</a></code></li>
{% endfor %}
</ul>
{% endif %}
</body>
</html>

View File

@ -6,5 +6,8 @@
<body>
<h1>Your IP-Address is: {{ ip }}</h1>
<p>Your requested format was: <b>{{format}}</b></p>
{% if hostname %}
<p>Hostname: <b>{{hostname}}</b></p>
{% endif %}
</body>
</html>