From unknown Sun Jun 22 17:13:06 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#40545 <40545@debbugs.gnu.org> To: bug#40545 <40545@debbugs.gnu.org> Subject: Status: [PATCH] services: dnsmasq: Support the --address flag. Reply-To: bug#40545 <40545@debbugs.gnu.org> Date: Mon, 23 Jun 2025 00:13:06 +0000 retitle 40545 [PATCH] services: dnsmasq: Support the --address flag. reassign 40545 guix-patches submitter 40545 Pierre Langlois severity 40545 normal tag 40545 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 10 13:59:16 2020 Received: (at submit) by debbugs.gnu.org; 10 Apr 2020 17:59:16 +0000 Received: from localhost ([127.0.0.1]:56018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jMxvw-0007CR-4j for submit@debbugs.gnu.org; Fri, 10 Apr 2020 13:59:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:38153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jMxvu-0007CK-Vn for submit@debbugs.gnu.org; Fri, 10 Apr 2020 13:59:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51636) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMxvt-00033P-JP for guix-patches@gnu.org; Fri, 10 Apr 2020 13:59:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,SPOOFED_FREEMAIL,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMxvr-0006U4-E6 for guix-patches@gnu.org; Fri, 10 Apr 2020 13:59:13 -0400 Received: from mout.gmx.net ([212.227.15.18]:55927) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMxvq-0006Rv-My for guix-patches@gnu.org; Fri, 10 Apr 2020 13:59:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1586541548; bh=i2Ve2mw8/nH1R0U4knPmElZqJs+KeMyLuQJpcCrP+T8=; h=X-UI-Sender-Class:From:To:Subject:Date; b=CW0tpHyiN5bceNbBUv0Y2HNXKEXcVtIAH1c56ScyXPnD9z4KmXdfCfsvfKD6xSBRc pRSR+YGV9MiQpAwzWbq6dal0dG+6tRbQvO572U8J1FUNdpAMonc2MT6/iO1BzYJCQ/ z5932MJf3Q2XR3YzO07NTgAiU0vcqtgHbw6FJ2GY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from vino ([92.95.5.39]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MIdeR-1jSgxS42Lt-00Ee0y for ; Fri, 10 Apr 2020 19:59:08 +0200 From: Pierre Langlois To: guix-patches@gnu.org Subject: [PATCH] services: dnsmasq: Support the --address flag. Date: Fri, 10 Apr 2020 18:59:06 +0100 Message-ID: <87wo6np6hh.fsf@gmx.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:YHAGfeWSjXKe6FBwKsUjvKD37NdO1zt9J55OC/4tcwt2t+Ke/S6 74Ad7LQX2nkl/q3+N5NrTAxoj/qwb69un4SI4O+6hY6dqR2DkyJRvzW9C8ea2/J8eD0zB6V OI6PEyCULg9WJAlhFaTRXKjroMqnIeBJCCRvdCd22NIGtPVgebHbnqU+LQyGCTOPOS/fcIr 53V9675YC1r8lW+L72fZw== X-UI-Out-Filterresults: notjunk:1;V03:K0:2mQSepzc+7w=:Lu+KWrC/QOUaYQGOdH5R2u K7w5OYqkdl2m4j8GBO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Mp8s dERMrFA4UfeGYMyGwUe2DUHZaG4NeHyvcgh54n+3w0+oaXIV7enQgLTNqe0vbSTpG3aAddwMa VnTYJn4y30/3jVBKHRpA9WlT15S0hSjB6t/jGkQdzo3HE8rz8FiKskWkdSswzahXEga01BJR0 1hGvGqirh3bOS/L7r X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.18 X-Spam-Score: 2.2 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello Guix! Here's a patch that allows passing the --address flag multiple times to dnsmasq. WDYT? Thanks, Pierre Content analysis details: (2.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gmx.com] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [209.51.188.17 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom; id=pierre.langlois%40gmx.com; ip=209.51.188.17; r=debbugs.gnu.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (pierre.langlois[at]gmx.com) 2.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --=-=-= Content-Type: text/plain Hello Guix! Here's a patch that allows passing the --address flag multiple times to dnsmasq. WDYT? Thanks, Pierre --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-services-dnsmasq-Support-the-address-flag.patch Content-Transfer-Encoding: quoted-printable >From 407265e5d9b0f863a8b14d74f6240ed102f9a907 Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Fri, 10 Apr 2020 17:00:47 +0100 Subject: [PATCH] services: dnsmasq: Support the --address flag. Introduce a new `addresses' field that translates to passing `--address=3D' multiple times to dnsmasq. * gnu/services/dns.scm (): Add an addresses field. (dnsmasq-shepherd-service): Match the addresses field and translate it to multiple '--address=3D' flags. * doc/guix.texi (DNS Services): Document it. --- doc/guix.texi | 20 ++++++++++++++++++++ gnu/services/dns.scm | 7 ++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 891e2693f6..7ca4bd6ef3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -77,6 +77,7 @@ Copyright @copyright{} 2020 Jakub K=C4=85dzio=C5=82ka@* Copyright @copyright{} 2020 Jack Hill@* Copyright @copyright{} 2020 Naga Malleswari@* Copyright @copyright{} 2020 Brice Waegeneire@* +Copyright @copyright{} 2020 Pierre Langlois@* =20 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -21772,6 +21773,25 @@ When true, don't read @var{resolv-file}. @item @code{servers} (default: @code{'()}) Specify IP address of upstream servers directly. =20 +@item @code{addresses} (default: @code{'()}) +For each entry, specify an IP address to return for any host in the +given domains. Queries in the domains are never forwarded and always +replied to with the specified IP address. + +This is useful for redirecting hosts locally, for example: + +@lisp +(service dnsmasq-service-type + (dnsmasq-configuration + (addresses + '(; Redirect to a local web-server. + "/example.org/127.0.0.1" + ; Redirect subdomain to a specific IP. + "/subdomain.example.org/192.168.1.42")))) +@end lisp + +Note that rules in @file{/etc/hosts} take precedence over this. + @item @code{cache-size} (default: @code{150}) Set the size of dnsmasq's cache. Setting the cache size to zero disables caching. diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index a07946d085..478c837d13 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2017 Julien Lepiller ;;; Copyright =C2=A9 2018 Oleg Pykhalov +;;; Copyright =C2=A9 2020 Pierre Langlois ;;; ;;; This file is part of GNU Guix. ;;; @@ -748,6 +749,8 @@ cache.size =3D 100 * MB (default #f)) ;boolean (servers dnsmasq-configuration-servers (default '())) ;list of string + (addresses dnsmasq-configuration-addresses + (default '())) ;list of string (cache-size dnsmasq-configuration-cache-size (default 150)) ;integer (negative-cache? dnsmasq-configuration-negative-cache? @@ -759,7 +762,7 @@ cache.size =3D 100 * MB no-hosts? port local-service? listen-addresses resolv-file no-resolv? servers - cache-size negative-cache?) + addresses cache-size negative-cache?) (shepherd-service (provision '(dnsmasq)) (requirement '(networking)) @@ -783,6 +786,8 @@ cache.size =3D 100 * MB '()) #$@(map (cut format #f "--server=3D~a" <>) servers) + #$@(map (cut format #f "--address=3D~a" <>) + addresses) #$(format #f "--cache-size=3D~a" cache-size) #$@(if negative-cache? '() --=20 2.26.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 22 14:16:55 2020 Received: (at 40545) by debbugs.gnu.org; 22 Apr 2020 18:16:55 +0000 Received: from localhost ([127.0.0.1]:53191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRJvb-00020N-0G for submit@debbugs.gnu.org; Wed, 22 Apr 2020 14:16:55 -0400 Received: from mout.gmx.net ([212.227.17.21]:54331) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRJvZ-000206-14 for 40545@debbugs.gnu.org; Wed, 22 Apr 2020 14:16:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1587579406; bh=R9wbvRSSKIHBkv0yc47AIRFe6uMAR6EWfyHWvDCrR7Y=; h=X-UI-Sender-Class:References:From:To:Subject:In-reply-to:Date; b=IJ2xQxvtg1AbEll3XrJQxPGe1N1PmI5YV7j2BGxitVvuWX+ksjcBMLg0qvAvDR1hX lQ6DbXYBqKmipjBTBVb7aAdEzhu10q3XqSoKcDOhkkntmGOiA+PWGqum1SgB08vdlz 4sW6219qTfucOG1Dlv74OGMiPgjraJ4IdERkDPg4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from e119807-lin ([77.131.60.53]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MCKFu-1jJ6Sq2VBC-009PYo for <40545@debbugs.gnu.org>; Wed, 22 Apr 2020 20:16:46 +0200 References: <87wo6np6hh.fsf@gmx.com> User-agent: mu4e 1.4; emacs 26.3 From: Pierre Langlois To: 40545@debbugs.gnu.org Subject: Re: [bug#40545] [PATCH] services: dnsmasq: Support the --address flag. In-reply-to: <87wo6np6hh.fsf@gmx.com> Date: Wed, 22 Apr 2020 20:16:44 +0200 Message-ID: <87zhb3per7.fsf@gmx.com> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:f62d314dMxXtDWbtypF+ZliCjAIEJl/sfbixGFoNyPYBkZ3UNRY tGgOBaCrzMawibudDO10uO/EFtvVQOkDF9MF6jpR5VofTzT2CTQ/ULSGo/RrctOp71akzXY 7q3HeYp0F1lXR+8ewU/wBsSrdRzow2BIeI/qqaowUEOB8uQ73b3lsZTWaq+NK6YAKRRCQpR IH2yyksPPxx/Wh5JAzp1w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:9FKod8iM1ns=:xkQabX9gdbV5D4kABrvLbq GP7z8DiDiNvdBY5PJ2f7HKW5S8ekHrOdUaYTLu4PWq9A8+pREA+4A8riO+inqr5uUQJC6KIGI 5jIw3IYYAXoCqxGQFVoMxyXNSIi2FsM30tOWd7pQ3oLICAKASDPA+kvgD7Q2q1y+m/r7gwUaG Hmnu/cgB1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UDoMjTe3KalqmBwrM6xrqrIKF8eaF sVk2k0NdxNCMLZb5N X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 40545 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi all, Pierre Langlois writes: > Hello Guix! > > Here's a patch that allows passing the --address flag multiple times to > dnsmasq. WDYT? Any comment on this patch? Let me know if I should attempt at adding some service tests for dnsmasq, that might be useful. Thanks, Pierre From debbugs-submit-bounces@debbugs.gnu.org Sat May 02 01:05:18 2020 Received: (at 40545-done) by debbugs.gnu.org; 2 May 2020 05:05:18 +0000 Received: from localhost ([127.0.0.1]:51095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUkL0-0004f0-Jd for submit@debbugs.gnu.org; Sat, 02 May 2020 01:05:18 -0400 Received: from rezeros.cc ([45.76.207.221]:43936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUkKy-0004em-Nt for 40545-done@debbugs.gnu.org; Sat, 02 May 2020 01:05:17 -0400 Received: from localhost ( [117.173.226.225]) by rezeros.cc (OpenSMTPD) with ESMTPSA id 7b68f74b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 2 May 2020 05:05:07 +0000 (UTC) Received: from gift (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id c8e699ce; Sat, 2 May 2020 05:04:26 +0000 (UTC) From: iyzsong@member.fsf.org (=?utf-8?B?5a6L5paH5q2m?=) To: Pierre Langlois Subject: Re: [bug#40545] [PATCH] services: dnsmasq: Support the --address flag. References: <87wo6np6hh.fsf@gmx.com> <87zhb3per7.fsf@gmx.com> Date: Sat, 02 May 2020 13:04:26 +0800 In-Reply-To: <87zhb3per7.fsf@gmx.com> (Pierre Langlois's message of "Wed, 22 Apr 2020 20:16:44 +0200") Message-ID: <87bln76i79.fsf@member.fsf.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40545-done Cc: 40545-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Pierre Langlois writes: > Hi all, > > Pierre Langlois writes: > >> Hello Guix! >> >> Here's a patch that allows passing the --address flag multiple times to >> dnsmasq. WDYT? Hello Pierre, this patch looks good to me, and I pushed it to master now, thank you! > > Any comment on this patch? Let me know if I should attempt at adding > some service tests for dnsmasq, that might be useful. Yes, I think adding a system test for dnsmasq is welcomed too :-) From unknown Sun Jun 22 17:13:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 30 May 2020 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator