1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
3 ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
7 ;;; Copyright © 2016 Nikita <nikita@n0.is>
8 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2016, 2020 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
11 ;;; Copyright © 2017 Gregor Giesen <giesen@zaehlwerk.net>
12 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
13 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
14 ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
15 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
16 ;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
17 ;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
18 ;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
19 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
21 ;;; This file is part of GNU Guix.
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36 (define-module (gnu packages dns)
37 #:use-module (gnu packages admin)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages bash)
41 #:use-module (gnu packages check)
42 #:use-module (gnu packages databases)
43 #:use-module (gnu packages documentation)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages crypto)
46 #:use-module (gnu packages datastructures)
47 #:use-module (gnu packages flex)
48 #:use-module (gnu packages gcc)
49 #:use-module (gnu packages glib)
50 #:use-module (gnu packages groff)
51 #:use-module (gnu packages groff)
52 #:use-module (gnu packages libedit)
53 #:use-module (gnu packages libevent)
54 #:use-module (gnu packages libidn)
55 #:use-module (gnu packages linux)
56 #:use-module (gnu packages lua)
57 #:use-module (gnu packages ncurses)
58 #:use-module (gnu packages nettle)
59 #:use-module (gnu packages networking)
60 #:use-module (gnu packages perl)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages protobuf)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-xyz)
65 #:use-module (gnu packages sphinx)
66 #:use-module (gnu packages swig)
67 #:use-module (gnu packages tls)
68 #:use-module (gnu packages web)
69 #:use-module (gnu packages xml)
70 #:use-module (gnu packages)
71 #:use-module ((guix licenses) #:prefix license:)
72 #:use-module (guix packages)
73 #:use-module (guix download)
74 #:use-module (guix git-download)
75 #:use-module (guix utils)
76 #:use-module (guix build-system gnu)
77 #:use-module (guix build-system meson)
78 #:use-module (guix build-system trivial))
80 (define-public dnsmasq
87 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
91 "1yzq6anwgr5rlnwydpszb51cyhp2vjq29b24ck19flbwac1sk73l"))))
92 (build-system gnu-build-system)
94 `(("pkg-config" ,pkg-config)))
99 (modify-phases %standard-phases (delete 'configure))
100 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
102 "COPTS=\"-DHAVE_DBUS\"")
103 #:tests? #f)) ; no ‘check’ target
104 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
105 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
107 "Dnsmasq is a light-weight DNS forwarder and DHCP server. It is designed
108 to provide DNS and, optionally, DHCP to a small network. It can serve the
109 names of local machines which are not in the global DNS. The DHCP server
110 integrates with the DNS server and allows machines with DHCP-allocated
111 addresses to appear in the DNS with names configured either on each host or in
112 a central configuration file. Dnsmasq supports static and dynamic DHCP leases
113 and BOOTP/TFTP for network booting of diskless machines.")
114 ;; Source files only say GPL2 and GPL3 are allowed.
115 (license (list license:gpl2 license:gpl3))))
117 ;; 'bind' is the name of a built-in Guile procedure, which is why we choose a
118 ;; different name here.
119 (define-public isc-bind
126 "https://ftp.isc.org/isc/bind9/" version
127 "/bind-" version ".tar.xz"))
130 "02ip1xvmnqla3p5k2rmfrksrw4q9iqbrhyg3mamvrj5a7n6hh8km"))))
131 (build-system gnu-build-system)
132 (outputs `("out" "utils"))
134 ;; It would be nice to add GeoIP and gssapi once there are packages.
141 ("python-ply" ,python-ply)))
144 ("pkg-config" ,pkg-config)))
147 (list (string-append "--with-pkcs11="
148 (assoc-ref %build-inputs "p11-kit")))
150 (modify-phases %standard-phases
151 (add-after 'strip 'move-to-utils
155 (let ((target (string-append (assoc-ref %outputs "utils") file))
156 (src (string-append (assoc-ref %outputs "out") file)))
157 (mkdir-p (dirname target))
160 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
161 "/share/man/man1/dig.1"
162 "/share/man/man1/host.1"
163 "/share/man/man1/nslookup.1"
164 "/share/man/man1/nsupdate.1"))
166 ;; When and if guix provides user namespaces for the build process,
167 ;; then the following can be uncommented and the subsequent "force-test"
168 ;; will not be necessary.
170 ;; (add-before 'check 'set-up-loopback
172 ;; (system "bin/tests/system/ifconfig.sh up")))
175 ;; XXX Even ‘make force-test’ tries to create network interfaces
176 ;; and fails. The only working target is the (trivial) fuzz test.
177 (with-directory-excursion "fuzz"
178 (invoke "make" "check"))
180 (synopsis "An implementation of the Domain Name System")
181 (description "BIND is an implementation of the @dfn{Domain Name System}
182 (DNS) protocols for the Internet. It is a reference implementation of those
183 protocols, but it is also production-grade software, suitable for use in
184 high-volume and high-reliability applications. The name BIND stands for
185 \"Berkeley Internet Name Domain\", because the software originated in the early
186 1980s at the University of California at Berkeley.")
187 (home-page "https://www.isc.org/downloads/bind")
188 (license (list license:mpl2.0))))
190 (define-public dnscrypt-proxy
192 (name "dnscrypt-proxy")
197 "https://download.dnscrypt.org/dnscrypt-proxy/"
198 "dnscrypt-proxy-" version ".tar.bz2"))
201 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
202 (modules '((guix build utils)))
204 ;; Delete bundled libltdl. XXX: This package also bundles
205 ;; a modified libevent that cannot currently be removed.
207 (delete-file-recursively "libltdl")
209 (build-system gnu-build-system)
212 (modify-phases %standard-phases
213 (add-after 'unpack 'autoreconf
215 ;; Re-generate build files due to unbundling ltdl.
216 ;; TODO: Prevent generating new libltdl and building it.
217 ;; The system version is still favored and referenced.
218 (invoke "autoreconf" "-vif"))))))
220 `(("pkg-config" ,pkg-config)
221 ("automake" ,automake)
222 ("autoconf" ,autoconf)
223 ("libtool" ,libtool)))
225 `(("libltdl" ,libltdl)
226 ("libsodium" ,libsodium)))
227 (home-page "https://www.dnscrypt.org/")
228 (synopsis "Securely send DNS requests to a remote server")
230 "@command{dnscrypt-proxy} is a tool for securing communications
231 between a client and a DNS resolver. It verifies that responses you get
232 from a DNS provider was actually sent by that provider, and haven't been
233 tampered with. For optimal performance it is recommended to use this as
234 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
235 can also be used as a normal DNS \"server\". A list of public dnscrypt
236 servers is included, and an up-to-date version is available at
237 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
238 (license (list license:isc
239 ;; Libevent and src/ext/queue.h is 3-clause BSD.
242 (define-public dnscrypt-wrapper
244 (name "dnscrypt-wrapper")
249 "https://github.com/cofyc/dnscrypt-wrapper/releases"
250 "/download/v" version "/" name "-v" version ".tar.bz2"))
253 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
254 (build-system gnu-build-system)
256 `(#:make-flags '("CC=gcc")
257 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
260 (modify-phases %standard-phases
261 (add-after 'unpack 'create-configure
263 (invoke "make" "configure"))))))
265 `(("autoconf" ,autoconf)))
267 `(("libevent" ,libevent)
268 ("libsodium" ,libsodium)))
269 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
270 (synopsis "Server-side dnscrypt proxy")
272 "@command{dnscrypt-wrapper} is a tool to expose a name server over
273 the @code{dnscrypt} protocol. It can be used as an endpoint for the
274 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
276 (license (list license:isc
277 ;; Bundled argparse is MIT. TODO: package and unbundle.
279 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
283 (define-public libasr
290 (uri (string-append "https://www.opensmtpd.org/archives/"
291 "libasr-" version ".tar.gz"))
293 (base32 "1d6s8njqhvayx2gp47409sp1fn8m608ws26hr1srfp6i23nnpyqr"))))
294 (build-system gnu-build-system)
297 (modify-phases %standard-phases
298 (add-after 'install 'install-documentation
299 (lambda* (#:key outputs #:allow-other-keys)
300 (let ((out (assoc-ref outputs "out")))
301 (install-file "src/asr_run.3"
302 (string-append out "/share/man/man3"))
305 `(("autoconf" ,autoconf)
306 ("automake" ,automake)
308 ("pkg-config" ,pkg-config)))
309 (home-page "https://www.opensmtpd.org")
310 (synopsis "Asynchronous resolver library by the OpenBSD project")
312 "libasr is a free, simple and portable asynchronous resolver library.
313 It runs DNS queries and performs hostname resolution in a fully
314 asynchronous fashion.")
315 (license (list license:isc
316 license:bsd-2 ; last part of getrrsetbyname_async.c
318 (license:non-copyleft "file://LICENSE") ; includes.h
328 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
331 (base32 "0z7j3vwqqj0hh8n5irb2yqwzl45k4sn2wczbq1b1lqv5cxv6vgcy"))))
332 (build-system gnu-build-system)
335 (list "--enable-pie" ; fully benefit from ASLR
338 "--enable-relro-now" ; protect GOT and .dtor areas
339 "--disable-radix-tree"
340 (string-append "--with-libevent="
341 (assoc-ref %build-inputs "libevent"))
342 (string-append "--with-ssl="
343 (assoc-ref %build-inputs "openssl"))
344 "--with-configdir=/etc"
345 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
346 "--with-logfile=/var/log/nsd.log"
347 "--with-pidfile=/var/db/nsd/nsd.pid"
348 "--with-dbfile=/var/db/nsd/nsd.db"
349 "--with-zonesdir=/etc/nsd"
350 "--with-xfrdfile=/var/db/nsd/xfrd.state"
351 "--with-zonelistfile=/var/db/nsd/zone.list")
353 (modify-phases %standard-phases
354 (add-before 'configure 'patch-installation-paths
355 (lambda* (#:key outputs #:allow-other-keys)
356 (let* ((out (assoc-ref outputs "out"))
357 (doc (string-append out "/share/doc/" ,name "-" ,version)))
358 ;; The ‘make install’ target tries to create the parent
359 ;; directories of run-time things like ‘pidfile’ above, and
360 ;; useless empty directories like 'configdir'. Remove such
361 ;; '$(INSTALL)' lines and install the example configuration file
362 ;; in an appropriate location.
363 (substitute* "Makefile.in"
364 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
365 (string-append "#" command))
366 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
367 (string-append doc "/examples/" file-name)))
369 #:tests? #f)) ; no tests
371 `(("libevent" ,libevent)
372 ("openssl" ,openssl)))
373 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
374 (synopsis "Authoritative DNS name server")
375 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
376 name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
377 RFC-compliant nameserver.
379 NSD uses zone information compiled via @command{zonec} into a binary database
380 file (@file{nsd.db}). This allows fast startup of the name service daemon and
381 allows syntax-structural errors in zone files to be flagged at compile time,
382 before being made available to NSD service itself. However, most traditional
383 BIND-style zone files can be directly imported into NSD without modification.
385 The collection of programs and processes that make up NSD are designed so that
386 the daemon itself runs as a non-privileged user and can be easily configured to
387 run in a @code{chroot} jail, thus making any security flaws in NSD less likely
388 to result in system-wide compromise.")
389 (license (list license:bsd-3))))
391 (define-public unbound
398 (uri (string-append "https://www.unbound.net/downloads/unbound-"
401 (base32 "0dnmh9jjh2v274f0hl31bgv40pl77mmfgky8bkqr5kvi3b17fdmp"))))
402 (build-system gnu-build-system)
403 (outputs '("out" "python"))
409 ("libevent" ,libevent)
410 ("protobuf" ,protobuf)
411 ("python-wrapper" ,python-wrapper)
412 ("openssl" ,openssl)))
415 (list "--disable-static" ; save space and non-determinism in libunbound.a
417 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
419 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
421 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
422 "--with-pythonmodule" "--with-pyunbound")
424 (modify-phases %standard-phases
425 (add-after 'configure 'fix-python-site-package-path
426 ;; Move python modules into their own output.
427 (lambda* (#:key outputs #:allow-other-keys)
428 (let ((pyout (assoc-ref outputs "python"))
429 (ver ,(version-major+minor (package-version python))))
430 (substitute* "Makefile"
431 (("^PYTHON_SITE_PKG=.*$")
434 pyout "/lib/python-" ver "/site-packages\n"))))
436 (add-before 'check 'fix-missing-nss-for-tests
437 ;; Unfortunately, the package's unittests involve some checks
438 ;; looking up protocols and services which are not provided
439 ;; by the minimalistic build environment, in particular,
440 ;; /etc/protocols and /etc/services are missing.
441 ;; Also, after plain substitution of protocol and service names
442 ;; in the test data, the tests still fail because the
443 ;; corresponding Resource Records have been signed by
445 ;; The following LD_PRELOAD library overwrites the glibc
446 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
447 ;; ‘getservbyport’ providing the few records required for the
448 ;; unit tests to pass.
449 (lambda* (#:key inputs outputs #:allow-other-keys)
450 (let* ((source (assoc-ref %build-inputs "source"))
451 (gcc (assoc-ref %build-inputs "gcc")))
452 (call-with-output-file "/tmp/nss_preload.c"
454 (display "#include <stdlib.h>
460 struct protoent *getprotobyname(const char *name) {
461 struct protoent *p = malloc(sizeof(struct protoent));
462 p->p_aliases = malloc(sizeof(char*));
463 if (strcasecmp(name, \"tcp\") == 0) {
466 p->p_aliases[0] = \"TCP\";
467 } else if (strcasecmp(name, \"udp\") == 0) {
470 p->p_aliases[0] = \"UDP\";
476 struct protoent *getprotobynumber(int proto) {
477 struct protoent *p = malloc(sizeof(struct protoent));
478 p->p_aliases = malloc(sizeof(char*));
483 p->p_aliases[0] = \"TCP\";
488 p->p_aliases[0] = \"UDP\";
497 struct servent *getservbyname(const char *name, const char *proto) {
498 struct servent *s = malloc(sizeof(struct servent));
499 char* buf = malloc((strlen(proto)+1)*sizeof(char));
501 s->s_aliases = malloc(sizeof(char*));
502 s->s_aliases[0] = NULL;
503 if (strcasecmp(name, \"domain\") == 0) {
504 s->s_name = \"domain\";
505 s->s_port = htons(53);
512 struct servent *getservbyport(int port, const char *proto) {
514 struct servent *s = malloc(sizeof(struct servent));
516 s->s_aliases = malloc(sizeof(char*));
517 s->s_aliases[0] = NULL;
520 s->s_name = \"domain\";
522 s->s_proto = \"udp\";
530 (invoke (string-append gcc "/bin/gcc")
531 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
532 "/tmp/nss_preload.c")
533 ;; The preload library only affects the unittests.
534 (substitute* "Makefile"
536 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
538 (home-page "https://www.unbound.net")
539 (synopsis "Validating, recursive, and caching DNS resolver")
541 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
542 validation of results. It implements only a minimal amount of authoritative
543 service to prevent leakage to the root nameservers: forward lookups for
544 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
545 served by AS112. Stub and forward zones are supported.")
546 (license license:bsd-4)))
548 (define-public yadifa
553 (let ((build "8497"))
557 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
558 "yadifa-" version "-" build ".tar.gz"))
560 (base32 "0xvyr91sfgzkpw6g3h893ldbwnki3w2472n56rr18w67qghs1sa5")))))
561 (build-system gnu-build-system)
565 `(("openssl" ,openssl)))
568 (modify-phases %standard-phases
569 (add-before 'configure 'omit-example-configurations
571 (substitute* "Makefile.in"
575 (list "--sysconfdir=/etc"
576 "--localstatedir=/var"
577 "--disable-build-timestamp" ; build reproducibly
582 "--enable-ctrl" ; enable remote control
586 (home-page "https://www.yadifa.eu/")
587 (synopsis "Authoritative DNS name server")
588 (description "YADIFA is an authoritative name server for the @dfn{Domain
589 Name System} (DNS). It aims for both higher performance and a smaller memory
590 footprint than other implementations, while remaining fully RFC-compliant.
591 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
592 Extensions} (DNSSEC).")
593 (license license:bsd-3)))
602 (uri (string-append "https://secure.nic.cz/files/knot-dns/"
603 "knot-" version ".tar.xz"))
605 (base32 "0xmzmhd2m9rb24clrrd9k058harsq67nyjplpbyxvy1g46xah28i"))
606 (modules '((guix build utils)))
609 ;; Delete bundled libraries.
610 (with-directory-excursion "src/contrib"
611 (delete-file-recursively "lmdb"))
613 (build-system gnu-build-system)
615 `(("pkg-config" ,pkg-config)))
620 ("libcap-ng" ,libcap-ng)
626 ("protobuf-c" ,protobuf-c)))
629 (modify-phases %standard-phases
630 (add-before 'configure 'disable-directory-pre-creation
632 ;; Don't install empty directories like ‘/etc’ outside the store.
633 ;; This is needed even when using ‘make config_dir=... install’.
634 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
637 (lambda* (#:key outputs #:allow-other-keys)
638 (let* ((out (assoc-ref outputs "out"))
639 (doc (string-append out "/share/doc/" ,name "-" ,version))
640 (etc (string-append doc "/examples/etc")))
642 (string-append "config_dir=" etc)
645 (list "--sysconfdir=/etc"
646 "--localstatedir=/var"
647 "--enable-dnstap" ; let tools read/write capture files
648 "--with-module-dnstap=yes" ; detailed query capturing & logging
649 (string-append "--with-bash-completions="
650 (assoc-ref %outputs "out")
651 "/etc/bash_completion.d"))))
652 (home-page "https://www.knot-dns.cz/")
653 (synopsis "Authoritative DNS name server")
654 (description "Knot DNS is an authoritative name server for the @dfn{Domain
655 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
656 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
657 number of programming techniques to improve speed. For example, the responder
658 is completely lock-free, resulting in a very high response rate. Other features
659 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
660 synthesis, and on-the-fly re-configuration.")
663 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
664 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
666 license:lgpl2.0+ ; parts of scr/contrib/ucw
667 license:public-domain ; src/contrib/fnv and possibly murmurhash3
668 license:gpl3+)))) ; everything else
670 (define-public knot-resolver
672 (name "knot-resolver")
676 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
677 "knot-resolver-" version ".tar.xz"))
680 "09ffmqx79lv5psr433x4n946njgsn071b9b7161pcb9bmrqz380c"))))
681 (build-system meson-build-system)
683 '(#:configure-flags '("-Ddoc=enabled")
685 (modify-phases %standard-phases
686 (add-before 'configure 'disable-default-ta
688 ;; Disable the default managed root TA, since we don't have
689 ;; write access to the keyfile and its directory in store.
690 (substitute* "daemon/lua/sandbox.lua.in"
691 (("^trust_anchors\\.add_file.*") ""))
693 (add-after 'build 'build-doc
695 (invoke "ninja" "doc")))
696 (add-after 'install 'wrap-binary
697 (lambda* (#:key inputs outputs #:allow-other-keys)
698 (let* ((out (assoc-ref outputs "out"))
699 (lua-* (map cdr (filter
701 (string-prefix? "lua-" (car input)))
703 (lua-path (lambda (p)
704 (string-append p "/share/lua/5.1/?.lua")))
705 (lua-cpath (lambda (p)
706 (string-append p "/lib/lua/5.1/?.so"))))
707 (wrap-program (string-append out "/sbin/kresd")
708 `("LUA_PATH" ";" prefix ,(map lua-path lua-*))
709 `("LUA_CPATH" ";" prefix ,(map lua-cpath lua-*)))
712 `(("cmocka" ,cmocka) ; for unit tests
714 ("protobuf-c" ,protobuf-c)
715 ("pkg-config" ,pkg-config)
716 ("python-breathe" ,python-breathe)
717 ("python-sphinx" ,python-sphinx)
718 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
726 ;; TODO: Add optional lua modules: basexx and psl.
727 ("lua-bitop" ,lua5.1-bitop)
728 ("lua-cqueues" ,lua5.1-cqueues)
729 ("lua-filesystem" ,lua5.1-filesystem)
730 ("lua-sec" ,lua5.1-sec)
731 ("lua-socket" ,lua5.1-socket)))
732 (home-page "https://www.knot-resolver.cz/")
733 (synopsis "Caching validating DNS resolver")
735 "Knot Resolver is a caching full resolver implementation written in C and
736 LuaJIT, both a resolver library and a daemon.")
737 (license (list license:gpl3+
738 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
743 (define-public ddclient
751 (url "https://github.com/ddclient/ddclient.git")
752 (commit (string-append "v" version))))
753 (file-name (git-file-name name version))
755 (base32 "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w"))))
756 (build-system trivial-build-system) ; no Makefile.PL
761 `(("inetutils" ,inetutils) ; logger
762 ("net-tools" ,net-tools)
763 ("perl-data-validate-ip" ,perl-data-validate-ip)
764 ("perl-digest-sha1" ,perl-digest-sha1)
765 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
767 `(#:modules ((guix build utils)
772 (use-modules (guix build utils)
775 (setenv "PATH" (string-append
776 (assoc-ref %build-inputs "bash") "/bin" ":"
777 (assoc-ref %build-inputs "perl") "/bin"))
779 ;; Copy the (read-only) source into the (writable) build directory.
780 (copy-recursively (assoc-ref %build-inputs "source") ".")
783 (let* ((out (assoc-ref %outputs "out"))
784 (bin (string-append out "/bin")))
785 (let ((file "ddclient"))
787 (("/usr/bin/perl") (which "perl"))
788 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
789 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
790 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
791 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
792 (("\\$cachedir\\$program\\.cache")
793 "/var/cache/ddclient/ddclient.cache"))
794 (install-file file bin)
795 (wrap-program (string-append bin "/" file)
798 ,@(map (lambda (input)
801 (string-append store "/bin"))))
807 (((? (cut string-prefix? "perl-" <>) name) . dir)
808 (string-append dir "/lib/perl5/site_perl"))
811 (for-each (cut install-file <> (string-append out
813 (find-files "." "sample.*$"))))))
814 (home-page "https://ddclient.net/")
815 (synopsis "Address updating utility for dynamic DNS services")
816 (description "This package provides a client to update dynamic IP
817 addresses with several dynamic DNS service providers, such as
818 @uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
820 This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
821 access a machine with a dynamic IP address.
823 The client supports both dynamic and (near) static services, as well as MX
824 record and alternative name management. It caches the address, and only
825 attempts the update when it has changed.")
826 (license license:gpl2+)))
829 ;; There have been no releases yet, hence this commit.
831 (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
834 (version (git-version "0.0" revision commit))
838 (url "https://github.com/handshake-org/hnsd")
842 "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
843 (file-name (git-file-name name version))
844 (modules '((guix build utils)))
847 ;; Delete the bundled copy of libuv.
848 (delete-file-recursively "uv")
849 (substitute* "configure.ac"
850 (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
851 (substitute* "Makefile.am"
852 (("SUBDIRS = uv") "\n")
853 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
855 ;; Make sure the 'hnsd' binary is installed and
856 ;; dynamically-linked.
857 (("noinst_PROGRAMS") "bin_PROGRAMS")
858 (("hnsd_LDFLAGS = -static") ""))
860 ;; This script tries to chdir to "uv" and doesn't do more
861 ;; than "autoreconf" so remove it.
862 (delete-file "autogen.sh")
864 (build-system gnu-build-system)
866 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
868 `(("autoconf" ,autoconf)
869 ("automake" ,automake)
870 ("libtool" ,libtool)))
872 `(("unbound" ,unbound)
874 (home-page "https://www.handshake.org/")
875 (synopsis "Resolver daemon for the Handshake naming protocol")
877 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
878 System (HNS) peer-to-peer network.")
879 (license license:expat))))
881 (define-public libmicrodns
887 (uri (string-append "https://github.com/videolabs/libmicrodns/"
888 "releases/download/" version "/microdns-"
892 "0p4va18zxgmzcdwhlbg2mmjwswlbgqy4ay5vaxrw7cxmhsflnv36"))))
893 (build-system meson-build-system)
894 (home-page "https://github.com/videolabs/libmicrodns")
895 (synopsis "Minimal mDNS resolver library")
896 (description "@code{libmicrodns} provides a minimal implementation of a
897 mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
898 a zero-config service that allows one to resolve host names to IP addresses in
900 (license license:lgpl2.1)))
902 (define-public public-suffix-list
903 ;; Mozilla releases the official list here:
905 ;; https://publicsuffix.org/list/public_suffix_list.dat
907 ;; However, Mozilla syncs that file from the GitHub repository periodically,
908 ;; so its contents will change over time. If you update this commit, please
909 ;; make sure that the new commit refers to a list which is identical to the
910 ;; officially published list available from the URL above.
911 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
913 (name "public-suffix-list")
914 (version (git-version "0" "1" commit))
918 (url "https://github.com/publicsuffix/list.git")
920 (file-name (git-file-name name version))
923 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
924 (build-system trivial-build-system)
926 `(#:modules ((guix build utils))
929 (use-modules (guix build utils))
930 (let* ((out (assoc-ref %outputs "out"))
931 ;; Install to /share because that is where "read-only
932 ;; architecture-independent data files" should go (see:
933 ;; (standards) Directory Variables). Include the version in
934 ;; the directory name so that if multiple versions are ever
935 ;; installed in the same profile, they will not conflict.
936 (destination (string-append
937 out "/share/public-suffix-list-" ,version))
938 (source (assoc-ref %build-inputs "source")))
939 (with-directory-excursion source
940 (install-file "public_suffix_list.dat" destination)
941 (install-file "LICENSE" destination))
943 (home-page "https://publicsuffix.org/")
944 (synopsis "Database of current and historical DNS suffixes")
945 (description "This is the Public Suffix List maintained by Mozilla. A
946 \"public suffix\" is one under which Internet users can (or historically
947 could) directly register names in the Domain Name System (DNS). Some examples
948 of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
949 known public suffixes.")
950 (license license:mpl2.0))))
952 (define-public maradns
959 (uri (string-append "https://maradns.samiam.org/download/"
960 (version-major+minor version) "/"
961 version "/maradns-" version ".tar.xz"))
964 "1zv0i6m4m05ay5zlhwq1h88hgjq2d81cjanpnb3gyhr0xhmjwk6a"))))
965 (build-system gnu-build-system)
967 `(#:tests? #f ; need to be root to run tests
971 (if ,(%current-target-system)
972 (string-append (assoc-ref %build-inputs "cross-gcc")
973 "/bin/" ,(%current-target-system) "-gcc")
975 (string-append "PREFIX=" %output)
976 (string-append "RPM_BUILD_ROOT=" %output))
978 (modify-phases %standard-phases
980 (lambda* (#:key native-inputs target #:allow-other-keys)
981 ;; make_32bit_tables generates a header file that is used during
982 ;; compilation. Hence, during cross compilation, it should be
983 ;; built for the host system.
985 (substitute* "rng/Makefile"
986 (("\\$\\(CC\\) -o make_32bit_tables")
987 (string-append (assoc-ref native-inputs "gcc")
988 "/bin/gcc -o make_32bit_tables"))))
989 (invoke "./configure")))
990 (add-before 'install 'create-install-directories
991 (lambda* (#:key outputs #:allow-other-keys)
992 (let ((out (assoc-ref outputs "out")))
993 (for-each (lambda (dir)
994 (mkdir-p (string-append out dir)))
995 (list "/bin" "/sbin" "/etc"
1000 (home-page "https://maradns.samiam.org")
1001 (synopsis "Small lightweight DNS server")
1002 (description "MaraDNS is a small and lightweight DNS server. MaraDNS
1003 consists of a UDP-only authoritative DNS server for hosting domains, and a UDP
1004 and TCP-capable recursive DNS server for finding domains on the internet.")
1005 (license license:bsd-2)))
1007 (define-public openresolv
1013 (uri (string-append "https://roy.marples.name/downloads/openresolv/"
1014 "openresolv-" version ".tar.xz"))
1017 "01ms6c087la4hk0f0w6n2vpsb7dg4kklah2rqyhz88p0vr9bqy20"))
1019 (search-patches "openresolv-restartcmd-guix.patch"))))
1020 (build-system gnu-build-system)
1022 `(#:tests? #f ; No test suite
1024 (list (string-append "--sysconfdir=/etc"))
1026 (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))))
1027 (home-page "https://roy.marples.name/projects/openresolv/")
1028 (synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
1029 (description "openresolv is an implementation of @command{resolvconf}, the
1030 middleman between the network configuration services and
1031 @file{/etc/resolv.conf}. @command{resolvconf} itself is just a script that
1032 stores, removes and lists a full @file{resolv.conf} generated for the
1033 interface. It then calls all the helper scripts it knows about so it can
1034 configure the real @file{/etc/resolv.conf} and optionally any local
1035 nameservers other than libc.")
1036 (license license:bsd-2)))