summaryrefslogtreecommitdiff
path: root/gnu/services/dns.scm
diff options
context:
space:
mode:
authorSergey Trofimov <sarg@sarg.org.ru>2023-03-10 16:00:56 +0100
committerAndrew Tropin <andrew@trop.in>2023-03-13 17:06:19 +0400
commitd1edb26388ca4dab4b435a686cd059d97c113c3e (patch)
treedaa34ac3f90766fb6a972090e6c90b74161fdfed /gnu/services/dns.scm
parent377c8143e7cd5e3bf3e1e8d53ba443f91c88239c (diff)
services: dns: Extend dnsmasq-configuration.
* gnu/service/dns.scm: (<dnsmasq-configuration>)[servers-file]: Add. (<dnsmasq-configuration>)[tftp-secure?]: Fix typo in parameter name. * doc/guix.texi: Document (<dnsmasq-configuration>)[servers-file]. Signed-off-by: Andrew Tropin <andrew@trop.in>
Diffstat (limited to 'gnu/services/dns.scm')
-rw-r--r--gnu/services/dns.scm124
1 files changed, 65 insertions, 59 deletions
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
index 32fb8c0664..837e3fe6f7 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -754,6 +754,8 @@ cache.size = 100 * MB
(default #f)) ;boolean
(servers dnsmasq-configuration-servers
(default '())) ;list of string
+ (servers-file dnsmasq-configuration-servers-file
+ (default #f)) ;string|file-like
(addresses dnsmasq-configuration-addresses
(default '())) ;list of string
(cache-size dnsmasq-configuration-cache-size
@@ -792,7 +794,7 @@ cache.size = 100 * MB
port local-service? listen-addresses
resolv-file no-resolv?
forward-private-reverse-lookup? query-servers-in-order?
- servers addresses
+ servers addresses servers-file
cache-size negative-cache?
cpe-id
tftp-enable? tftp-no-fail?
@@ -805,76 +807,80 @@ cache.size = 100 * MB
(requirement '(networking))
(documentation "Run the dnsmasq DNS server.")
(start #~(make-forkexec-constructor
- '(#$(file-append package "/sbin/dnsmasq")
- "--keep-in-foreground"
- "--pid-file=/run/dnsmasq.pid"
- #$@(if no-hosts?
- '("--no-hosts")
+ (list
+ #$(file-append package "/sbin/dnsmasq")
+ "--keep-in-foreground"
+ "--pid-file=/run/dnsmasq.pid"
+ #$@(if no-hosts?
+ '("--no-hosts")
'())
- #$(format #f "--port=~a" port)
- #$@(if local-service?
- '("--local-service")
+ #$(format #f "--port=~a" port)
+ #$@(if local-service?
+ '("--local-service")
'())
- #$@(map (cut format #f "--listen-address=~a" <>)
- listen-addresses)
- #$(format #f "--resolv-file=~a" resolv-file)
- #$@(if no-resolv?
- '("--no-resolv")
+ #$@(map (cut format #f "--listen-address=~a" <>)
+ listen-addresses)
+ #$(format #f "--resolv-file=~a" resolv-file)
+ #$@(if no-resolv?
+ '("--no-resolv")
'())
- #$@(if forward-private-reverse-lookup?
- '()
+ #$@(if forward-private-reverse-lookup?
+ '()
'("--bogus-priv"))
- #$@(if query-servers-in-order?
- '("--strict-order")
+ #$@(if query-servers-in-order?
+ '("--strict-order")
'())
- #$@(map (cut format #f "--server=~a" <>)
- servers)
- #$@(map (cut format #f "--address=~a" <>)
- addresses)
- #$(format #f "--cache-size=~a" cache-size)
- #$@(if negative-cache?
- '()
+ #$@(if servers-file
+ (list #~(string-append "--servers-file=" #$servers-file))
+ '())
+ #$@(map (cut format #f "--server=~a" <>)
+ servers)
+ #$@(map (cut format #f "--address=~a" <>)
+ addresses)
+ #$(format #f "--cache-size=~a" cache-size)
+ #$@(if negative-cache?
+ '()
'("--no-negcache"))
- #$@(if cpe-id
- (list (format #f "--add-cpe-id=~a" cpe-id))
+ #$@(if cpe-id
+ (list (format #f "--add-cpe-id=~a" cpe-id))
+ '())
+ #$@(if tftp-enable?
+ '("--enable-tftp")
'())
- #$@(if tftp-enable?
- '("--enable-tftp")
+ #$@(if tftp-no-fail?
+ '("--tftp-no-fail")
'())
- #$@(if tftp-no-fail?
- '("--tftp-no-fail")
+ #$@(if tftp-single-port?
+ '("--tftp-single-port")
'())
- #$@(if tftp-single-port?
- '("--tftp-single-port")
+ #$@(if tftp-secure?
+ '("--tftp-secure")
'())
- #$@(if tftp-secure?
- '("--tftp-secure?")
+ #$@(if tftp-max
+ (list (format #f "--tftp-max=~a" tftp-max))
+ '())
+ #$@(if tftp-mtu
+ (list (format #f "--tftp-mtu=~a" tftp-mtu))
+ '())
+ #$@(if tftp-no-blocksize?
+ '("--tftp-no-blocksize")
'())
- #$@(if tftp-max
- (list (format #f "--tftp-max=~a" tftp-max))
+ #$@(if tftp-lowercase?
+ '("--tftp-lowercase")
'())
- #$@(if tftp-mtu
- (list (format #f "--tftp-mtu=~a" tftp-mtu))
- '())
- #$@(if tftp-no-blocksize?
- '("--tftp-no-blocksize")
- '())
- #$@(if tftp-lowercase?
- '("--tftp-lowercase")
- '())
- #$@(if tftp-port-range
- (list (format #f "--tftp-port-range=~a"
- tftp-port-range))
- '())
- #$@(if tftp-root
- (list (format #f "--tftp-root=~a" tftp-root))
- '())
- #$@(if tftp-unique-root
- (list
- (if (> (length tftp-unique-root) 0)
- (format #f "--tftp-unique-root=~a" tftp-unique-root)
- (format #f "--tftp-unique-root")))
- '()))
+ #$@(if tftp-port-range
+ (list (format #f "--tftp-port-range=~a"
+ tftp-port-range))
+ '())
+ #$@(if tftp-root
+ (list (format #f "--tftp-root=~a" tftp-root))
+ '())
+ #$@(if tftp-unique-root
+ (list
+ (if (> (length tftp-unique-root) 0)
+ (format #f "--tftp-unique-root=~a" tftp-unique-root)
+ (format #f "--tftp-unique-root")))
+ '()))
#:pid-file "/run/dnsmasq.pid"))
(stop #~(make-kill-destructor)))))