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>
This commit is contained in:
parent
377c8143e7
commit
d1edb26388
2 changed files with 69 additions and 59 deletions
|
@ -31528,6 +31528,10 @@ in @var{servers}.
|
||||||
@item @code{servers} (default: @code{'()})
|
@item @code{servers} (default: @code{'()})
|
||||||
Specify IP address of upstream servers directly.
|
Specify IP address of upstream servers directly.
|
||||||
|
|
||||||
|
@item @code{servers-file} (default: @code{#f})
|
||||||
|
Specify file containing upstream servers. This file is re-read when dnsmasq receives SIGHUP.
|
||||||
|
Could be either a string or a file-like object.
|
||||||
|
|
||||||
@item @code{addresses} (default: @code{'()})
|
@item @code{addresses} (default: @code{'()})
|
||||||
For each entry, specify an IP address to return for any host in the
|
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
|
given domains. Queries in the domains are never forwarded and always
|
||||||
|
|
|
@ -754,6 +754,8 @@ cache.size = 100 * MB
|
||||||
(default #f)) ;boolean
|
(default #f)) ;boolean
|
||||||
(servers dnsmasq-configuration-servers
|
(servers dnsmasq-configuration-servers
|
||||||
(default '())) ;list of string
|
(default '())) ;list of string
|
||||||
|
(servers-file dnsmasq-configuration-servers-file
|
||||||
|
(default #f)) ;string|file-like
|
||||||
(addresses dnsmasq-configuration-addresses
|
(addresses dnsmasq-configuration-addresses
|
||||||
(default '())) ;list of string
|
(default '())) ;list of string
|
||||||
(cache-size dnsmasq-configuration-cache-size
|
(cache-size dnsmasq-configuration-cache-size
|
||||||
|
@ -792,7 +794,7 @@ cache.size = 100 * MB
|
||||||
port local-service? listen-addresses
|
port local-service? listen-addresses
|
||||||
resolv-file no-resolv?
|
resolv-file no-resolv?
|
||||||
forward-private-reverse-lookup? query-servers-in-order?
|
forward-private-reverse-lookup? query-servers-in-order?
|
||||||
servers addresses
|
servers addresses servers-file
|
||||||
cache-size negative-cache?
|
cache-size negative-cache?
|
||||||
cpe-id
|
cpe-id
|
||||||
tftp-enable? tftp-no-fail?
|
tftp-enable? tftp-no-fail?
|
||||||
|
@ -805,76 +807,80 @@ cache.size = 100 * MB
|
||||||
(requirement '(networking))
|
(requirement '(networking))
|
||||||
(documentation "Run the dnsmasq DNS server.")
|
(documentation "Run the dnsmasq DNS server.")
|
||||||
(start #~(make-forkexec-constructor
|
(start #~(make-forkexec-constructor
|
||||||
'(#$(file-append package "/sbin/dnsmasq")
|
(list
|
||||||
"--keep-in-foreground"
|
#$(file-append package "/sbin/dnsmasq")
|
||||||
"--pid-file=/run/dnsmasq.pid"
|
"--keep-in-foreground"
|
||||||
#$@(if no-hosts?
|
"--pid-file=/run/dnsmasq.pid"
|
||||||
'("--no-hosts")
|
#$@(if no-hosts?
|
||||||
|
'("--no-hosts")
|
||||||
'())
|
'())
|
||||||
#$(format #f "--port=~a" port)
|
#$(format #f "--port=~a" port)
|
||||||
#$@(if local-service?
|
#$@(if local-service?
|
||||||
'("--local-service")
|
'("--local-service")
|
||||||
'())
|
'())
|
||||||
#$@(map (cut format #f "--listen-address=~a" <>)
|
#$@(map (cut format #f "--listen-address=~a" <>)
|
||||||
listen-addresses)
|
listen-addresses)
|
||||||
#$(format #f "--resolv-file=~a" resolv-file)
|
#$(format #f "--resolv-file=~a" resolv-file)
|
||||||
#$@(if no-resolv?
|
#$@(if no-resolv?
|
||||||
'("--no-resolv")
|
'("--no-resolv")
|
||||||
'())
|
'())
|
||||||
#$@(if forward-private-reverse-lookup?
|
#$@(if forward-private-reverse-lookup?
|
||||||
'()
|
'()
|
||||||
'("--bogus-priv"))
|
'("--bogus-priv"))
|
||||||
#$@(if query-servers-in-order?
|
#$@(if query-servers-in-order?
|
||||||
'("--strict-order")
|
'("--strict-order")
|
||||||
'())
|
'())
|
||||||
#$@(map (cut format #f "--server=~a" <>)
|
#$@(if servers-file
|
||||||
servers)
|
(list #~(string-append "--servers-file=" #$servers-file))
|
||||||
#$@(map (cut format #f "--address=~a" <>)
|
'())
|
||||||
addresses)
|
#$@(map (cut format #f "--server=~a" <>)
|
||||||
#$(format #f "--cache-size=~a" cache-size)
|
servers)
|
||||||
#$@(if negative-cache?
|
#$@(map (cut format #f "--address=~a" <>)
|
||||||
'()
|
addresses)
|
||||||
|
#$(format #f "--cache-size=~a" cache-size)
|
||||||
|
#$@(if negative-cache?
|
||||||
|
'()
|
||||||
'("--no-negcache"))
|
'("--no-negcache"))
|
||||||
#$@(if cpe-id
|
#$@(if cpe-id
|
||||||
(list (format #f "--add-cpe-id=~a" cpe-id))
|
(list (format #f "--add-cpe-id=~a" cpe-id))
|
||||||
|
'())
|
||||||
|
#$@(if tftp-enable?
|
||||||
|
'("--enable-tftp")
|
||||||
'())
|
'())
|
||||||
#$@(if tftp-enable?
|
#$@(if tftp-no-fail?
|
||||||
'("--enable-tftp")
|
'("--tftp-no-fail")
|
||||||
'())
|
'())
|
||||||
#$@(if tftp-no-fail?
|
#$@(if tftp-single-port?
|
||||||
'("--tftp-no-fail")
|
'("--tftp-single-port")
|
||||||
'())
|
'())
|
||||||
#$@(if tftp-single-port?
|
#$@(if tftp-secure?
|
||||||
'("--tftp-single-port")
|
'("--tftp-secure")
|
||||||
'())
|
'())
|
||||||
#$@(if tftp-secure?
|
#$@(if tftp-max
|
||||||
'("--tftp-secure?")
|
(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
|
#$@(if tftp-lowercase?
|
||||||
(list (format #f "--tftp-max=~a" tftp-max))
|
'("--tftp-lowercase")
|
||||||
'())
|
'())
|
||||||
#$@(if tftp-mtu
|
#$@(if tftp-port-range
|
||||||
(list (format #f "--tftp-mtu=~a" tftp-mtu))
|
(list (format #f "--tftp-port-range=~a"
|
||||||
'())
|
tftp-port-range))
|
||||||
#$@(if tftp-no-blocksize?
|
'())
|
||||||
'("--tftp-no-blocksize")
|
#$@(if tftp-root
|
||||||
'())
|
(list (format #f "--tftp-root=~a" tftp-root))
|
||||||
#$@(if tftp-lowercase?
|
'())
|
||||||
'("--tftp-lowercase")
|
#$@(if tftp-unique-root
|
||||||
'())
|
(list
|
||||||
#$@(if tftp-port-range
|
(if (> (length tftp-unique-root) 0)
|
||||||
(list (format #f "--tftp-port-range=~a"
|
(format #f "--tftp-unique-root=~a" tftp-unique-root)
|
||||||
tftp-port-range))
|
(format #f "--tftp-unique-root")))
|
||||||
'())
|
'()))
|
||||||
#$@(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"))
|
#:pid-file "/run/dnsmasq.pid"))
|
||||||
(stop #~(make-kill-destructor)))))
|
(stop #~(make-kill-destructor)))))
|
||||||
|
|
||||||
|
|
Reference in a new issue