echoip-slatecave/templates/dig.html

214 lines
8.0 KiB
HTML
Raw Normal View History

2023-02-23 21:24:35 +01:00
{% extends "base.html" %}
{% import "helpers.html" as helper %}
{% import "links.html" as links %}
2023-02-23 21:24:35 +01:00
{% block title %}dig {{ data.query }}{% endblock %}
{% block og_title %}dig {{ data.query }}{% endblock %}
2023-08-06 01:32:23 +02:00
{% block h1 %}dig <code>{{ helper::breadcrumb_domain(extra=extra, name=data.query) }}</code> <small>via <a href="{{extra.base_url}}/dns_resolver/{{data.result.used_dns_resolver}}">{{data.result.used_dns_resolver}}</a></small>{% endblock %}
2023-02-23 21:24:35 +01:00
{% block og_path %}/dig/{{ data.query | urlencode_strict }}{% endblock %}
{% block content %}
{% if data.result.idn %}
{% set idn = data.result.idn %}
<section>
<h2>Internationalized Domain Names</h2>
2023-04-29 13:05:48 +02:00
<p>Because of some limitations the DNS has, Unicode characters need a special encoding.</p>
2023-02-23 21:24:35 +01:00
{% if idn.original_was == "unicode" %}
<p>Your Unicode query has been encoded as the <i>IDN</i> <code>{{ idn.idn }}</code> to generate the results below.</p>
{% else %}
<p>Your <i>IDN</i> would decode to <code>{{ idn.unicode }}</code>.</p>
{% endif %}
</section>
{% endif %}
{% set r = data.result.records %}
<section>
<h2>DNS Records</h2>
2023-02-24 20:17:25 +01:00
2023-08-07 21:09:14 +02:00
{% set show_nonpresent = true %}
{% if r.unkown_resolver %}
<p class="error box">The resolver you chose is not one of the available ones, if you can reproduce this error by just using the UI <a href="https://codeberg.org/slatian/service.echoip-slatecave/issues/new">please report it</a>.</p>
{% set show_nonpresent = false %}
{% elif r.invalid_name %}
<p class="error box">This domain name does not conform to <a href="https://www.rfc-editor.org/info/std3">the dns specification (std3)</a> rules and was therefore not resolved.</p>
{% set show_nonpresent = false %}
{% elif r.nxdomain %}
<p class="error box">The DNS-Server claims that this domain doesn't exist, there shouldn't be any results.</p>
{% set show_nonpresent = false %}
2023-02-24 20:17:25 +01:00
{% elif r.timeout %}
<p class="error box">There was at least one timeout error while resolving this domain, the results below are incomplete.</p>
{% elif r.other_error %}
<p class="error box">An error happened while resolving this name, the results below are incomplete. There was probably some IO issue, the error has been written to the log to help with debugging.</p>
{% endif %}
{% if r.dns_error %}
<p class="error box">The DNS-Server returned an error code that is not NXDomain, the results are probably incomplete. To help with debugging this has been written to the log.</p>
{% endif %}
{% if r.cname %}
<p>This domain has a <code>CNAME</code> set, this means its contents are full replaced by the linked record.</p>
2023-02-24 20:17:25 +01:00
2023-02-25 12:08:46 +01:00
<p class="button-paragraph">{{ helper::dig(extra=extra, name=r.cname[0]) }}</p>
2023-02-24 20:17:25 +01:00
2023-04-29 13:05:48 +02:00
</p>Usually you get the <code>A</code> and <code>AAAA</code> records for the linked record to avoid unnecessary requests. If anything else resolves, that is a violation of the DNS specification.</p>
2023-02-24 20:17:25 +01:00
{% if r.cname | length > 1 %}
<p>This domain resolves to multiple <code>CNAME</code>s, this is not allowed by the DNS specification!</p>
{% endif %}
{% endif %}
{% if r.aname %}
<p>This domain has one or multiple <code>ANAME</code> (or <code>ALIAS</code>) records set that the DNS server communicates:</p>
<ul class="link-list">
{% for aname in r.aname%}
<li>{{ helper::dig(extra=extra, name=aname) }}</li>
{% endfor %}
</ul>
{% endif %}
2023-02-12 17:35:32 +01:00
{% if r.a %}
2023-02-23 21:24:35 +01:00
<p id="a"><code>A</code> (IPv4) records:</p>
<ul class="link-list">
2023-02-12 17:35:32 +01:00
{% for address in r.a%}
2023-02-23 21:24:35 +01:00
<li>{{ helper::ip(extra=extra, ip=address) }}</li>
2023-02-12 01:24:39 +01:00
{% endfor %}
</ul>
2023-08-07 21:09:14 +02:00
{% elif show_nonpresent %}
2023-02-18 22:16:09 +01:00
<p>No <code>A</code> (IPv4) Records.</p>
2023-02-12 01:24:39 +01:00
{% endif %}
2023-02-12 17:35:32 +01:00
{% if r.aaaa %}
2023-02-23 21:24:35 +01:00
<p id="aaaa"><code>AAAA</code> (IPv6) records:</p>
<ul class="link-list">
2023-02-12 17:35:32 +01:00
{% for address in r.aaaa%}
2023-02-23 21:24:35 +01:00
<li>{{ helper::ip(extra=extra, ip=address) }}</li>
2023-02-12 01:24:39 +01:00
{% endfor %}
</ul>
2023-08-07 21:09:14 +02:00
{% elif show_nonpresent %}
2023-02-18 22:16:09 +01:00
<p>No <code>AAAA</code> (IPv6) Records.</p>
2023-02-12 01:24:39 +01:00
{% endif %}
2023-02-23 21:24:35 +01:00
{% if not data.result.partial_lookup %}
2023-02-12 17:35:32 +01:00
{% if r.mx %}
2023-02-23 21:24:35 +01:00
<p id="mx"><code>MX</code> (Mail Exchange) records:</p>
<ul class="link-list">
2023-02-24 20:17:25 +01:00
{% for mx in r.mx | sort(attribute="preference") | reverse %}
2023-02-23 21:24:35 +01:00
<li>{{ helper::dig(extra=extra, name=mx.exchange, fqdn=true, prefix=mx.preference) }}</li>
2023-02-12 01:24:39 +01:00
{% endfor %}
</ul>
2023-08-07 21:09:14 +02:00
{% elif show_nonpresent %}
<p id="mx">No <code>MX</code> (Mail Exchange) records.</p>
2023-02-12 01:24:39 +01:00
{% endif %}
{% if r.soa %}
<p id="soa"><code>SOA</code> (Source of Authority) records:</p>
<ul>
{% for soa in r.soa %}
<li><dl class="box">
<dt>MName (Original Source)</dt>
<dd>{{ helper::dig(extra=extra,name=soa.mname) }}</dd>
<dt>RName (Responsible)</dt>
<dd>{{ helper::dig(extra=extra,name=soa.rname) }}</dd>
<dt>Serial</dt>
<dd>{{soa.serial}}</dd>
<dt>Refresh</dt>
<dd>{{soa.refresh / 60 | round(precision=2) }}m</dd>
<dt>Retry </dt>
<dd>{{soa.retry / 60 | round(precision=2) }}m</dd>
<dt>Expire</dt>
<dd>{{soa.expire / 3600 | round(precision=2) }}h</dd>
<dt>Minimum</dt>
<dd>{{soa.minimum / 60 | round(precision=2) }}m</dd>
</dl></li>
{% endfor %}
</ul>
2023-08-07 21:09:14 +02:00
{% elif show_nonpresent %}
<p id="soa">No <code>SOA</code> records.</p>
{% endif %}
{% if r.ns %}
<p id="ns"><code>NS</code> (Name Server) records:</p>
<ul class="link-list">
{% for ns in r.ns | sort %}
<li>{{ helper::dig(extra=extra, name=ns) }}</li>
{% endfor %}
</ul>
2023-08-07 21:09:14 +02:00
{% elif show_nonpresent %}
<p id="ns">No <code>NS</code> (Name Server) records.</p>
{% endif %}
2023-02-24 20:17:25 +01:00
{% if r.caa %}
<p id="caa"><code>CAA</code> (<a targt="_blank" href="https://de.wikipedia.org/wiki/DNS_Certification_Authority_Authorization">Certification Authority Authorization</a>) records:</p>
<ul>
{% for caa in r.caa %}
<li><code>{{caa}}</code></li>
{% endfor %}
</ul>
2023-08-07 21:09:14 +02:00
{% elif show_nonpresent %}
2023-02-24 20:17:25 +01:00
<p id="caa">No <code>CAA</code> (<a target="_blank" href="https://de.wikipedia.org/wiki/DNS_Certification_Authority_Authorization">Certification Authority Authorization</a>) records.</p>
{% endif %}
{% if r.txt %}
<p id="txt"><code>TXT</code> records:</p>
<ul>
{% for txt in r.txt %}
<li><code>{{txt}}</code></li>
{% endfor %}
</ul>
2023-08-07 21:09:14 +02:00
{% elif show_nonpresent %}
2023-02-24 20:17:25 +01:00
<p id="txt">No <code>TXT</code> records.</p>
{% endif %}
{% if r.srv %}
<p id="srv"><code>SRV</code> records:</p>
<ul>
2023-02-24 20:17:25 +01:00
{% for srv in r.srv %}
<li><dl class="box">
2023-02-24 20:17:25 +01:00
<dt>Priority</dt>
<dd>{{srv.priority}}</dd>
<dt>Weight</dt>
<dd>{{srv.weight}}</dd>
<dt>Port</dt>
<dd>{{srv.port}}</dd>
<dt>Target</dt>
<dd>{{ helper::dig(extra=extra,name=srv.target) }}</dd>
</dl></li>
2023-02-24 20:17:25 +01:00
{% endfor %}
</ul>
2023-08-07 21:09:14 +02:00
{% elif show_nonpresent %}
2023-02-24 20:17:25 +01:00
<p id="srv">No <code>SRV</code> records.</p>
<p><code>SRV</code> or Service records usually live on their own subdomains like {{ helper::dig(extra=extra, name="_xmpp-client._tcp."~data.query) }}.
{% endif %}
2023-02-23 21:24:35 +01:00
{% else %}{# if data.partial_lookup #}
<p>To save resources the above is only a partial lookup.</p>
<p class="button-paragraph"><a href="{{ helper::dig_link(extra=extra, name=data.query) }}">Extended DNS Lookup for <code>{{ data.query }}</code>.</a></p>
{% endif %}
2023-02-24 20:17:25 +01:00
2023-02-23 21:24:35 +01:00
</section>
2023-02-12 01:24:39 +01:00
<section>
<h2>Other Services</h2>
{{ links::domain_name_links(name=idn.idn|default(value=data.query))}}
</section>
2023-02-24 20:17:25 +01:00
<section>
2023-04-29 13:05:48 +02:00
<h2>Programmatic Lookup</h2>
2023-02-24 20:17:25 +01:00
<p>If you want to look up this information in another program the short answer is <b>don't, look up the names using your local DNS!</b></p>
<p>On most systems on the commandline you have commands like <code>host</code> and <code>dig</code> even when not present you can probably use <code>ping</code> as a workaround as it resolves the name and gives you the IP-Address it is pinging.</p>
<h3>Why querying this service is still useful</h3>
2023-02-24 20:17:25 +01:00
<p>This service most probably doesn't share its cache with your local resolver, this way you have a way to see if your DNS-change had the effect it should have.</p>
2023-04-29 13:05:48 +02:00
<p>It may also be useful for debugging other DNS problems or to get around a local resolver that is lying to you because your ISP is a <i>something</i>.</p>
<h3>How?</h3>
<p>You can choose between the <code>html</code>, <code>text</code> and <code>json</code> format.</p>
2023-04-29 13:05:48 +02:00
<p>An example of an URL could be: <code>{{ extra.base_url }}/dig/example.org?format=json</code></p>
2023-02-24 20:17:25 +01:00
</section>
2023-02-23 21:24:35 +01:00
{% endblock %}