]> git.ipfire.org Git - ipfire.org.git/commitdiff
location: Create page for the new DNS feature
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 1 Apr 2024 12:08:51 +0000 (12:08 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 1 Apr 2024 12:08:51 +0000 (12:08 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/location/how-to-use/dns.html [new file with mode: 0644]
src/templates/location/how-to-use/index.html
src/web/__init__.py

index fa2cfc2ac4410753f320e22ec9138ce144381eb5..8c42243a49144a124aada11858c6c54aefe24aff 100644 (file)
@@ -270,6 +270,7 @@ templates_locationdir = $(templatesdir)/location
 
 templates_location_how_to_use_DATA = \
        src/templates/location/how-to-use/cli.html \
+       src/templates/location/how-to-use/dns.html \
        src/templates/location/how-to-use/index.html \
        src/templates/location/how-to-use/python.html
 
diff --git a/src/templates/location/how-to-use/dns.html b/src/templates/location/how-to-use/dns.html
new file mode 100644 (file)
index 0000000..66f34cd
--- /dev/null
@@ -0,0 +1,146 @@
+{% extends "../../base.html" %}
+
+{% block title %}{{ _("How To Use?") }} - {{ _("DNS") }}{% end block %}
+
+{% block container %}
+       <section class="hero is-light">
+               <div class="hero-body">
+                       <div class="container">
+                               <nav class="breadcrumb" aria-label="breadcrumbs">
+                                       <ul>
+                                               <li>
+                                                       <a href="/">
+                                                               {{ _("Home") }}
+                                                       </a>
+                                               </li>
+                                               <li>
+                                                       <a href="/location">
+                                                               {{ _("Location") }}
+                                                       </a>
+                                               </li>
+                                               <li>
+                                                       <a href="/location/how-to-use">
+                                                               {{ _("How To Use?") }}
+                                                       </a>
+                                               </li>
+                                               <li class="is-active">
+                                                       <a href="#" aria-current="page">{{ _("DNS") }}</a>
+                                               </li>
+                                       </ul>
+                               </nav>
+
+                               <h1 class="title">{{ _("DNS") }}</h1>
+                       </div>
+               </div>
+       </section>
+
+       <section class="section">
+               <div class="container">
+                       <div class="block">
+                               <p class="is-size-5">
+                                       If you cannot use the IPFire Location database on your hosts,
+                                       we offer a DNS service to query parts of the data just by
+                                       sending a DNS query allowing to integrate this database into
+                                       more applications.
+                               </p>
+                       </div>
+
+                       <div class="block">
+                               <p class="is-size-5">
+                                       Queries function on the principle of reverse lookups and are
+                                       fast and globally cacheable.
+                               </p>
+                       </div>
+
+                       <div class="notification">
+                               This is a new, experimental feature. The API, behaviour and format of the
+                               responses might be subject to change.
+                       </div>
+               </div>
+       </section>
+
+       <section class="section">
+               <div class="container">
+                       <h4 class="title is-4">
+                               {{ _("Query Country Codes") }} - <code>cc.location.ipfire.org</code>
+                       </h4>
+
+                       <div class="content">
+                               <p>
+                                       You can query the country code of an IP address.
+                               </p>
+                       </div>
+
+                       <pre><code>$ dig +short TXT 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.2.b.0.8.7.6.0.1.0.0.2.cc.location.ipfire.org
+"DE"
+
+$ dig +short TXT 38.27.3.81.cc.location.ipfire.org
+"DE"</code></pre>
+               </div>
+       </section>
+
+       <section class="section">
+               <div class="container">
+                       <h4 class="title is-4">
+                               {{ _("Query Origins") }} - <code>origin.location.ipfire.org</code>
+                       </h4>
+
+                       <div class="content">
+                               <p>
+                                       You can query the origin of an IP address which will give you
+                                       the AS number and name where that IP address originates from.
+                               </p>
+                       </div>
+
+                       <pre><code>$ dig +short TXT 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.2.b.0.8.7.6.0.1.0.0.2.origin.location.ipfire.org
+"AS204867 - Lightning Wire Labs GmbH"
+
+$ dig +short TXT 38.27.3.81.origin.location.ipfire.org
+"AS24679 - kyberio GmbH"</code></pre>
+               </div>
+       </section>
+
+       <section class="section">
+               <div class="container">
+                       <h4 class="title is-4">
+                               {{ _("Query AS Names") }} - <code>asn.location.ipfire.org</code>
+                       </h4>
+
+                       <div class="content">
+                               <p>
+                                       Resolve an AS number into a human-readable description.
+                               </p>
+                       </div>
+
+                       <pre><code>$ dig +short TXT 204867.asn.location.ipfire.org
+"Lightning Wire Labs GmbH"
+
+$ dig +short TXT 3320.asn.location.ipfire.org
+"Deutsche Telekom AG"
+
+$ dig +short TXT 15169.asn.location.ipfire.org
+"Google LLC"</code></pre>
+               </div>
+       </section>
+
+       <section class="section">
+               <div class="container">
+                       <h4 class="title is-4">
+                               {{ _("Query Bogons") }} - <code>bogons.location.ipfire.org</code>
+                       </h4>
+
+                       <div class="content">
+                               <p>
+                                       Check if an IP address is considered being a bogon.
+
+                                       That means that if an IP address is not part of the global routing
+                                       table, we will return <code>127.0.0.2</code>,
+                                       otherwise we will return <code>NXDOMAIN</code>.
+                               </p>
+                       </div>
+
+                       <pre><code>$ dig +short A 0.0.0.10.bogons.location.ipfire.org
+127.0.0.2</code></pre>
+               </div>
+       </section>
+{% end block %}
index 97e1eed1f9c386ab2fcf141948dd0293b8c5991e..1448d50c77e86940412c77ab484b2aed535527a1 100644 (file)
@@ -65,7 +65,7 @@
                                        {{ _("Lua") }}
                                </a>
 
-                               <a class="button is-light is-fullwidth" href="/location/how-to-use/dns" disabled>
+                               <a class="button is-light is-fullwidth" href="/location/how-to-use/dns">
                                        {{ _("DNS") }}
                                </a>
                        </div>
index 48a136052d12b8f9b6133e3fbaef8583476f79a5..42b0c3e9900049aa3df11273bdd2b870281999f4 100644 (file)
@@ -199,6 +199,7 @@ class Application(tornado.web.Application):
                        (r"/location/download", tornado.web.RedirectHandler, { "url" : "/location/install" }),
                        (r"/location/how\-to\-use", StaticHandler, { "template" : "location/how-to-use/index.html" }),
                        (r"/location/how\-to\-use/cli", StaticHandler, { "template" : "location/how-to-use/cli.html" }),
+                       (r"/location/how\-to\-use/dns", StaticHandler, { "template" : "location/how-to-use/dns.html" }),
                        (r"/location/how\-to\-use/python", StaticHandler, { "template" : "location/how-to-use/python.html" }),
                        (r"/location/install", StaticHandler, { "template" : "location/install.html" }),
                        (r"/location/lookup/(.+)", location.LookupHandler),