index.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <link rel="shortcut icon" href="../img/favicon.ico">
  9. <title>Installation de Knot-resolver - Les Tutoriels du Yojik</title>
  10. <link rel="stylesheet" href="../css/theme.css" />
  11. <link rel="stylesheet" href="../css/theme_extra.css" />
  12. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css" />
  13. <script>
  14. // Current page data
  15. var mkdocs_page_name = "Installation de Knot-resolver";
  16. var mkdocs_page_input_path = "Knot.md";
  17. var mkdocs_page_url = null;
  18. </script>
  19. <script src="../js/jquery-2.1.1.min.js" defer></script>
  20. <script src="../js/modernizr-2.8.3.min.js" defer></script>
  21. <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
  22. <script>hljs.initHighlightingOnLoad();</script>
  23. </head>
  24. <body class="wy-body-for-nav" role="document">
  25. <div class="wy-grid-for-nav">
  26. <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
  27. <div class="wy-side-scroll">
  28. <div class="wy-side-nav-search">
  29. <a href=".." class="icon icon-home"> Les Tutoriels du Yojik</a>
  30. <div role="search">
  31. <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
  32. <input type="text" name="q" placeholder="Search docs" title="Type search term here" />
  33. </form>
  34. </div>
  35. </div>
  36. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  37. <p class="caption"><span class="caption-text">Installation d'un serveur sécurisé, version Debian/Buster sur RaspberryPI</span></p>
  38. <ul class="current">
  39. <li class="toctree-l1"><a class="reference internal" href="..">Résumé</a>
  40. </li>
  41. <li class="toctree-l1"><a class="reference internal" href="../tutoraspi/">Présentation</a>
  42. </li>
  43. <li class="toctree-l1"><a class="reference internal" href="../Installation-de-base/">Installation de base</a>
  44. </li>
  45. <li class="toctree-l1"><a class="reference internal" href="../Premier-d%C3%A9marrage/">Premier démarrage</a>
  46. </li>
  47. <li class="toctree-l1"><a class="reference internal" href="../Etat-des-lieux/">État des lieux</a>
  48. </li>
  49. <li class="toctree-l1"><a class="reference internal" href="../S%C3%A9curisation-SSH/">Sécurisation SSH</a>
  50. </li>
  51. <li class="toctree-l1"><a class="reference internal" href="../R%C3%A9seau/">Réseau (des IPs fixes)</a>
  52. </li>
  53. <li class="toctree-l1 current"><a class="reference internal current" href="./">Installation de Knot-resolver</a>
  54. <ul class="current">
  55. <li class="toctree-l2"><a class="reference internal" href="#installation">Installation</a>
  56. </li>
  57. <li class="toctree-l2"><a class="reference internal" href="#configuration">Configuration</a>
  58. </li>
  59. <li class="toctree-l2"><a class="reference internal" href="#lancement-et-mise-en-service-automatique">Lancement et mise en service automatique</a>
  60. </li>
  61. <li class="toctree-l2"><a class="reference internal" href="#modification-de-etcdhcpcdconf">Modification de /etc/dhcpcd.conf</a>
  62. </li>
  63. </ul>
  64. </li>
  65. <li class="toctree-l1"><a class="reference internal" href="../Firewall/">Installation d'un pare-feux</a>
  66. </li>
  67. <li class="toctree-l1"><a class="reference internal" href="../Fail2ban/">Contrer les attaques de force brute</a>
  68. </li>
  69. <li class="toctree-l1"><a class="reference internal" href="../Logwatch/">Surveillance du serveur</a>
  70. </li>
  71. <li class="toctree-l1"><a class="reference internal" href="../Installation-courrier-basique/">Installation d'un serveur de courriers basique</a>
  72. </li>
  73. <li class="toctree-l1"><a class="reference internal" href="../Exemple-d-utilisation-serveur-Web/">Exemple d'utilisation avec un serveur Web</a>
  74. </li>
  75. <li class="toctree-l1"><a class="reference internal" href="../Annexe/">Annexe</a>
  76. </li>
  77. </ul>
  78. </div>
  79. </div>
  80. </nav>
  81. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  82. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  83. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  84. <a href="..">Les Tutoriels du Yojik</a>
  85. </nav>
  86. <div class="wy-nav-content">
  87. <div class="rst-content">
  88. <div role="navigation" aria-label="breadcrumbs navigation">
  89. <ul class="wy-breadcrumbs">
  90. <li><a href="..">Docs</a> &raquo;</li>
  91. <li>Installation d'un serveur sécurisé, version Debian/Buster sur RaspberryPI &raquo;</li>
  92. <li>Installation de Knot-resolver</li>
  93. <li class="wy-breadcrumbs-aside">
  94. </li>
  95. </ul>
  96. <hr/>
  97. </div>
  98. <div role="main">
  99. <div class="section">
  100. <h1 id="installation-de-knot-resolver">Installation de knot-resolver</h1>
  101. <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>
  102. <h2 id="installation">Installation</h2>
  103. <p>Installation du resolver et des programmes utilitaires</p>
  104. <pre><code>pi@piras:~ $ sudo apt install knot-resolver knot-dnsutils
  105. </code></pre>
  106. <h2 id="configuration">Configuration</h2>
  107. <p>Voilà le contenu de mon fichier de configuration /etc/knot-resolver/kresd.conf :</p>
  108. <pre><code>pi@piras:~ $ cat /etc/knot-resolver/kresd.conf
  109. -- Default empty Knot DNS Resolver configuration in -*- lua -*-
  110. -- Bind ports as privileged user (root) --
  111. net = { '127.0.0.1', '::1' }
  112. -- Switch to unprivileged user --
  113. user('knot-resolver','knot-resolver')
  114. -- Unprivileged
  115. -- cache.size = 100*MB
  116. pi@piras:~ $
  117. </code></pre>
  118. <p>J'ai dé-commenté les interfaces d'écoute.</p>
  119. <h2 id="lancement-et-mise-en-service-automatique">Lancement et mise en service automatique</h2>
  120. <p>On démarre le service</p>
  121. <pre><code>sudo systemctl start kresd@1.service
  122. </code></pre>
  123. <p>On rend le démarrage automatique</p>
  124. <pre><code>sudo systemctl enable --now kresd@1.service
  125. </code></pre>
  126. <p>On vérifie que le service est en route</p>
  127. <pre><code>sudo systemctl status kresd@1.service
  128. pi@piras:~ $ sudo systemctl status kresd@1.service
  129. ● kresd@1.service - Knot Resolver daemon
  130. Loaded: loaded (/lib/systemd/system/kresd@.service; enabled; vendor preset: enabled)
  131. Active: active (running) since Sat 2020-12-12 12:24:29 CET; 15min ago
  132. Docs: man:kresd.systemd(7)
  133. man:kresd(8)
  134. Main PID: 1905 (kresd)
  135. CGroup: /system.slice/system-kresd.slice/kresd@1.service
  136. └─1905 /usr/sbin/kresd --config=/etc/knot-resolver/kresd.conf
  137. déc. 12 12:24:28 piras systemd[1]: Starting Knot Resolver daemon...
  138. déc. 12 12:24:29 piras systemd[1]: Started Knot Resolver daemon.
  139. pi@piras:~ $
  140. </code></pre>
  141. <p>Il est actif (active (running))</p>
  142. <p>On teste le fonctionnement</p>
  143. <pre><code>pi@piras:~ $ kdig +short @localhost . NS
  144. a.root-servers.net.
  145. b.root-servers.net.
  146. c.root-servers.net.
  147. d.root-servers.net.
  148. e.root-servers.net.
  149. f.root-servers.net.
  150. g.root-servers.net.
  151. h.root-servers.net.
  152. i.root-servers.net.
  153. j.root-servers.net.
  154. k.root-servers.net.
  155. l.root-servers.net.
  156. m.root-servers.net.
  157. pi@piras:~ $
  158. </code></pre>
  159. <p>Tout fonctionne :D le résolveur écoute sur les ports 127.0.0.1 et ::1.</p>
  160. <h2 id="modification-de-etcdhcpcdconf">Modification de /etc/dhcpcd.conf</h2>
  161. <p>Nous allons pouvoir maintenant modifier la ligne :</p>
  162. <pre><code>#static domain_name_servers=192.168.1.1
  163. </code></pre>
  164. <p>pour obtenir ceci :</p>
  165. <pre><code>static domain_name_servers=127.0.0.1 ::1
  166. </code></pre>
  167. <p>Notre raspi fera appel dorénavant à son propre résolveur DNS (et non à celui de votre box !)</p>
  168. </div>
  169. </div>
  170. <footer>
  171. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  172. <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>
  173. <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>
  174. </div>
  175. <hr/>
  176. <div role="contentinfo">
  177. <!-- Copyright etc -->
  178. </div>
  179. 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>.
  180. </footer>
  181. </div>
  182. </div>
  183. </section>
  184. </div>
  185. <div class="rst-versions" role="note" aria-label="versions">
  186. <span class="rst-current-version" data-toggle="rst-current-version">
  187. <span><a href="../R%C3%A9seau/" style="color: #fcfcfc;">&laquo; Previous</a></span>
  188. <span style="margin-left: 15px"><a href="../Firewall/" style="color: #fcfcfc">Next &raquo;</a></span>
  189. </span>
  190. </div>
  191. <script>var base_url = '..';</script>
  192. <script src="../js/theme.js" defer></script>
  193. <script src="../search/main.js" defer></script>
  194. <script defer>
  195. window.onload = function () {
  196. SphinxRtdTheme.Navigation.enable(true);
  197. };
  198. </script>
  199. </body>
  200. </html>