all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#61869] gnu: services: Add more dnsmasq options.
@ 2023-02-28 13:36 Wicki Gabriel (wicg)
  2023-03-08 14:56 ` [bug#61869] Updated patch Wicki Gabriel (wicg)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wicki Gabriel (wicg) @ 2023-02-28 13:36 UTC (permalink / raw)
  To: 61869


[-- Attachment #1.1: Type: text/plain, Size: 125 bytes --]

Hi y'all

I've created a patch which adds more options to the dnsmasq service.  Thanks in advance for merging,

g




[-- Attachment #1.2: Type: text/html, Size: 1761 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-services-Add-more-dnsmasq-options.patch --]
[-- Type: text/x-patch; name="0001-gnu-services-Add-more-dnsmasq-options.patch", Size: 6735 bytes --]

From bb85650b9bac7afb4a21d483d2bb6249857a02c0 Mon Sep 17 00:00:00 2001
From: gabriel <gabriel@erlikon.ch>
Date: Thu, 23 Feb 2023 16:46:29 +0100
Subject: [PATCH] gnu: services: Add more dnsmasq options.

* gnu/services/dns.scm (dnsmasq-configuration, dnsmasq-shepherd-service): Add
options domain-needed?, bogus-priv?, filterwin2k?, poll?, local, interface,
bind-dynamic?, expand-hosts?, domain, dhcp-range and dhcp-option, as they are
documented in dnsmasq's manual.
* doc/guix.texi (dnsmasq-configuration): Document them.
---
 doc/guix.texi        | 38 +++++++++++++++++++++++++++
 gnu/services/dns.scm | 62 ++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 98 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 05615b9549..bab2f5491e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -31317,6 +31317,44 @@ When false, disable negative caching.
 If set, add a CPE (Customer-Premises Equipment) identifier to DNS
 queries which are forwarded upstream.
 
+@item @code{domain-needed?} (default: @code{#f})
+Whether to forward queries with no domain part.
+
+@item @code{bogus-priv?} (default: @code{#f})
+Whether to fake reverse lookups for RFC1918 private address ranges.
+
+@item @code{filterwin2k?} (default: @code{#f})
+Whether to forward spurious DNS requests from Windows hosts.
+
+@item @code{poll?} (default: @code{#f})
+Continuously reads @file{/etc/resolv.conf} when @code{#true}, otherwise only
+does so on SIGHUP.
+
+@item @code{local} (default: @code{#f})
+A string representing domains where nothing will be forwarded to
+@code{"/domain/"}).
+
+@item @code{interface} (default: @code{#f})
+The interface(s) dnsmasq works on (like @code{"wlp3"} or @code{"lan0"}.
+Multiple names can be specified as strings separated by commas.
+
+@item @code{bind-dynamic?} (default: @code{#f})
+Bind to interfaces in use - check for new interfaces.
+
+@item @code{expand-hosts?} (default: @code{#f})
+Expand simple names in @file{/etc/hosts} with domain-suffix.
+
+@item @code{domain} (default: @code{#f})
+Specify the domain to be assigned in DHCP leases.
+
+@item @code{dhcp-range} (default: @code{#f})
+Enable DHCP in the range given with lease duration, the format is
+@code{<START-IP>,<END-IP>,<MASK>,<LEASE-TIME>}, e.g.
+@code{10.42.0.50,10.42.0.150,255.255.255.0,1h}.
+
+@item @code{dhcp-options} (default: @code{'()})
+A list of options to be passed along.
+
 @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 50753b7ab6..48fee15192 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -749,8 +749,7 @@ (define-record-type* <dnsmasq-configuration>
   (forward-private-reverse-lookup?
                     dnsmasq-configuration-forward-private-reverse-lookup?
                     (default #t))       ;boolean
-  (query-servers-in-order?
-                    dnsmasq-configuration-query-servers-in-order?
+  (query-servers-in-order? dnsmasq-configuration-query-servers-in-order?
                     (default #f))       ;boolean
   (servers          dnsmasq-configuration-servers
                     (default '()))      ;list of string
@@ -762,6 +761,28 @@ (define-record-type* <dnsmasq-configuration>
                     (default #t))       ;boolean
   (cpe-id           dnsmasq-configuration-cpe-id
                     (default #t))       ;string
+  (domain-needed?   dnsmasq-configuration-domain-needed?
+                    (default #f))       ;boolean
+  (bogus-priv?      dnsmasq-configuration-bogus-priv?
+                    (default #f))       ;boolean
+  (filterwin2k?     dnsmasq-configuration-filterwin2k?
+                    (default #f))       ;boolean
+  (poll?            dnsmasq-configuration-poll?
+                    (default #t))       ;boolean
+  (local            dnsmasq-configuration-local
+                    (default #f))       ;string
+  (interface        dnsmasq-configuration-interface
+                    (default #f))       ;string
+  (bind-dynamic?    dnsmasq-configuration-bind-dynamic?
+                    (default #f))       ;boolean
+  (expand-hosts?    dnsmasq-configuration-expand-hosts?
+                    (default #f))       ;boolean
+  (domain           dnsmasq-configuration-domain
+                    (default #f))       ;string
+  (dhcp-range       dnsmasq-configuration-dhcp-range
+                    (default #f))       ;string
+  (dhcp-options      dnsmasq-configuration-dhcp-options
+                    (default '()))      ;list of string
   (tftp-enable?     dnsmasq-configuration-tftp-enable?
                     (default #f))       ;boolean
   (tftp-no-fail?    dnsmasq-configuration-tftp-no-fail?
@@ -795,6 +816,11 @@ (define (dnsmasq-shepherd-service config)
      servers addresses
      cache-size negative-cache?
      cpe-id
+     domain-needed? bogus-priv? filterwin2k? poll?
+     local interface
+     bind-dynamic? expand-hosts?
+     domain
+     dhcp-range dhcp-options
      tftp-enable? tftp-no-fail?
      tftp-single-port? tftp-secure?
      tftp-max tftp-mtu tftp-no-blocksize?
@@ -838,6 +864,38 @@ (define (dnsmasq-shepherd-service config)
                  #$@(if cpe-id
                         (list (format #f "--add-cpe-id=~a" cpe-id))
                         '())
+                 #$@(if domain-needed?
+                        '("--domain-needed")
+                        '())
+                 #$@(if bogus-priv?
+                        '("--bogus-priv")
+                        '())
+                 #$@(if filterwin2k?
+                        '("--filterwin2k")
+                        '())
+                 #$@(if poll?
+                        '()
+                        '("--no-poll"))
+                 #$@(if local
+                        (list (format #f "--local=~a" local))
+                        '())
+                 #$@(if interface
+                        (list (format #f "--interface=~a" interface))
+                        '())
+                 #$@(if bind-dynamic?
+                        '("--bind-dynamic")
+                        '())
+                 #$@(if expand-hosts?
+                        '("--expand-hosts")
+                        '())
+                 #$@(if domain
+                        (list (format #f "--domain=~a" domain))
+                        '())
+                 #$@(if dhcp-range
+                        (list (format #f "--dhcp-range=~a" dhcp-range))
+                        '())
+                 #$@(map (cut format #f "--dhcp-option=~a" <>)
+                      dhcp-options)
                  #$@(if tftp-enable?
                         '("--enable-tftp")
                         '())
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-21 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 13:36 [bug#61869] gnu: services: Add more dnsmasq options Wicki Gabriel (wicg)
2023-03-08 14:56 ` [bug#61869] Updated patch Wicki Gabriel (wicg)
2023-08-15 15:20 ` [bug#61869] gnu: services: Add more dnsmasq options Tobias Geerinckx-Rice via Guix-patches via
2023-08-21 15:12 ` [bug#61869] Review of the third patch Wicki Gabriel (wicg)

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.