From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qNevJfjALGLz4AAAgWs5BA (envelope-from ) for ; Sat, 12 Mar 2022 16:49:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id KERnIvjALGI+FQEAauVa8A (envelope-from ) for ; Sat, 12 Mar 2022 16:49:12 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6CAE4CFEB for ; Sat, 12 Mar 2022 16:49:11 +0100 (CET) Received: from localhost ([::1]:36474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nT3zS-0006NV-0p for larch@yhetil.org; Sat, 12 Mar 2022 10:49:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nT3zK-0006NN-Er for guix-patches@gnu.org; Sat, 12 Mar 2022 10:49:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nT3zK-0005BJ-6O for guix-patches@gnu.org; Sat, 12 Mar 2022 10:49:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nT3zK-00059e-0u for guix-patches@gnu.org; Sat, 12 Mar 2022 10:49:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54352] [PATCH] services: dnsmasq: Add more options. Resent-From: Remco van 't Veer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 12 Mar 2022 15:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54352 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54352@debbugs.gnu.org Cc: Remco van 't Veer X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164710011619777 (code B ref -1); Sat, 12 Mar 2022 15:49:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Mar 2022 15:48:36 +0000 Received: from localhost ([127.0.0.1]:40652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nT3yu-00058v-E1 for submit@debbugs.gnu.org; Sat, 12 Mar 2022 10:48:36 -0500 Received: from lists.gnu.org ([209.51.188.17]:55168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nT3ys-00058m-JQ for submit@debbugs.gnu.org; Sat, 12 Mar 2022 10:48:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nT3yr-0006N1-VG for guix-patches@gnu.org; Sat, 12 Mar 2022 10:48:34 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:43471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nT3yp-0004fS-DA for guix-patches@gnu.org; Sat, 12 Mar 2022 10:48:33 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 7DE6C3201DA2; Sat, 12 Mar 2022 10:48:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 12 Mar 2022 10:48:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=remworks.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm3; bh=/kXRW2Ioyy9eGbDbj+EfDDqJYqv+cmlIms5C+q M5SLE=; b=l5/UZ5PKMp/qH6s3D/5Drbz3J2wcNcT6+mD/DHhw36MeW4nLNfFFPe iod7DDDtUHqQvYFr3wX9URHYH+B/qGIO0U0R4botoVQNPNdLqNnIYH6oA5j5/UUb GgiWnauoEGcr19MaYGXmJdcPor7DsYxmD0a34XQthULCx8aa6fPNwl88EYYs7EF5 zfhup8M6QQK8KLEHMqqN+Tq9lVrBAw8fo2KAAn+9rCHESNihFDCPzhIxJsJLdaot Qejxjz9+9+QFBCi26A9lSKF/yOcaZRHxoRCQfjsJPm08zYnpfxHwLAWuVL30bIbm egRkhpo81DAaJxof6Ugwui3yIxSFU6qw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=/kXRW2 Ioyy9eGbDbj+EfDDqJYqv+cmlIms5C+qM5SLE=; b=Wc6YgvhSe39j+OXRtIM7IF BXt/XW+BJ6y6pWHAW+Xiqi4WvQtSoR/PdHXhRvAjVgC0LutwnuG2BbCvQ5z+MIQj 8N0msLUz+LnnvDY09UT09gJHY7QsNeTbdY45yvG9Is2PVGcyCVqZBOUhL9x0DKg9 9DHJCVIIfr0FBH2QyDp1SIqB4roVW3CojiIGt+UjqsDnktq0AOSLF5MGHHoVbZDr pNVVYH3XIhXQBzO7BQsgjIGJxJSUGR8Iwe3m5hAC6waxUGcMx8hZJmu25DuigXgo AeFz8X7brhXN//CMhjYlswfNfsQF/hI4HeAuop/O2j5TvDfX4lY53mzmyZejABGw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddvgedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpeftvghmtghouchvrghnucdkthcugggvvghruceorhgvmhgtohes rhgvmhifohhrkhhsrdhnvghtqeenucggtffrrghtthgvrhhnpeevfedugfefueelveeltd dtteehjefhvedvuefgueektdfhudefteekuedtgefhieenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrfihvsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 12 Mar 2022 10:48:27 -0500 (EST) From: Remco van 't Veer Date: Sat, 12 Mar 2022 16:48:13 +0100 Message-Id: <20220312154813.5538-1-remco@remworks.net> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=64.147.123.19; envelope-from=rwv@fastmail.com; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647100152; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=/kXRW2Ioyy9eGbDbj+EfDDqJYqv+cmlIms5C+qM5SLE=; b=ko4h7JD/dEw4wXiIrTJdA400QOgSOAa/wxVl4XyR6QJBUekkil1QOTLn989jBl2/j05+I5 +1cU1DSJbnLGbdA7DLb7pXkT2HobN8gcJcjTUDA1EPKUsaeCiMi0wTXw0TR0cXCd5mbK52 D1GF8nlUp+bNiAPASnfgMVyK8QtDaPVIecuFoDXkAHUw8wCpEhHEWLOEkFvBgmtdpRye24 hrzzXJR4VxtagJXupgFrnZ53mrMTUWFZR3u4jAA378f/vSRQBwpF9P4xVY6i3FR/U/ggzF 3Qifd49lhSIQ0/XvwHgp9gi1QVVztqACj+m8sRfvdgdv/l9p5cF1CvkLBeQMKg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647100152; a=rsa-sha256; cv=none; b=HHKmQC51hPNEJ6MDDu7uYIE/elCyhwkJ5IliY14yX71jo7z4q9iOkt+Bht59Fu5+1y+q0p MqRJzya7LTi0vyQqHUnzWEHTfbOYytInAgyPe1Cnp4mmEpCI1pjxXvj1GJEBYdJWL2jTNW CtiRvbkpU82Zr3sNocLLjruZsxBlJStxAp3xB6lfc5s6XB6j9gIy9R++EAeE1UB9mv2Bz/ G1WDRqILgIE0sBnxFDs4ulkYndspHyDgGrkoF0GDVSRfi3fChZp1rY+L4DbbjVIeisSe/g 9Wpi4/n7YKsH1hn5eTcW5GJhXVQNb4QumFBCxK8tyxctCRJEFfn+pn0pcwgk2w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=remworks.net header.s=fm3 header.b="l5/UZ5PK"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=Wc6YgvhS; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 0.51 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=remworks.net header.s=fm3 header.b="l5/UZ5PK"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=Wc6YgvhS; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 6CAE4CFEB X-Spam-Score: 0.51 X-Migadu-Scanner: scn0.migadu.com X-TUID: Kc0l8nXtD8Hv * gnu/services/dns.scm (): Add bogus-priv?, strict-order? and add-cpe-id options. (dnsmasq-shepherd-service): Pass bogus-priv, strict-order and add-cpe-id to the service. * doc/guix.texi (Guix Services): Document options added to dnsmasq. --- doc/guix.texi | 12 ++++++++++++ gnu/services/dns.scm | 20 +++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 4b71fb7010..136c199e58 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -28945,6 +28945,14 @@ The file to read the IP address of the upstream nameservers from. @item @code{no-resolv?} (default: @code{#f}) When true, don't read @var{resolv-file}. +@item @code{bogus-priv?} (default: @code{#f}) +When true, all reverse lookups for private IP ranges are answered with +"no such domain" rather than being forwarded upstream. + +@item @code{strict-order?} (default: @code{#f}) +When true, forces dnsmasq to try each query with each server strictly in +the order they appear in @var{servers}. + @item @code{servers} (default: @code{'()}) Specify IP address of upstream servers directly. @@ -28974,6 +28982,10 @@ disables caching. @item @code{negative-cache?} (default: @code{#t}) When false, disable negative caching. +@item @code{add-cpe-id} (default: @code{#f}) +If set, add an arbitrary identifying string to DNS queries which are +forwarded upstream. + @item @code{tftp-enable?} (default: @code{#f}) Whether to enable the built-in TFTP server. diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 9b8603cc95..9f9b6c1a69 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018 Oleg Pykhalov ;;; Copyright © 2020 Pierre Langlois ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2022 Remco van 't Veer ;;; ;;; This file is part of GNU Guix. ;;; @@ -745,6 +746,10 @@ (define-record-type* (default "/etc/resolv.conf")) ;string (no-resolv? dnsmasq-configuration-no-resolv? (default #f)) ;boolean + (bogus-priv? dnsmasq-configuration-bogus-priv? + (default #f)) ;boolean + (strict-order? dnsmasq-configuration-strict-order? + (default #f)) ;boolean (servers dnsmasq-configuration-servers (default '())) ;list of string (addresses dnsmasq-configuration-addresses @@ -752,7 +757,9 @@ (define-record-type* (cache-size dnsmasq-configuration-cache-size (default 150)) ;integer (negative-cache? dnsmasq-configuration-negative-cache? - (default #t)) ;boolean + (default #t)) ;boolean + (add-cpe-id dnsmasq-configuration-add-cpe-id + (default #t)) ;string (tftp-enable? dnsmasq-configuration-tftp-enable? (default #f)) ;boolean (tftp-no-fail? dnsmasq-configuration-tftp-no-fail? @@ -781,8 +788,9 @@ (define dnsmasq-shepherd-service (($ package no-hosts? port local-service? listen-addresses - resolv-file no-resolv? servers - addresses cache-size negative-cache? + resolv-file no-resolv? bogus-priv? + strict-order? servers addresses cache-size + negative-cache? add-cpe-id tftp-enable? tftp-no-fail? tftp-single-port? tftp-secure? tftp-max tftp-mtu tftp-no-blocksize? @@ -809,6 +817,9 @@ (define dnsmasq-shepherd-service #$@(if no-resolv? '("--no-resolv") '()) + #$@(if bogus-priv? + '("--bogus-priv") + '()) #$@(map (cut format #f "--server=~a" <>) servers) #$@(map (cut format #f "--address=~a" <>) @@ -817,6 +828,9 @@ (define dnsmasq-shepherd-service #$@(if negative-cache? '() '("--no-negcache")) + #$@(if add-cpe-id + (list (format #f "--add-cpe-id=~a" add-cpe-id)) + '()) #$@(if tftp-enable? '("--enable-tftp") '()) -- 2.34.0