GNU bug report logs - #54352
[PATCH] services: dnsmasq: Add more options.

Previous Next

Package: guix-patches;

Reported by: Remco van 't Veer <remco <at> remworks.net>

Date: Sat, 12 Mar 2022 15:49:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#54352: closed ([PATCH] services: dnsmasq: Add more options.)
Date: Thu, 24 Mar 2022 11:23:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 24 Mar 2022 12:22:31 +0100
with message-id <87sfr7d288.fsf_-_ <at> gnu.org>
and subject line Re: bug#54352: [PATCH] services: dnsmasq: Add more options.
has caused the debbugs.gnu.org bug report #54352,
regarding [PATCH] services: dnsmasq: Add more options.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
54352: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=54352
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Remco van 't Veer <remco <at> remworks.net>
To: guix-patches <at> gnu.org
Cc: Remco van 't Veer <remco <at> remworks.net>
Subject: [PATCH] services: dnsmasq: Add more options.
Date: Sat, 12 Mar 2022 16:48:13 +0100
* gnu/services/dns.scm (<dnsmasq-configuration>): 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 <go.wigust <at> gmail.com>
 ;;; Copyright © 2020 Pierre Langlois <pierre.langlois <at> gmx.com>
 ;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
+;;; Copyright © 2022 Remco van 't Veer <remco <at> remworks.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -745,6 +746,10 @@ (define-record-type* <dnsmasq-configuration>
                     (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* <dnsmasq-configuration>
   (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
     (($ <dnsmasq-configuration> 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



[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Remco van 't Veer <remco <at> remworks.net>
Cc: 54352-done <at> debbugs.gnu.org
Subject: Re: bug#54352: [PATCH] services: dnsmasq: Add more options.
Date: Thu, 24 Mar 2022 12:22:31 +0100
Hi,

Remco van 't Veer <remco <at> remworks.net> skribis:

> * gnu/services/dns.scm (<dnsmasq-configuration>): Add
> forward-private-reverse-lookup?, strict-order? and cpe-id options.
> (dnsmasq-shepherd-service): Pass added options to dnsmasq and use
> match-record instead of match-lambda.
> * doc/guix.texi (Guix Services): Document options added to dnsmasq.

Applied, thank you!

Ludo’.


This bug report was last modified 3 years and 59 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.