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
319 "https://ftp.isc.org/isc/bind9/" version
320 "/bind-" version ".tar.xz"))
323 "1jvi6ms51vyrhpflx05xlb7gblyd59zsyj28b8s3pl3xnkrv0rxm"))))
324 (build-system gnu-build-system)
325 (outputs `("out" "utils"))
327 ;; It would be nice to add GeoIP and gssapi once there are packages.
334 ("python-ply" ,python-ply)))
337 ("pkg-config" ,pkg-config)))
340 (list (string-append "--with-pkcs11="
341 (assoc-ref %build-inputs "p11-kit")))
343 (modify-phases %standard-phases
344 (add-after 'strip 'move-to-utils
348 (let ((target (string-append (assoc-ref %outputs "utils") file))
349 (src (string-append (assoc-ref %outputs "out") file)))
350 (mkdir-p (dirname target))
353 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
354 "/share/man/man1/dig.1"
355 "/share/man/man1/host.1"
356 "/share/man/man1/nslookup.1"
357 "/share/man/man1/nsupdate.1"))
359 ;; When and if guix provides user namespaces for the build process,
360 ;; then the following can be uncommented and the subsequent "force-test"
361 ;; will not be necessary.
363 ;; (add-before 'check 'set-up-loopback
365 ;; (system "bin/tests/system/ifconfig.sh up")))
368 ;; XXX Even ‘make force-test’ tries to create network interfaces
369 ;; and fails. The only working target is the (trivial) fuzz test.
370 (with-directory-excursion "fuzz"
371 (invoke "make" "check"))
373 (synopsis "Domain Name System (DNS) implementation")
374 (description "BIND is an implementation of the @dfn{Domain Name System}
375 (DNS) protocols for the Internet. It is a reference implementation of those
376 protocols, but it is also production-grade software, suitable for use in
377 high-volume and high-reliability applications. The name BIND stands for
378 \"Berkeley Internet Name Domain\", because the software originated in the
379 early 1980s at the University of California at Berkeley. The @code{utils}
380 output of this package contains the following DNS name servers related command
384 DNS lookup and validation utility
390 Internet name servers interactive query utility
392 Dynamic DNS update utility
394 (home-page "https://www.isc.org/bind/")
395 (license (list license:mpl2.0))))
397 (define-public dnscrypt-proxy
399 (name "dnscrypt-proxy")
404 "https://download.dnscrypt.org/dnscrypt-proxy/"
405 "dnscrypt-proxy-" version ".tar.bz2"))
408 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
409 (modules '((guix build utils)))
411 ;; Delete bundled libltdl. XXX: This package also bundles
412 ;; a modified libevent that cannot currently be removed.
414 (delete-file-recursively "libltdl")
416 (build-system gnu-build-system)
419 (modify-phases %standard-phases
420 (add-after 'unpack 'autoreconf
422 ;; Re-generate build files due to unbundling ltdl.
423 ;; TODO: Prevent generating new libltdl and building it.
424 ;; The system version is still favored and referenced.
425 (invoke "autoreconf" "-vif"))))))
427 `(("pkg-config" ,pkg-config)
428 ("automake" ,automake)
429 ("autoconf" ,autoconf)
430 ("libtool" ,libtool)))
432 `(("libltdl" ,libltdl)
433 ("libsodium" ,libsodium)))
434 (home-page "https://www.dnscrypt.org/")
435 (synopsis "Securely send DNS requests to a remote server")
437 "@command{dnscrypt-proxy} is a tool for securing communications
438 between a client and a DNS resolver. It verifies that responses you get
439 from a DNS provider was actually sent by that provider, and haven't been
440 tampered with. For optimal performance it is recommended to use this as
441 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
442 can also be used as a normal DNS \"server\". A list of public dnscrypt
443 servers is included, and an up-to-date version is available at
444 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
445 (license (list license:isc
446 ;; Libevent and src/ext/queue.h is 3-clause BSD.
449 (define-public dnscrypt-wrapper
451 (name "dnscrypt-wrapper")
456 "https://github.com/cofyc/dnscrypt-wrapper/releases"
457 "/download/v" version "/" name "-v" version ".tar.bz2"))
460 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
461 (build-system gnu-build-system)
463 `(#:make-flags '("CC=gcc")
464 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
467 (modify-phases %standard-phases
468 (add-after 'unpack 'create-configure
470 (invoke "make" "configure"))))))
472 `(("autoconf" ,autoconf)))
474 `(("libevent" ,libevent)
475 ("libsodium" ,libsodium)))
476 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
477 (synopsis "Server-side dnscrypt proxy")
479 "@command{dnscrypt-wrapper} is a tool to expose a name server over
480 the @code{dnscrypt} protocol. It can be used as an endpoint for the
481 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
483 (license (list license:isc
484 ;; Bundled argparse is MIT. TODO: package and unbundle.
486 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
490 (define-public libasr
497 (uri (string-append "https://www.opensmtpd.org/archives/"
498 "libasr-" version ".tar.gz"))
500 (base32 "1d6s8njqhvayx2gp47409sp1fn8m608ws26hr1srfp6i23nnpyqr"))))
501 (build-system gnu-build-system)
504 (modify-phases %standard-phases
505 (add-after 'install 'install-documentation
506 (lambda* (#:key outputs #:allow-other-keys)
507 (let ((out (assoc-ref outputs "out")))
508 (install-file "src/asr_run.3"
509 (string-append out "/share/man/man3"))
512 `(("autoconf" ,autoconf)
513 ("automake" ,automake)
515 ("pkg-config" ,pkg-config)))
516 (home-page "https://www.opensmtpd.org")
517 (synopsis "Asynchronous resolver library by the OpenBSD project")
519 "libasr is a free, simple and portable asynchronous resolver library.
520 It runs DNS queries and performs hostname resolution in a fully
521 asynchronous fashion.")
522 (license (list license:isc
523 license:bsd-2 ; last part of getrrsetbyname_async.c
525 (license:non-copyleft "file://LICENSE") ; includes.h
535 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
538 (base32 "0ac3mbn5z4nc18782m9aswdpi2m9f4665vidw0ciyigdh0pywp2v"))))
539 (build-system gnu-build-system)
542 (list "--enable-pie" ; fully benefit from ASLR
545 "--enable-relro-now" ; protect GOT and .dtor areas
546 "--disable-radix-tree"
547 (string-append "--with-libevent="
548 (assoc-ref %build-inputs "libevent"))
549 (string-append "--with-ssl="
550 (assoc-ref %build-inputs "openssl"))
551 "--with-configdir=/etc"
552 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
553 "--with-logfile=/var/log/nsd.log"
554 "--with-pidfile=/var/db/nsd/nsd.pid"
555 "--with-dbfile=/var/db/nsd/nsd.db"
556 "--with-zonesdir=/etc/nsd"
557 "--with-xfrdfile=/var/db/nsd/xfrd.state"
558 "--with-zonelistfile=/var/db/nsd/zone.list")
560 (modify-phases %standard-phases
561 (add-before 'configure 'patch-installation-paths
562 (lambda* (#:key outputs #:allow-other-keys)
563 (let* ((out (assoc-ref outputs "out"))
564 (doc (string-append out "/share/doc/" ,name "-" ,version)))
565 ;; The ‘make install’ target tries to create the parent
566 ;; directories of run-time things like ‘pidfile’ above, and
567 ;; useless empty directories like 'configdir'. Remove such
568 ;; '$(INSTALL)' lines and install the example configuration file
569 ;; in an appropriate location.
570 (substitute* "Makefile.in"
571 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
572 (string-append "#" command))
573 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
574 (string-append doc "/examples/" file-name)))
576 #:tests? #f)) ; no tests
578 `(("libevent" ,libevent)
579 ("openssl" ,openssl)))
580 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
581 (synopsis "Authoritative DNS name server")
582 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
583 name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
584 RFC-compliant nameserver.
586 NSD uses zone information compiled via @command{zonec} into a binary database
587 file (@file{nsd.db}). This allows fast startup of the name service daemon and
588 allows syntax-structural errors in zone files to be flagged at compile time,
589 before being made available to NSD service itself. However, most traditional
590 BIND-style zone files can be directly imported into NSD without modification.
592 The collection of programs and processes that make up NSD are designed so that
593 the daemon itself runs as a non-privileged user and can be easily configured to
594 run in a @code{chroot} jail, thus making any security flaws in NSD less likely
595 to result in system-wide compromise.")
596 (license (list license:bsd-3))))
598 (define-public unbound
605 (uri (string-append "https://www.unbound.net/downloads/unbound-"
608 (base32 "0dnmh9jjh2v274f0hl31bgv40pl77mmfgky8bkqr5kvi3b17fdmp"))))
609 (build-system gnu-build-system)
610 (outputs '("out" "python"))
616 ("libevent" ,libevent)
617 ("protobuf" ,protobuf)
618 ("python-wrapper" ,python-wrapper)
619 ("openssl" ,openssl)))
622 (list "--disable-static" ; save space and non-determinism in libunbound.a
624 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
626 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
628 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
629 "--with-pythonmodule" "--with-pyunbound")
631 (modify-phases %standard-phases
632 (add-after 'configure 'fix-python-site-package-path
633 ;; Move python modules into their own output.
634 (lambda* (#:key outputs #:allow-other-keys)
635 (let ((pyout (assoc-ref outputs "python"))
636 (ver ,(version-major+minor (package-version python))))
637 (substitute* "Makefile"
638 (("^PYTHON_SITE_PKG=.*$")
641 pyout "/lib/python-" ver "/site-packages\n"))))
643 (add-before 'check 'fix-missing-nss-for-tests
644 ;; Unfortunately, the package's unittests involve some checks
645 ;; looking up protocols and services which are not provided
646 ;; by the minimalistic build environment, in particular,
647 ;; /etc/protocols and /etc/services are missing.
648 ;; Also, after plain substitution of protocol and service names
649 ;; in the test data, the tests still fail because the
650 ;; corresponding Resource Records have been signed by
652 ;; The following LD_PRELOAD library overwrites the glibc
653 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
654 ;; ‘getservbyport’ providing the few records required for the
655 ;; unit tests to pass.
656 (lambda* (#:key inputs outputs #:allow-other-keys)
657 (let* ((source (assoc-ref %build-inputs "source"))
658 (gcc (assoc-ref %build-inputs "gcc")))
659 (call-with-output-file "/tmp/nss_preload.c"
661 (display "#include <stdlib.h>
667 struct protoent *getprotobyname(const char *name) {
668 struct protoent *p = malloc(sizeof(struct protoent));
669 p->p_aliases = malloc(sizeof(char*));
670 if (strcasecmp(name, \"tcp\") == 0) {
673 p->p_aliases[0] = \"TCP\";
674 } else if (strcasecmp(name, \"udp\") == 0) {
677 p->p_aliases[0] = \"UDP\";
683 struct protoent *getprotobynumber(int proto) {
684 struct protoent *p = malloc(sizeof(struct protoent));
685 p->p_aliases = malloc(sizeof(char*));
690 p->p_aliases[0] = \"TCP\";
695 p->p_aliases[0] = \"UDP\";
704 struct servent *getservbyname(const char *name, const char *proto) {
705 struct servent *s = malloc(sizeof(struct servent));
706 char* buf = malloc((strlen(proto)+1)*sizeof(char));
708 s->s_aliases = malloc(sizeof(char*));
709 s->s_aliases[0] = NULL;
710 if (strcasecmp(name, \"domain\") == 0) {
711 s->s_name = \"domain\";
712 s->s_port = htons(53);
719 struct servent *getservbyport(int port, const char *proto) {
721 struct servent *s = malloc(sizeof(struct servent));
723 s->s_aliases = malloc(sizeof(char*));
724 s->s_aliases[0] = NULL;
727 s->s_name = \"domain\";
729 s->s_proto = \"udp\";
737 (invoke (string-append gcc "/bin/gcc")
738 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
739 "/tmp/nss_preload.c")
740 ;; The preload library only affects the unittests.
741 (substitute* "Makefile"
743 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
745 (home-page "https://www.unbound.net")
746 (synopsis "Validating, recursive, and caching DNS resolver")
748 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
749 validation of results. It implements only a minimal amount of authoritative
750 service to prevent leakage to the root nameservers: forward lookups for
751 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
752 served by AS112. Stub and forward zones are supported.")
753 (license license:bsd-4)))
755 (define-public yadifa
760 (let ((build "8497"))
764 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
765 "yadifa-" version "-" build ".tar.gz"))
767 (base32 "0xvyr91sfgzkpw6g3h893ldbwnki3w2472n56rr18w67qghs1sa5")))))
768 (build-system gnu-build-system)
772 `(("openssl" ,openssl)))
775 (modify-phases %standard-phases
776 (add-before 'configure 'omit-example-configurations
778 (substitute* "Makefile.in"
782 (list "--sysconfdir=/etc"
783 "--localstatedir=/var"
784 "--disable-build-timestamp" ; build reproducibly
789 "--enable-ctrl" ; enable remote control
793 (home-page "https://www.yadifa.eu/")
794 (synopsis "Authoritative DNS name server")
795 (description "YADIFA is an authoritative name server for the @dfn{Domain
796 Name System} (DNS). It aims for both higher performance and a smaller memory
797 footprint than other implementations, while remaining fully RFC-compliant.
798 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
799 Extensions} (DNSSEC).")
800 (license license:bsd-3)))
809 (uri (string-append "https://secure.nic.cz/files/knot-dns/"
810 "knot-" version ".tar.xz"))
812 (base32 "0xmzmhd2m9rb24clrrd9k058harsq67nyjplpbyxvy1g46xah28i"))
813 (modules '((guix build utils)))
816 ;; Delete bundled libraries.
817 (with-directory-excursion "src/contrib"
818 (delete-file-recursively "lmdb"))
820 (build-system gnu-build-system)
822 `(("pkg-config" ,pkg-config)))
827 ("libcap-ng" ,libcap-ng)
833 ("protobuf-c" ,protobuf-c)))
836 (modify-phases %standard-phases
837 (add-before 'configure 'disable-directory-pre-creation
839 ;; Don't install empty directories like ‘/etc’ outside the store.
840 ;; This is needed even when using ‘make config_dir=... install’.
841 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
844 (lambda* (#:key outputs #:allow-other-keys)
845 (let* ((out (assoc-ref outputs "out"))
846 (doc (string-append out "/share/doc/" ,name "-" ,version))
847 (etc (string-append doc "/examples/etc")))
849 (string-append "config_dir=" etc)
852 (list "--sysconfdir=/etc"
853 "--localstatedir=/var"
854 "--enable-dnstap" ; let tools read/write capture files
855 "--with-module-dnstap=yes" ; detailed query capturing & logging
856 (string-append "--with-bash-completions="
857 (assoc-ref %outputs "out")
858 "/etc/bash_completion.d"))))
859 (home-page "https://www.knot-dns.cz/")
860 (synopsis "Authoritative DNS name server")
861 (description "Knot DNS is an authoritative name server for the @dfn{Domain
862 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
863 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
864 number of programming techniques to improve speed. For example, the responder
865 is completely lock-free, resulting in a very high response rate. Other features
866 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
867 synthesis, and on-the-fly re-configuration.")
870 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
871 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
873 license:lgpl2.0+ ; parts of scr/contrib/ucw
874 license:public-domain ; src/contrib/fnv and possibly murmurhash3
875 license:gpl3+)))) ; everything else
877 (define-public knot-resolver
879 (name "knot-resolver")
883 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
884 "knot-resolver-" version ".tar.xz"))
887 "09ffmqx79lv5psr433x4n946njgsn071b9b7161pcb9bmrqz380c"))))
888 (build-system meson-build-system)
890 '(#:configure-flags '("-Ddoc=enabled")
892 (modify-phases %standard-phases
893 (add-before 'configure 'disable-default-ta
895 ;; Disable the default managed root TA, since we don't have
896 ;; write access to the keyfile and its directory in store.
897 (substitute* "daemon/lua/sandbox.lua.in"
898 (("^trust_anchors\\.add_file.*") ""))
900 (add-after 'build 'build-doc
902 (invoke "ninja" "doc")))
903 (add-after 'install 'wrap-binary
904 (lambda* (#:key inputs outputs #:allow-other-keys)
905 (let* ((out (assoc-ref outputs "out"))
906 (lua-* (map cdr (filter
908 (string-prefix? "lua-" (car input)))
910 (lua-path (lambda (p)
911 (string-append p "/share/lua/5.1/?.lua")))
912 (lua-cpath (lambda (p)
913 (string-append p "/lib/lua/5.1/?.so"))))
914 (wrap-program (string-append out "/sbin/kresd")
915 `("LUA_PATH" ";" prefix ,(map lua-path lua-*))
916 `("LUA_CPATH" ";" prefix ,(map lua-cpath lua-*)))
919 `(("cmocka" ,cmocka) ; for unit tests
921 ("protobuf-c" ,protobuf-c)
922 ("pkg-config" ,pkg-config)
923 ("python-breathe" ,python-breathe)
924 ("python-sphinx" ,python-sphinx)
925 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
933 ;; TODO: Add optional lua modules: basexx and psl.
934 ("lua-bitop" ,lua5.1-bitop)
935 ("lua-cqueues" ,lua5.1-cqueues)
936 ("lua-filesystem" ,lua5.1-filesystem)
937 ("lua-sec" ,lua5.1-sec)
938 ("lua-socket" ,lua5.1-socket)))
939 (home-page "https://www.knot-resolver.cz/")
940 (synopsis "Caching validating DNS resolver")
942 "Knot Resolver is a caching full resolver implementation written in C and
943 LuaJIT, both a resolver library and a daemon.")
944 (license (list license:gpl3+
945 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
950 (define-public ddclient
958 (url "https://github.com/ddclient/ddclient")
959 (commit (string-append "v" version))))
960 (file-name (git-file-name name version))
962 (base32 "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w"))))
963 (build-system trivial-build-system) ; no Makefile.PL
968 `(("inetutils" ,inetutils) ; logger
969 ("net-tools" ,net-tools)
970 ("perl-data-validate-ip" ,perl-data-validate-ip)
971 ("perl-digest-sha1" ,perl-digest-sha1)
972 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
974 `(#:modules ((guix build utils)
979 (use-modules (guix build utils)
982 (setenv "PATH" (string-append
983 (assoc-ref %build-inputs "bash") "/bin" ":"
984 (assoc-ref %build-inputs "perl") "/bin"))
986 ;; Copy the (read-only) source into the (writable) build directory.
987 (copy-recursively (assoc-ref %build-inputs "source") ".")
990 (let* ((out (assoc-ref %outputs "out"))
991 (bin (string-append out "/bin")))
992 (let ((file "ddclient"))
994 (("/usr/bin/perl") (which "perl"))
995 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
996 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
997 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
998 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
999 (("\\$cachedir\\$program\\.cache")
1000 "/var/cache/ddclient/ddclient.cache"))
1001 (install-file file bin)
1002 (wrap-program (string-append bin "/" file)
1005 ,@(map (lambda (input)
1008 (string-append store "/bin"))))
1014 (((? (cut string-prefix? "perl-" <>) name) . dir)
1015 (string-append dir "/lib/perl5/site_perl"))
1018 (for-each (cut install-file <> (string-append out
1020 (find-files "." "sample.*$"))))))
1021 (home-page "https://ddclient.net/")
1022 (synopsis "Address updating utility for dynamic DNS services")
1023 (description "This package provides a client to update dynamic IP
1024 addresses with several dynamic DNS service providers, such as
1025 @uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
1027 This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
1028 access a machine with a dynamic IP address.
1030 The client supports both dynamic and (near) static services, as well as MX
1031 record and alternative name management. It caches the address, and only
1032 attempts the update when it has changed.")
1033 (license license:gpl2+)))
1036 ;; There have been no releases yet, hence this commit.
1037 (let ((revision "0")
1038 (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
1041 (version (git-version "0.0" revision commit))
1045 (url "https://github.com/handshake-org/hnsd")
1049 "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
1050 (file-name (git-file-name name version))
1051 (modules '((guix build utils)))
1054 ;; Delete the bundled copy of libuv.
1055 (delete-file-recursively "uv")
1056 (substitute* "configure.ac"
1057 (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
1058 (substitute* "Makefile.am"
1059 (("SUBDIRS = uv") "\n")
1060 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
1062 ;; Make sure the 'hnsd' binary is installed and
1063 ;; dynamically-linked.
1064 (("noinst_PROGRAMS") "bin_PROGRAMS")
1065 (("hnsd_LDFLAGS = -static") ""))
1067 ;; This script tries to chdir to "uv" and doesn't do more
1068 ;; than "autoreconf" so remove it.
1069 (delete-file "autogen.sh")
1071 (build-system gnu-build-system)
1073 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
1075 `(("autoconf" ,autoconf)
1076 ("automake" ,automake)
1077 ("libtool" ,libtool)))
1079 `(("unbound" ,unbound)
1081 (home-page "https://www.handshake.org/")
1082 (synopsis "Resolver daemon for the Handshake naming protocol")
1084 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
1085 System (HNS) peer-to-peer network.")
1086 (license license:expat))))
1088 (define-public libmicrodns
1090 (name "libmicrodns")
1094 (uri (string-append "https://github.com/videolabs/libmicrodns/"
1095 "releases/download/" version "/microdns-"
1099 "0p4va18zxgmzcdwhlbg2mmjwswlbgqy4ay5vaxrw7cxmhsflnv36"))))
1100 (build-system meson-build-system)
1101 (home-page "https://github.com/videolabs/libmicrodns")
1102 (synopsis "Minimal mDNS resolver library")
1103 (description "@code{libmicrodns} provides a minimal implementation of a
1104 mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
1105 a zero-config service that allows one to resolve host names to IP addresses in
1107 (license license:lgpl2.1)))
1109 (define-public public-suffix-list
1110 ;; Mozilla releases the official list here:
1112 ;; https://publicsuffix.org/list/public_suffix_list.dat
1114 ;; However, Mozilla syncs that file from the GitHub repository periodically,
1115 ;; so its contents will change over time. If you update this commit, please
1116 ;; make sure that the new commit refers to a list which is identical to the
1117 ;; officially published list available from the URL above.
1118 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
1120 (name "public-suffix-list")
1121 (version (git-version "0" "1" commit))
1125 (url "https://github.com/publicsuffix/list")
1127 (file-name (git-file-name name version))
1130 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
1131 (build-system trivial-build-system)
1133 `(#:modules ((guix build utils))
1136 (use-modules (guix build utils))
1137 (let* ((out (assoc-ref %outputs "out"))
1138 ;; Install to /share because that is where "read-only
1139 ;; architecture-independent data files" should go (see:
1140 ;; (standards) Directory Variables). Include the version in
1141 ;; the directory name so that if multiple versions are ever
1142 ;; installed in the same profile, they will not conflict.
1143 (destination (string-append
1144 out "/share/public-suffix-list-" ,version))
1145 (source (assoc-ref %build-inputs "source")))
1146 (with-directory-excursion source
1147 (install-file "public_suffix_list.dat" destination)
1148 (install-file "LICENSE" destination))
1150 (home-page "https://publicsuffix.org/")
1151 (synopsis "Database of current and historical DNS suffixes")
1152 (description "This is the Public Suffix List maintained by Mozilla. A
1153 \"public suffix\" is one under which Internet users can (or historically
1154 could) directly register names in the Domain Name System (DNS). Some examples
1155 of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
1156 known public suffixes.")
1157 (license license:mpl2.0))))
1159 (define-public maradns
1162 (version "3.5.0007")
1166 (uri (string-append "https://maradns.samiam.org/download/"
1167 (version-major+minor version) "/"
1168 version "/maradns-" version ".tar.xz"))
1170 (base32 "0bc19xylg4whww9qaj5i4izwxcrh0c0ja7l1pfcn2la02hlvg1a6"))))
1171 (build-system gnu-build-system)
1173 `(#:tests? #f ; need to be root to run tests
1176 ,(string-append "CC=" (cc-for-target))
1177 (string-append "PREFIX=" %output)
1178 (string-append "RPM_BUILD_ROOT=" %output))
1180 (modify-phases %standard-phases
1182 (lambda* (#:key native-inputs target #:allow-other-keys)
1183 ;; make_32bit_tables generates a header file that is used during
1184 ;; compilation. Hence, during cross compilation, it should be
1185 ;; built for the host system.
1187 (substitute* "rng/Makefile"
1188 (("\\$\\(CC\\) -o make_32bit_tables")
1189 (string-append (assoc-ref native-inputs "gcc")
1190 "/bin/gcc -o make_32bit_tables"))))
1191 (invoke "./configure")))
1192 (add-before 'install 'create-install-directories
1193 (lambda* (#:key outputs #:allow-other-keys)
1194 (let ((out (assoc-ref outputs "out")))
1195 (for-each (lambda (dir)
1196 (mkdir-p (string-append out dir)))
1197 (list "/bin" "/sbin" "/etc"
1202 (home-page "https://maradns.samiam.org")
1203 (synopsis "Small lightweight DNS server")
1204 (description "MaraDNS is a small and lightweight DNS server. MaraDNS
1205 consists of a UDP-only authoritative DNS server for hosting domains, and a UDP
1206 and TCP-capable recursive DNS server for finding domains on the internet.")
1207 (license license:bsd-2)))
1209 (define-public openresolv
1215 (uri (string-append "https://roy.marples.name/downloads/openresolv/"
1216 "openresolv-" version ".tar.xz"))
1219 "01ms6c087la4hk0f0w6n2vpsb7dg4kklah2rqyhz88p0vr9bqy20"))
1221 (search-patches "openresolv-restartcmd-guix.patch"))))
1222 (build-system gnu-build-system)
1224 `(#:tests? #f ; No test suite
1226 (list (string-append "--sysconfdir=/etc"))
1228 (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))))
1229 (home-page "https://roy.marples.name/projects/openresolv/")
1230 (synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
1231 (description "openresolv is an implementation of @command{resolvconf}, the
1232 middleman between the network configuration services and
1233 @file{/etc/resolv.conf}. @command{resolvconf} itself is just a script that
1234 stores, removes and lists a full @file{resolv.conf} generated for the
1235 interface. It then calls all the helper scripts it knows about so it can
1236 configure the real @file{/etc/resolv.conf} and optionally any local
1237 nameservers other than libc.")
1238 (license license:bsd-2)))