diff options
| author | Maxim Cournoyer <maxim@guixotic.coop> | 2026-05-24 12:55:53 +0900 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2026-05-26 16:07:53 +0900 |
| commit | 185b9f4f192cb9d32f6a6e396c2048a032db951f (patch) | |
| tree | 8025211564b49a2114c8593dac991b562cc35a6d | |
| parent | 663293331b4721c8fbe065eb4c0cfab824e8c86a (diff) | |
service: dnsmasq: Add ipv4? and ipv6? configuration options.
* gnu/services/dns.scm (<dnsmasq-configuration>) [ipv4?, ipv6?]: New fields.
(dnsmasq-shepherd-service): Use them.
* doc/guix.texi (DNS Services): Document them.
Change-Id: I50a4e407cea9e55295c9cfff081b7678ab7e061c
| -rw-r--r-- | doc/guix.texi | 6 | ||||
| -rw-r--r-- | gnu/services/dns.scm | 14 |
2 files changed, 19 insertions, 1 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 0cb9b513caf..7a8ec55b956 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -38201,6 +38201,12 @@ ie a subnet for which an interface exists on the server. | |||
| 38201 | @item @code{listen-addresses} (default: @code{'()}) | 38201 | @item @code{listen-addresses} (default: @code{'()}) |
| 38202 | Listen on the given IP addresses. | 38202 | Listen on the given IP addresses. |
| 38203 | 38203 | ||
| 38204 | @item @code{ipv4?} (default: @code{#t}) | ||
| 38205 | Whether to include A records in answers. | ||
| 38206 | |||
| 38207 | @item @code{ipv6?} (default: @code{#t}) | ||
| 38208 | Whether to include AAAA records in answers. | ||
| 38209 | |||
| 38204 | @item @code{resolv-file} (default: @code{"/etc/resolv.conf"}) | 38210 | @item @code{resolv-file} (default: @code{"/etc/resolv.conf"}) |
| 38205 | The file to read the IP address of the upstream nameservers from. | 38211 | The file to read the IP address of the upstream nameservers from. |
| 38206 | 38212 | ||
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index e0cab485884..d4f771b9b68 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm | |||
| @@ -64,6 +64,8 @@ | |||
| 64 | dnsmasq-configuration-port | 64 | dnsmasq-configuration-port |
| 65 | dnsmasq-configuration-local-service? | 65 | dnsmasq-configuration-local-service? |
| 66 | dnsmasq-configuration-listen-address | 66 | dnsmasq-configuration-listen-address |
| 67 | dnsmasq-configuration-ipv4? | ||
| 68 | dnsmasq-configuration-ipv6? | ||
| 67 | dnsmasq-configuration-resolv-file | 69 | dnsmasq-configuration-resolv-file |
| 68 | dnsmasq-configuration-no-resolv? | 70 | dnsmasq-configuration-no-resolv? |
| 69 | dnsmasq-configuration-forward-private-reverse-lookup? | 71 | dnsmasq-configuration-forward-private-reverse-lookup? |
| @@ -793,6 +795,10 @@ cache.size = 100 * MB | |||
| 793 | (default #t)) ;boolean | 795 | (default #t)) ;boolean |
| 794 | (listen-addresses dnsmasq-configuration-listen-address | 796 | (listen-addresses dnsmasq-configuration-listen-address |
| 795 | (default '())) ;list of string | 797 | (default '())) ;list of string |
| 798 | (ipv4? dnsmasq-configuration-ipv4? | ||
| 799 | (default #t)) | ||
| 800 | (ipv6? dnsmasq-configuration-ipv6? | ||
| 801 | (default #t)) | ||
| 796 | (resolv-file dnsmasq-configuration-resolv-file | 802 | (resolv-file dnsmasq-configuration-resolv-file |
| 797 | (default "/etc/resolv.conf")) ;string | 803 | (default "/etc/resolv.conf")) ;string |
| 798 | (no-resolv? dnsmasq-configuration-no-resolv? | 804 | (no-resolv? dnsmasq-configuration-no-resolv? |
| @@ -859,7 +865,7 @@ cache.size = 100 * MB | |||
| 859 | shepherd-requirement | 865 | shepherd-requirement |
| 860 | pid-file | 866 | pid-file |
| 861 | no-hosts? | 867 | no-hosts? |
| 862 | port local-service? listen-addresses | 868 | port local-service? listen-addresses ipv4? ipv6? |
| 863 | resolv-file no-resolv? | 869 | resolv-file no-resolv? |
| 864 | forward-private-reverse-lookup? query-servers-in-order? | 870 | forward-private-reverse-lookup? query-servers-in-order? |
| 865 | servers addresses servers-file | 871 | servers addresses servers-file |
| @@ -891,6 +897,12 @@ cache.size = 100 * MB | |||
| 891 | '()) | 897 | '()) |
| 892 | #$@(map (cut format #f "--listen-address=~a" <>) | 898 | #$@(map (cut format #f "--listen-address=~a" <>) |
| 893 | listen-addresses) | 899 | listen-addresses) |
| 900 | #$@(if (not ipv4?) | ||
| 901 | '("--filter-A") | ||
| 902 | '()) | ||
| 903 | #$@(if (not ipv6?) | ||
| 904 | '("--filter-AAAA") | ||
| 905 | '()) | ||
| 894 | #$(format #f "--resolv-file=~a" resolv-file) | 906 | #$(format #f "--resolv-file=~a" resolv-file) |
| 895 | #$@(if no-resolv? | 907 | #$@(if no-resolv? |
| 896 | '("--no-resolv") | 908 | '("--no-resolv") |
