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 certs)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages databases)
44 #:use-module (gnu packages documentation)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages crypto)
47 #:use-module (gnu packages datastructures)
48 #:use-module (gnu packages flex)
49 #:use-module (gnu packages freedesktop)
50 #:use-module (gnu packages gcc)
51 #:use-module (gnu packages glib)
52 #:use-module (gnu packages groff)
53 #:use-module (gnu packages groff)
54 #:use-module (gnu packages gtk)
55 #:use-module (gnu packages libedit)
56 #:use-module (gnu packages libevent)
57 #:use-module (gnu packages libidn)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages lua)
60 #:use-module (gnu packages ncurses)
61 #:use-module (gnu packages nettle)
62 #:use-module (gnu packages networking)
63 #:use-module (gnu packages perl)
64 #:use-module (gnu packages pkg-config)
65 #:use-module (gnu packages protobuf)
66 #:use-module (gnu packages python)
67 #:use-module (gnu packages python-xyz)
68 #:use-module (gnu packages shells)
69 #:use-module (gnu packages sphinx)
70 #:use-module (gnu packages swig)
71 #:use-module (gnu packages tls)
72 #:use-module (gnu packages web)
73 #:use-module (gnu packages xml)
74 #:use-module (gnu packages)
75 #:use-module ((guix licenses) #:prefix license:)
76 #:use-module (guix packages)
77 #:use-module (guix download)
78 #:use-module (guix git-download)
79 #:use-module (guix utils)
80 #:use-module (guix build-system glib-or-gtk)
81 #:use-module (guix build-system gnu)
82 #:use-module (guix build-system meson)
83 #:use-module (guix build-system trivial))
93 (string-append "https://www.nlnetlabs.nl/downloads/"
94 name "/" name "-" version ".tar.gz"))
96 (base32 "0ac242n7996fswq1a3nlh1bbbhrsdwsq4mx7xq8ffq6aplb4rj4a"))
99 ;; To create make-flag vairables,
100 ;; for splitting installation of drill and examples.
101 "ldns-drill-examples.patch"))))
102 (build-system gnu-build-system)
103 (outputs '("out" "drill" "examples" "pyldns"))
105 `( ;; Tests require Tpkg.
106 ;; https://tpkg.github.io/
111 "--enable-gost-anyway"
112 "--enable-rrtype-ninfo"
113 "--enable-rrtype-rkey"
115 "--enable-rrtype-avc"
116 "--enable-rrtype-doa"
117 "--enable-rrtype-amtrelay"
121 ;; Perl module DNS::LDNS not available.
122 ;; https://github.com/erikoest/DNS-LDNS.git
123 ;; "--with-p5-dns-ldns"
124 (string-append "--with-ssl="
125 (assoc-ref %build-inputs "openssl"))
126 (string-append "--with-ca-path="
127 (assoc-ref %build-inputs "nss-certs")
131 (string-append "drillbindir="
132 (assoc-ref %outputs "drill")
134 (string-append "drillmandir="
135 (assoc-ref %outputs "drill")
137 (string-append "examplesbindir="
138 (assoc-ref %outputs "examples")
140 (string-append "examplesmandir="
141 (assoc-ref %outputs "examples")
143 (string-append "python_site="
144 (assoc-ref %outputs "pyldns")
146 ,(version-major+minor
147 (package-version python))
150 `(("doxygen" ,doxygen)
153 ("perl-devel-checklib" ,perl-devel-checklib)
154 ("pkg-config" ,pkg-config)
155 ("python" ,python-wrapper)
158 `(("libpcap" ,libpcap)
159 ("nss-certs" ,nss-certs)
160 ("openssl" ,openssl)))
161 (synopsis "DNS library that facilitates DNS tool programming")
162 (description "LDNS aims to simplify DNS programming, it supports recent
163 RFCs like the DNSSEC documents, and allows developers to easily create
164 software conforming to current RFCs, and experimental software for current
165 Internet Drafts. A secondary benefit of using ldns is speed; ldns is written in
166 C it should be a lot faster than Perl.")
167 (home-page "https://nlnetlabs.nl/projects/ldns/about/")
168 (license license:bsd-3)))
170 (define-public dnssec-trigger
172 (name "dnssec-trigger")
178 (string-append "https://www.nlnetlabs.nl/downloads/"
179 name "/" name "-" version ".tar.gz"))
181 (base32 "10928q406x9r66a090xl5kznzgyxpja88w4srwcv454hd351j9f0"))))
182 (build-system glib-or-gtk-build-system)
183 (outputs '("out" "gui" "nm"))
185 `(#:test-target "test"
188 (string-append "--with-ssl="
189 (assoc-ref %build-inputs "openssl"))
190 "--with-hooks=networkmanager"
191 (string-append "--with-networkmanager-dispatch="
192 (assoc-ref %outputs "nm")
193 "/etc/NetworkManager/dispatcher.d")
194 (string-append "--with-xdg-autostart="
195 (assoc-ref %outputs "gui")
196 "/etc/xdg/autostart")
197 (string-append "--with-uidir="
198 (assoc-ref %outputs "gui")
199 "/share/dnssec-trigger")
200 (string-append "--with-python="
201 (assoc-ref %build-inputs "python")
203 (string-append "--with-unbound-control="
204 (assoc-ref %build-inputs "unbound")
205 "/sbin/unbound-control")
206 "--with-forward-zones-support")
208 (modify-phases %standard-phases
209 (add-after 'unpack 'patch-configure
211 (substitute* "configure"
212 (("appindicator-0.1")
213 "appindicator3-0.1"))
215 (add-before 'configure 'patch-makefile
217 (substitute* "Makefile.in"
222 ((".*gtk-update-icon-cache.*")
225 (add-after 'install 'remove-systemd
226 (lambda* (#:key outputs #:allow-other-keys)
227 (let* ((out (assoc-ref outputs "out")))
228 (delete-file-recursively
229 (string-append out "/lib/systemd"))
231 (add-after 'remove-systemd 'move-gui
232 (lambda* (#:key outputs #:allow-other-keys)
233 (let* ((out (assoc-ref outputs "out"))
234 (gui (assoc-ref outputs "gui")))
235 (mkdir-p (string-append gui "/bin"))
236 (mkdir-p (string-append gui "/share"))
238 (string-append out "/bin")
239 (string-append gui "/bin"))
241 (string-append out "/share/icons")
242 (string-append gui "/share/icons"))
244 (add-after 'move-gui 'move-nm
245 (lambda* (#:key outputs #:allow-other-keys)
246 (let* ((out (assoc-ref outputs "out"))
247 (nm (assoc-ref outputs "nm")))
248 (mkdir-p (string-append nm "/libexec"))
250 (string-append out "/libexec")
251 (string-append nm "/libexec"))
255 ("pkg-config" ,pkg-config)
256 ("python" ,python-wrapper)))
260 ("libappindicator" ,libappindicator)
262 ("unbound" ,unbound)))
263 (synopsis "DNSSEC protection for the DNS traffic")
264 (description "DNSSEC-Trigger enables your computer to use DNSSEC protection
265 for the DNS traffic. It relies on the Unbound DNS resolver running locally on
266 your system, which performs DNSSEC validation. It reconfigures Unbound in such
267 a way that it will signal it to to use the DHCP obtained forwarders if possible,
268 fallback to doing its own AUTH queries if that fails, and if that fails it will
269 prompt the user with the option to go with insecure DNS only.")
270 (home-page "https://www.nlnetlabs.nl/projects/dnssec-trigger/about/")
271 (license license:bsd-3)))
273 (define-public dnsmasq
280 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
284 "0cn1xd1s6xs78jmrmwjnh9m6w3q38pk6dyqy2phvasqiyd33cll4"))))
285 (build-system gnu-build-system)
287 `(("pkg-config" ,pkg-config)))
292 (modify-phases %standard-phases (delete 'configure))
293 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
295 "COPTS=\"-DHAVE_DBUS\"")
296 #:tests? #f)) ; no ‘check’ target
297 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
298 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
300 "Dnsmasq is a light-weight DNS forwarder and DHCP server. It is designed
301 to provide DNS and, optionally, DHCP to a small network. It can serve the
302 names of local machines which are not in the global DNS. The DHCP server
303 integrates with the DNS server and allows machines with DHCP-allocated
304 addresses to appear in the DNS with names configured either on each host or in
305 a central configuration file. Dnsmasq supports static and dynamic DHCP leases
306 and BOOTP/TFTP for network booting of diskless machines.")
307 ;; Source files only say GPL2 and GPL3 are allowed.
308 (license (list license:gpl2 license:gpl3))))
310 ;; 'bind' is the name of a built-in Guile procedure, which is why we choose a
311 ;; different name here.
312 (define-public isc-bind
315 ;; When updating, check whether isc-dhcp's bundled copy should be as well.
320 "https://ftp.isc.org/isc/bind9/" version
321 "/bind-" version ".tar.xz"))
324 "1l8lhgnkj3fnl1101bs3pzj5gv2x5m9ahvrbyscsc9mxxc91hzcz"))))
325 (build-system gnu-build-system)
326 (outputs `("out" "utils"))
328 ;; It would be nice to add GeoIP and gssapi once there are packages.
335 ("python-ply" ,python-ply)))
338 ("pkg-config" ,pkg-config)))
341 (list (string-append "--with-pkcs11="
342 (assoc-ref %build-inputs "p11-kit")))
344 (modify-phases %standard-phases
345 (add-after 'strip 'move-to-utils
349 (let ((target (string-append (assoc-ref %outputs "utils") file))
350 (src (string-append (assoc-ref %outputs "out") file)))
351 (mkdir-p (dirname target))
354 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
355 "/share/man/man1/dig.1"
356 "/share/man/man1/host.1"
357 "/share/man/man1/nslookup.1"
358 "/share/man/man1/nsupdate.1"))
360 ;; When and if guix provides user namespaces for the build process,
361 ;; then the following can be uncommented and the subsequent "force-test"
362 ;; will not be necessary.
364 ;; (add-before 'check 'set-up-loopback
366 ;; (system "bin/tests/system/ifconfig.sh up")))
369 ;; XXX Even ‘make force-test’ tries to create network interfaces
370 ;; and fails. The only working target is the (trivial) fuzz test.
371 (with-directory-excursion "fuzz"
372 (invoke "make" "check"))
374 (synopsis "Domain Name System (DNS) implementation")
375 (description "BIND is an implementation of the @dfn{Domain Name System}
376 (DNS) protocols for the Internet. It is a reference implementation of those
377 protocols, but it is also production-grade software, suitable for use in
378 high-volume and high-reliability applications. The name BIND stands for
379 \"Berkeley Internet Name Domain\", because the software originated in the
380 early 1980s at the University of California at Berkeley. The @code{utils}
381 output of this package contains the following DNS name servers related command
385 DNS lookup and validation utility
391 Internet name servers interactive query utility
393 Dynamic DNS update utility
395 (home-page "https://www.isc.org/bind/")
396 (license (list license:mpl2.0))))
398 (define-public dnscrypt-proxy
400 (name "dnscrypt-proxy")
405 "https://download.dnscrypt.org/dnscrypt-proxy/"
406 "dnscrypt-proxy-" version ".tar.bz2"))
409 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
410 (modules '((guix build utils)))
412 ;; Delete bundled libltdl. XXX: This package also bundles
413 ;; a modified libevent that cannot currently be removed.
415 (delete-file-recursively "libltdl")
417 (build-system gnu-build-system)
420 (modify-phases %standard-phases
421 (add-after 'unpack 'autoreconf
423 ;; Re-generate build files due to unbundling ltdl.
424 ;; TODO: Prevent generating new libltdl and building it.
425 ;; The system version is still favored and referenced.
426 (invoke "autoreconf" "-vif"))))))
428 `(("pkg-config" ,pkg-config)
429 ("automake" ,automake)
430 ("autoconf" ,autoconf)
431 ("libtool" ,libtool)))
433 `(("libltdl" ,libltdl)
434 ("libsodium" ,libsodium)))
435 (home-page "https://www.dnscrypt.org/")
436 (synopsis "Securely send DNS requests to a remote server")
438 "@command{dnscrypt-proxy} is a tool for securing communications
439 between a client and a DNS resolver. It verifies that responses you get
440 from a DNS provider was actually sent by that provider, and haven't been
441 tampered with. For optimal performance it is recommended to use this as
442 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
443 can also be used as a normal DNS \"server\". A list of public dnscrypt
444 servers is included, and an up-to-date version is available at
445 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
446 (license (list license:isc
447 ;; Libevent and src/ext/queue.h is 3-clause BSD.
450 (define-public dnscrypt-wrapper
452 (name "dnscrypt-wrapper")
457 "https://github.com/cofyc/dnscrypt-wrapper/releases"
458 "/download/v" version "/" name "-v" version ".tar.bz2"))
461 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
462 (build-system gnu-build-system)
464 `(#:make-flags '("CC=gcc")
465 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
468 (modify-phases %standard-phases
469 (add-after 'unpack 'create-configure
471 (invoke "make" "configure"))))))
473 `(("autoconf" ,autoconf)))
475 `(("libevent" ,libevent)
476 ("libsodium" ,libsodium)))
477 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
478 (synopsis "Server-side dnscrypt proxy")
480 "@command{dnscrypt-wrapper} is a tool to expose a name server over
481 the @code{dnscrypt} protocol. It can be used as an endpoint for the
482 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
484 (license (list license:isc
485 ;; Bundled argparse is MIT. TODO: package and unbundle.
487 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
491 (define-public libasr
498 (uri (string-append "https://www.opensmtpd.org/archives/"
499 "libasr-" version ".tar.gz"))
501 (base32 "1d6s8njqhvayx2gp47409sp1fn8m608ws26hr1srfp6i23nnpyqr"))))
502 (build-system gnu-build-system)
505 (modify-phases %standard-phases
506 (add-after 'install 'install-documentation
507 (lambda* (#:key outputs #:allow-other-keys)
508 (let ((out (assoc-ref outputs "out")))
509 (install-file "src/asr_run.3"
510 (string-append out "/share/man/man3"))
513 `(("autoconf" ,autoconf)
514 ("automake" ,automake)
516 ("pkg-config" ,pkg-config)))
517 (home-page "https://www.opensmtpd.org")
518 (synopsis "Asynchronous resolver library by the OpenBSD project")
520 "libasr is a free, simple and portable asynchronous resolver library.
521 It runs DNS queries and performs hostname resolution in a fully
522 asynchronous fashion.")
523 (license (list license:isc
524 license:bsd-2 ; last part of getrrsetbyname_async.c
526 (license:non-copyleft "file://LICENSE") ; includes.h
536 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
539 (base32 "0ac3mbn5z4nc18782m9aswdpi2m9f4665vidw0ciyigdh0pywp2v"))))
540 (build-system gnu-build-system)
543 (list "--enable-pie" ; fully benefit from ASLR
546 "--enable-relro-now" ; protect GOT and .dtor areas
547 "--disable-radix-tree"
548 (string-append "--with-libevent="
549 (assoc-ref %build-inputs "libevent"))
550 (string-append "--with-ssl="
551 (assoc-ref %build-inputs "openssl"))
552 "--with-configdir=/etc"
553 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
554 "--with-logfile=/var/log/nsd.log"
555 "--with-pidfile=/var/db/nsd/nsd.pid"
556 "--with-dbfile=/var/db/nsd/nsd.db"
557 "--with-zonesdir=/etc/nsd"
558 "--with-xfrdfile=/var/db/nsd/xfrd.state"
559 "--with-zonelistfile=/var/db/nsd/zone.list")
561 (modify-phases %standard-phases
562 (add-before 'configure 'patch-installation-paths
563 (lambda* (#:key outputs #:allow-other-keys)
564 (let* ((out (assoc-ref outputs "out"))
565 (doc (string-append out "/share/doc/" ,name "-" ,version)))
566 ;; The ‘make install’ target tries to create the parent
567 ;; directories of run-time things like ‘pidfile’ above, and
568 ;; useless empty directories like 'configdir'. Remove such
569 ;; '$(INSTALL)' lines and install the example configuration file
570 ;; in an appropriate location.
571 (substitute* "Makefile.in"
572 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
573 (string-append "#" command))
574 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
575 (string-append doc "/examples/" file-name)))
577 #:tests? #f)) ; no tests
579 `(("libevent" ,libevent)
580 ("openssl" ,openssl)))
581 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
582 (synopsis "Authoritative DNS name server")
583 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
584 name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
585 RFC-compliant nameserver.
587 NSD uses zone information compiled via @command{zonec} into a binary database
588 file (@file{nsd.db}). This allows fast startup of the name service daemon and
589 allows syntax-structural errors in zone files to be flagged at compile time,
590 before being made available to NSD service itself. However, most traditional
591 BIND-style zone files can be directly imported into NSD without modification.
593 The collection of programs and processes that make up NSD are designed so that
594 the daemon itself runs as a non-privileged user and can be easily configured to
595 run in a @code{chroot} jail, thus making any security flaws in NSD less likely
596 to result in system-wide compromise.")
597 (license (list license:bsd-3))))
599 (define-public unbound
606 (uri (string-append "https://www.unbound.net/downloads/unbound-"
609 (base32 "0dnmh9jjh2v274f0hl31bgv40pl77mmfgky8bkqr5kvi3b17fdmp"))))
610 (build-system gnu-build-system)
611 (outputs '("out" "python"))
617 ("libevent" ,libevent)
618 ("protobuf" ,protobuf)
619 ("python-wrapper" ,python-wrapper)
620 ("openssl" ,openssl)))
623 (list "--disable-static" ; save space and non-determinism in libunbound.a
625 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
627 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
629 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
630 "--with-pythonmodule" "--with-pyunbound")
632 (modify-phases %standard-phases
633 (add-after 'configure 'fix-python-site-package-path
634 ;; Move python modules into their own output.
635 (lambda* (#:key outputs #:allow-other-keys)
636 (let ((pyout (assoc-ref outputs "python"))
637 (ver ,(version-major+minor (package-version python))))
638 (substitute* "Makefile"
639 (("^PYTHON_SITE_PKG=.*$")
642 pyout "/lib/python-" ver "/site-packages\n"))))
644 (add-before 'check 'fix-missing-nss-for-tests
645 ;; Unfortunately, the package's unittests involve some checks
646 ;; looking up protocols and services which are not provided
647 ;; by the minimalistic build environment, in particular,
648 ;; /etc/protocols and /etc/services are missing.
649 ;; Also, after plain substitution of protocol and service names
650 ;; in the test data, the tests still fail because the
651 ;; corresponding Resource Records have been signed by
653 ;; The following LD_PRELOAD library overwrites the glibc
654 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
655 ;; ‘getservbyport’ providing the few records required for the
656 ;; unit tests to pass.
657 (lambda* (#:key inputs outputs #:allow-other-keys)
658 (let* ((source (assoc-ref %build-inputs "source"))
659 (gcc (assoc-ref %build-inputs "gcc")))
660 (call-with-output-file "/tmp/nss_preload.c"
662 (display "#include <stdlib.h>
668 struct protoent *getprotobyname(const char *name) {
669 struct protoent *p = malloc(sizeof(struct protoent));
670 p->p_aliases = malloc(sizeof(char*));
671 if (strcasecmp(name, \"tcp\") == 0) {
674 p->p_aliases[0] = \"TCP\";
675 } else if (strcasecmp(name, \"udp\") == 0) {
678 p->p_aliases[0] = \"UDP\";
684 struct protoent *getprotobynumber(int proto) {
685 struct protoent *p = malloc(sizeof(struct protoent));
686 p->p_aliases = malloc(sizeof(char*));
691 p->p_aliases[0] = \"TCP\";
696 p->p_aliases[0] = \"UDP\";
705 struct servent *getservbyname(const char *name, const char *proto) {
706 struct servent *s = malloc(sizeof(struct servent));
707 char* buf = malloc((strlen(proto)+1)*sizeof(char));
709 s->s_aliases = malloc(sizeof(char*));
710 s->s_aliases[0] = NULL;
711 if (strcasecmp(name, \"domain\") == 0) {
712 s->s_name = \"domain\";
713 s->s_port = htons(53);
720 struct servent *getservbyport(int port, const char *proto) {
722 struct servent *s = malloc(sizeof(struct servent));
724 s->s_aliases = malloc(sizeof(char*));
725 s->s_aliases[0] = NULL;
728 s->s_name = \"domain\";
730 s->s_proto = \"udp\";
738 (invoke (string-append gcc "/bin/gcc")
739 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
740 "/tmp/nss_preload.c")
741 ;; The preload library only affects the unittests.
742 (substitute* "Makefile"
744 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
746 (home-page "https://www.unbound.net")
747 (synopsis "Validating, recursive, and caching DNS resolver")
749 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
750 validation of results. It implements only a minimal amount of authoritative
751 service to prevent leakage to the root nameservers: forward lookups for
752 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
753 served by AS112. Stub and forward zones are supported.")
754 (license license:bsd-4)))
756 (define-public yadifa
761 (let ((build "8497"))
765 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
766 "yadifa-" version "-" build ".tar.gz"))
768 (base32 "0xvyr91sfgzkpw6g3h893ldbwnki3w2472n56rr18w67qghs1sa5")))))
769 (build-system gnu-build-system)
773 `(("openssl" ,openssl)))
776 (modify-phases %standard-phases
777 (add-before 'configure 'omit-example-configurations
779 (substitute* "Makefile.in"
783 (list "--sysconfdir=/etc"
784 "--localstatedir=/var"
785 "--disable-build-timestamp" ; build reproducibly
790 "--enable-ctrl" ; enable remote control
794 (home-page "https://www.yadifa.eu/")
795 (synopsis "Authoritative DNS name server")
796 (description "YADIFA is an authoritative name server for the @dfn{Domain
797 Name System} (DNS). It aims for both higher performance and a smaller memory
798 footprint than other implementations, while remaining fully RFC-compliant.
799 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
800 Extensions} (DNSSEC).")
801 (license license:bsd-3)))
810 (uri (string-append "https://secure.nic.cz/files/knot-dns/"
811 "knot-" version ".tar.xz"))
813 (base32 "1rxjjisr6rz1wa4279ghvj5zzhgyjhncmb9dkzqm8nw2qs1jhx5z"))
814 (modules '((guix build utils)))
817 ;; Delete bundled libraries.
818 (with-directory-excursion "src/contrib"
819 (delete-file-recursively "lmdb"))
821 (build-system gnu-build-system)
823 `(("pkg-config" ,pkg-config)))
828 ("libcap-ng" ,libcap-ng)
834 ("protobuf-c" ,protobuf-c)))
837 (modify-phases %standard-phases
838 (add-before 'configure 'disable-directory-pre-creation
840 ;; Don't install empty directories like ‘/etc’ outside the store.
841 ;; This is needed even when using ‘make config_dir=... install’.
842 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
845 (lambda* (#:key outputs #:allow-other-keys)
846 (let* ((out (assoc-ref outputs "out"))
847 (doc (string-append out "/share/doc/" ,name "-" ,version))
848 (etc (string-append doc "/examples/etc")))
850 (string-append "config_dir=" etc)
853 (list "--sysconfdir=/etc"
854 "--localstatedir=/var"
855 "--enable-dnstap" ; let tools read/write capture files
856 "--with-module-dnstap=yes" ; detailed query capturing & logging
857 (string-append "--with-bash-completions="
858 (assoc-ref %outputs "out")
859 "/etc/bash_completion.d"))))
860 (home-page "https://www.knot-dns.cz/")
861 (synopsis "Authoritative DNS name server")
862 (description "Knot DNS is an authoritative name server for the @dfn{Domain
863 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
864 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
865 number of programming techniques to improve speed. For example, the responder
866 is completely lock-free, resulting in a very high response rate. Other features
867 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
868 synthesis, and on-the-fly re-configuration.")
871 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
872 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
874 license:lgpl2.0+ ; parts of scr/contrib/ucw
875 license:public-domain ; src/contrib/fnv and possibly murmurhash3
876 license:gpl3+)))) ; everything else
878 (define-public knot-resolver
880 (name "knot-resolver")
884 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
885 "knot-resolver-" version ".tar.xz"))
888 "09ffmqx79lv5psr433x4n946njgsn071b9b7161pcb9bmrqz380c"))))
889 (build-system meson-build-system)
891 '(#:configure-flags '("-Ddoc=enabled")
893 (modify-phases %standard-phases
894 (add-before 'configure 'disable-default-ta
896 ;; Disable the default managed root TA, since we don't have
897 ;; write access to the keyfile and its directory in store.
898 (substitute* "daemon/lua/sandbox.lua.in"
899 (("^trust_anchors\\.add_file.*") ""))
901 (add-after 'build 'build-doc
903 (invoke "ninja" "doc")))
904 (add-after 'install 'wrap-binary
905 (lambda* (#:key inputs outputs #:allow-other-keys)
906 (let* ((out (assoc-ref outputs "out"))
907 (lua-* (map cdr (filter
909 (string-prefix? "lua-" (car input)))
911 (lua-path (lambda (p)
912 (string-append p "/share/lua/5.1/?.lua")))
913 (lua-cpath (lambda (p)
914 (string-append p "/lib/lua/5.1/?.so"))))
915 (wrap-program (string-append out "/sbin/kresd")
916 `("LUA_PATH" ";" prefix ,(map lua-path lua-*))
917 `("LUA_CPATH" ";" prefix ,(map lua-cpath lua-*)))
920 `(("cmocka" ,cmocka) ; for unit tests
922 ("protobuf-c" ,protobuf-c)
923 ("pkg-config" ,pkg-config)
924 ("python-breathe" ,python-breathe)
925 ("python-sphinx" ,python-sphinx)
926 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
934 ;; TODO: Add optional lua modules: basexx and psl.
935 ("lua-bitop" ,lua5.1-bitop)
936 ("lua-cqueues" ,lua5.1-cqueues)
937 ("lua-filesystem" ,lua5.1-filesystem)
938 ("lua-sec" ,lua5.1-sec)
939 ("lua-socket" ,lua5.1-socket)))
940 (home-page "https://www.knot-resolver.cz/")
941 (synopsis "Caching validating DNS resolver")
943 "Knot Resolver is a caching full resolver implementation written in C and
944 LuaJIT, both a resolver library and a daemon.")
945 (license (list license:gpl3+
946 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
951 (define-public ddclient
959 (url "https://github.com/ddclient/ddclient")
960 (commit (string-append "v" version))))
961 (file-name (git-file-name name version))
963 (base32 "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w"))))
964 (build-system trivial-build-system) ; no Makefile.PL
969 `(("inetutils" ,inetutils) ; logger
970 ("net-tools" ,net-tools)
971 ("perl-data-validate-ip" ,perl-data-validate-ip)
972 ("perl-digest-sha1" ,perl-digest-sha1)
973 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
975 `(#:modules ((guix build utils)
980 (use-modules (guix build utils)
983 (setenv "PATH" (string-append
984 (assoc-ref %build-inputs "bash") "/bin" ":"
985 (assoc-ref %build-inputs "perl") "/bin"))
987 ;; Copy the (read-only) source into the (writable) build directory.
988 (copy-recursively (assoc-ref %build-inputs "source") ".")
991 (let* ((out (assoc-ref %outputs "out"))
992 (bin (string-append out "/bin")))
993 (let ((file "ddclient"))
995 (("/usr/bin/perl") (which "perl"))
996 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
997 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
998 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
999 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
1000 (("\\$cachedir\\$program\\.cache")
1001 "/var/cache/ddclient/ddclient.cache"))
1002 (install-file file bin)
1003 (wrap-program (string-append bin "/" file)
1006 ,@(map (lambda (input)
1009 (string-append store "/bin"))))
1015 (((? (cut string-prefix? "perl-" <>) name) . dir)
1016 (string-append dir "/lib/perl5/site_perl"))
1019 (for-each (cut install-file <> (string-append out
1021 (find-files "." "sample.*$"))))))
1022 (home-page "https://ddclient.net/")
1023 (synopsis "Address updating utility for dynamic DNS services")
1024 (description "This package provides a client to update dynamic IP
1025 addresses with several dynamic DNS service providers, such as
1026 @uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
1028 This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
1029 access a machine with a dynamic IP address.
1031 The client supports both dynamic and (near) static services, as well as MX
1032 record and alternative name management. It caches the address, and only
1033 attempts the update when it has changed.")
1034 (license license:gpl2+)))
1037 ;; There have been no releases yet, hence this commit.
1038 (let ((revision "0")
1039 (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
1042 (version (git-version "0.0" revision commit))
1046 (url "https://github.com/handshake-org/hnsd")
1050 "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
1051 (file-name (git-file-name name version))
1052 (modules '((guix build utils)))
1055 ;; Delete the bundled copy of libuv.
1056 (delete-file-recursively "uv")
1057 (substitute* "configure.ac"
1058 (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
1059 (substitute* "Makefile.am"
1060 (("SUBDIRS = uv") "\n")
1061 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
1063 ;; Make sure the 'hnsd' binary is installed and
1064 ;; dynamically-linked.
1065 (("noinst_PROGRAMS") "bin_PROGRAMS")
1066 (("hnsd_LDFLAGS = -static") ""))
1068 ;; This script tries to chdir to "uv" and doesn't do more
1069 ;; than "autoreconf" so remove it.
1070 (delete-file "autogen.sh")
1072 (build-system gnu-build-system)
1074 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
1076 `(("autoconf" ,autoconf)
1077 ("automake" ,automake)
1078 ("libtool" ,libtool)))
1080 `(("unbound" ,unbound)
1082 (home-page "https://www.handshake.org/")
1083 (synopsis "Resolver daemon for the Handshake naming protocol")
1085 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
1086 System (HNS) peer-to-peer network.")
1087 (license license:expat))))
1089 (define-public libmicrodns
1091 (name "libmicrodns")
1095 (uri (string-append "https://github.com/videolabs/libmicrodns/"
1096 "releases/download/" version "/microdns-"
1100 "0p4va18zxgmzcdwhlbg2mmjwswlbgqy4ay5vaxrw7cxmhsflnv36"))))
1101 (build-system meson-build-system)
1102 (home-page "https://github.com/videolabs/libmicrodns")
1103 (synopsis "Minimal mDNS resolver library")
1104 (description "@code{libmicrodns} provides a minimal implementation of a
1105 mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
1106 a zero-config service that allows one to resolve host names to IP addresses in
1108 (license license:lgpl2.1)))
1110 (define-public public-suffix-list
1111 ;; Mozilla releases the official list here:
1113 ;; https://publicsuffix.org/list/public_suffix_list.dat
1115 ;; However, Mozilla syncs that file from the GitHub repository periodically,
1116 ;; so its contents will change over time. If you update this commit, please
1117 ;; make sure that the new commit refers to a list which is identical to the
1118 ;; officially published list available from the URL above.
1119 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
1121 (name "public-suffix-list")
1122 (version (git-version "0" "1" commit))
1126 (url "https://github.com/publicsuffix/list")
1128 (file-name (git-file-name name version))
1131 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
1132 (build-system trivial-build-system)
1134 `(#:modules ((guix build utils))
1137 (use-modules (guix build utils))
1138 (let* ((out (assoc-ref %outputs "out"))
1139 ;; Install to /share because that is where "read-only
1140 ;; architecture-independent data files" should go (see:
1141 ;; (standards) Directory Variables). Include the version in
1142 ;; the directory name so that if multiple versions are ever
1143 ;; installed in the same profile, they will not conflict.
1144 (destination (string-append
1145 out "/share/public-suffix-list-" ,version))
1146 (source (assoc-ref %build-inputs "source")))
1147 (with-directory-excursion source
1148 (install-file "public_suffix_list.dat" destination)
1149 (install-file "LICENSE" destination))
1151 (home-page "https://publicsuffix.org/")
1152 (synopsis "Database of current and historical DNS suffixes")
1153 (description "This is the Public Suffix List maintained by Mozilla. A
1154 \"public suffix\" is one under which Internet users can (or historically
1155 could) directly register names in the Domain Name System (DNS). Some examples
1156 of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
1157 known public suffixes.")
1158 (license license:mpl2.0))))
1160 (define-public maradns
1163 (version "3.5.0007")
1167 (uri (string-append "https://maradns.samiam.org/download/"
1168 (version-major+minor version) "/"
1169 version "/maradns-" version ".tar.xz"))
1171 (base32 "0bc19xylg4whww9qaj5i4izwxcrh0c0ja7l1pfcn2la02hlvg1a6"))))
1172 (build-system gnu-build-system)
1174 `(#:tests? #f ; need to be root to run tests
1177 ,(string-append "CC=" (cc-for-target))
1178 (string-append "PREFIX=" %output)
1179 (string-append "RPM_BUILD_ROOT=" %output))
1181 (modify-phases %standard-phases
1183 (lambda* (#:key native-inputs target #:allow-other-keys)
1184 ;; make_32bit_tables generates a header file that is used during
1185 ;; compilation. Hence, during cross compilation, it should be
1186 ;; built for the host system.
1188 (substitute* "rng/Makefile"
1189 (("\\$\\(CC\\) -o make_32bit_tables")
1190 (string-append (assoc-ref native-inputs "gcc")
1191 "/bin/gcc -o make_32bit_tables"))))
1192 (invoke "./configure")))
1193 (add-before 'install 'create-install-directories
1194 (lambda* (#:key outputs #:allow-other-keys)
1195 (let ((out (assoc-ref outputs "out")))
1196 (for-each (lambda (dir)
1197 (mkdir-p (string-append out dir)))
1198 (list "/bin" "/sbin" "/etc"
1203 (home-page "https://maradns.samiam.org")
1204 (synopsis "Small lightweight DNS server")
1205 (description "MaraDNS is a small and lightweight DNS server. MaraDNS
1206 consists of a UDP-only authoritative DNS server for hosting domains, and a UDP
1207 and TCP-capable recursive DNS server for finding domains on the internet.")
1208 (license license:bsd-2)))
1210 (define-public openresolv
1216 (uri (string-append "https://roy.marples.name/downloads/openresolv/"
1217 "openresolv-" version ".tar.xz"))
1220 "01ms6c087la4hk0f0w6n2vpsb7dg4kklah2rqyhz88p0vr9bqy20"))
1222 (search-patches "openresolv-restartcmd-guix.patch"))))
1223 (build-system gnu-build-system)
1225 `(#:tests? #f ; No test suite
1227 (list (string-append "--sysconfdir=/etc"))
1229 (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))))
1230 (home-page "https://roy.marples.name/projects/openresolv/")
1231 (synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
1232 (description "openresolv is an implementation of @command{resolvconf}, the
1233 middleman between the network configuration services and
1234 @file{/etc/resolv.conf}. @command{resolvconf} itself is just a script that
1235 stores, removes and lists a full @file{resolv.conf} generated for the
1236 interface. It then calls all the helper scripts it knows about so it can
1237 configure the real @file{/etc/resolv.conf} and optionally any local
1238 nameservers other than libc.")
1239 (license license:bsd-2)))