123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- <!DOCTYPE html>
- <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
- <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-
-
- <link rel="shortcut icon" href="../img/favicon.ico">
- <title>Installation de Knot-resolver - Les Tutoriels du Yojik</title>
- <link rel="stylesheet" href="../css/theme.css" />
- <link rel="stylesheet" href="../css/theme_extra.css" />
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css" />
-
- <script>
- // Current page data
- var mkdocs_page_name = "Installation de Knot-resolver";
- var mkdocs_page_input_path = "Knot.md";
- var mkdocs_page_url = null;
- </script>
-
- <script src="../js/jquery-2.1.1.min.js" defer></script>
- <script src="../js/modernizr-2.8.3.min.js" defer></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
- <script>hljs.initHighlightingOnLoad();</script>
-
- </head>
- <body class="wy-body-for-nav" role="document">
- <div class="wy-grid-for-nav">
-
- <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
- <div class="wy-side-scroll">
- <div class="wy-side-nav-search">
- <a href=".." class="icon icon-home"> Les Tutoriels du Yojik</a>
- <div role="search">
- <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
- <input type="text" name="q" placeholder="Search docs" title="Type search term here" />
- </form>
- </div>
- </div>
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
- <p class="caption"><span class="caption-text">Installation d'un serveur sécurisé, version Debian/Buster sur RaspberryPI</span></p>
- <ul class="current">
- <li class="toctree-l1"><a class="reference internal" href="..">Résumé</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../tutoraspi/">Présentation</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../Installation-de-base/">Installation de base</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../Premier-d%C3%A9marrage/">Premier démarrage</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../Etat-des-lieux/">État des lieux</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../S%C3%A9curisation-SSH/">Sécurisation SSH</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../R%C3%A9seau/">Réseau (des IPs fixes)</a>
- </li>
- <li class="toctree-l1 current"><a class="reference internal current" href="./">Installation de Knot-resolver</a>
- <ul class="current">
- <li class="toctree-l2"><a class="reference internal" href="#installation">Installation</a>
- </li>
- <li class="toctree-l2"><a class="reference internal" href="#configuration">Configuration</a>
- </li>
- <li class="toctree-l2"><a class="reference internal" href="#lancement-et-mise-en-service-automatique">Lancement et mise en service automatique</a>
- </li>
- <li class="toctree-l2"><a class="reference internal" href="#modification-de-etcdhcpcdconf">Modification de /etc/dhcpcd.conf</a>
- </li>
- </ul>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../Firewall/">Installation d'un pare-feux</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../Fail2ban/">Contrer les attaques de force brute</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../Logwatch/">Surveillance du serveur</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../Installation-courrier-basique/">Installation d'un serveur de courriers basique</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../Exemple-d-utilisation-serveur-Web/">Exemple d'utilisation avec un serveur Web</a>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="../Annexe/">Annexe</a>
- </li>
- </ul>
- </div>
- </div>
- </nav>
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
- <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
- <a href="..">Les Tutoriels du Yojik</a>
- </nav>
-
- <div class="wy-nav-content">
- <div class="rst-content">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
- <li><a href="..">Docs</a> »</li>
-
-
-
- <li>Installation d'un serveur sécurisé, version Debian/Buster sur RaspberryPI »</li>
-
-
-
- <li>Installation de Knot-resolver</li>
- <li class="wy-breadcrumbs-aside">
-
- </li>
- </ul>
-
- <hr/>
- </div>
- <div role="main">
- <div class="section">
-
- <h1 id="installation-de-knot-resolver">Installation de knot-resolver</h1>
- <p>Nous allons suivre la documentation officielle située ici : <a href="https://knot-resolver.readthedocs.io/en/stable/quickstart-startup.html">knot-resolver</a></p>
- <h2 id="installation">Installation</h2>
- <p>Installation du resolver et des programmes utilitaires</p>
- <pre><code>pi@piras:~ $ sudo apt install knot-resolver knot-dnsutils
- </code></pre>
- <h2 id="configuration">Configuration</h2>
- <p>Voilà le contenu de mon fichier de configuration /etc/knot-resolver/kresd.conf :</p>
- <pre><code>pi@piras:~ $ cat /etc/knot-resolver/kresd.conf
- -- Default empty Knot DNS Resolver configuration in -*- lua -*-
- -- Bind ports as privileged user (root) --
- net = { '127.0.0.1', '::1' }
- -- Switch to unprivileged user --
- user('knot-resolver','knot-resolver')
- -- Unprivileged
- -- cache.size = 100*MB
- pi@piras:~ $
- </code></pre>
- <p>J'ai dé-commenté les interfaces d'écoute.</p>
- <h2 id="lancement-et-mise-en-service-automatique">Lancement et mise en service automatique</h2>
- <p>On démarre le service</p>
- <pre><code>sudo systemctl start kresd@1.service
- </code></pre>
- <p>On rend le démarrage automatique</p>
- <pre><code>sudo systemctl enable --now kresd@1.service
- </code></pre>
- <p>On vérifie que le service est en route</p>
- <pre><code>sudo systemctl status kresd@1.service
- pi@piras:~ $ sudo systemctl status kresd@1.service
- ● kresd@1.service - Knot Resolver daemon
- Loaded: loaded (/lib/systemd/system/kresd@.service; enabled; vendor preset: enabled)
- Active: active (running) since Sat 2020-12-12 12:24:29 CET; 15min ago
- Docs: man:kresd.systemd(7)
- man:kresd(8)
- Main PID: 1905 (kresd)
- CGroup: /system.slice/system-kresd.slice/kresd@1.service
- └─1905 /usr/sbin/kresd --config=/etc/knot-resolver/kresd.conf
- déc. 12 12:24:28 piras systemd[1]: Starting Knot Resolver daemon...
- déc. 12 12:24:29 piras systemd[1]: Started Knot Resolver daemon.
- pi@piras:~ $
- </code></pre>
- <p>Il est actif (active (running))</p>
- <p>On teste le fonctionnement</p>
- <pre><code>pi@piras:~ $ kdig +short @localhost . NS
- a.root-servers.net.
- b.root-servers.net.
- c.root-servers.net.
- d.root-servers.net.
- e.root-servers.net.
- f.root-servers.net.
- g.root-servers.net.
- h.root-servers.net.
- i.root-servers.net.
- j.root-servers.net.
- k.root-servers.net.
- l.root-servers.net.
- m.root-servers.net.
- pi@piras:~ $
- </code></pre>
- <p>Tout fonctionne :D le résolveur écoute sur les ports 127.0.0.1 et ::1.</p>
- <h2 id="modification-de-etcdhcpcdconf">Modification de /etc/dhcpcd.conf</h2>
- <p>Nous allons pouvoir maintenant modifier la ligne :</p>
- <pre><code>#static domain_name_servers=192.168.1.1
- </code></pre>
- <p>pour obtenir ceci :</p>
- <pre><code>static domain_name_servers=127.0.0.1 ::1
- </code></pre>
- <p>Notre raspi fera appel dorénavant à son propre résolveur DNS (et non à celui de votre box !)</p>
-
- </div>
- </div>
- <footer>
-
- <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
-
- <a href="../Firewall/" class="btn btn-neutral float-right" title="Installation d'un pare-feux">Next <span class="icon icon-circle-arrow-right"></span></a>
-
-
- <a href="../R%C3%A9seau/" class="btn btn-neutral" title="Réseau (des IPs fixes)"><span class="icon icon-circle-arrow-left"></span> Previous</a>
-
- </div>
-
- <hr/>
- <div role="contentinfo">
- <!-- Copyright etc -->
-
- </div>
- Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
- </footer>
-
- </div>
- </div>
- </section>
- </div>
- <div class="rst-versions" role="note" aria-label="versions">
- <span class="rst-current-version" data-toggle="rst-current-version">
-
-
- <span><a href="../R%C3%A9seau/" style="color: #fcfcfc;">« Previous</a></span>
-
-
- <span style="margin-left: 15px"><a href="../Firewall/" style="color: #fcfcfc">Next »</a></span>
-
- </span>
- </div>
- <script>var base_url = '..';</script>
- <script src="../js/theme.js" defer></script>
- <script src="../search/main.js" defer></script>
- <script defer>
- window.onload = function () {
- SphinxRtdTheme.Navigation.enable(true);
- };
- </script>
- </body>
- </html>
|