gnu: rust-slab-0.4: Don't hide package.
[jackhill/guix/guix.git] / gnu / packages / dns.scm
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 ng0 <ng0@n0.is>
8 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2016 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 ;;;
17 ;;; This file is part of GNU Guix.
18 ;;;
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
23 ;;;
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
28 ;;;
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32 (define-module (gnu packages dns)
33 #:use-module (gnu packages admin)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages bash)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages databases)
39 #:use-module (gnu packages documentation)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages crypto)
42 #:use-module (gnu packages datastructures)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages groff)
46 #:use-module (gnu packages groff)
47 #:use-module (gnu packages libedit)
48 #:use-module (gnu packages libevent)
49 #:use-module (gnu packages libidn)
50 #:use-module (gnu packages linux)
51 #:use-module (gnu packages lua)
52 #:use-module (gnu packages ncurses)
53 #:use-module (gnu packages nettle)
54 #:use-module (gnu packages networking)
55 #:use-module (gnu packages perl)
56 #:use-module (gnu packages pkg-config)
57 #:use-module (gnu packages protobuf)
58 #:use-module (gnu packages python)
59 #:use-module (gnu packages python-xyz)
60 #:use-module (gnu packages sphinx)
61 #:use-module (gnu packages swig)
62 #:use-module (gnu packages tls)
63 #:use-module (gnu packages web)
64 #:use-module (gnu packages xml)
65 #:use-module (gnu packages)
66 #:use-module ((guix licenses) #:prefix license:)
67 #:use-module (guix packages)
68 #:use-module (guix download)
69 #:use-module (guix git-download)
70 #:use-module (guix utils)
71 #:use-module (guix build-system gnu)
72 #:use-module (guix build-system meson)
73 #:use-module (guix build-system trivial))
74
75 (define-public dnsmasq
76 (package
77 (name "dnsmasq")
78 (version "2.80")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append
82 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
83 version ".tar.xz"))
84 (sha256
85 (base32
86 "1fv3g8vikj3sn37x1j6qsywn09w1jipvlv34j3q5qrljbrwa5ayd"))))
87 (build-system gnu-build-system)
88 (native-inputs
89 `(("pkg-config" ,pkg-config)))
90 (inputs
91 `(("dbus" ,dbus)))
92 (arguments
93 `(#:phases
94 (modify-phases %standard-phases (delete 'configure))
95 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
96 "CC=gcc"
97 "COPTS=\"-DHAVE_DBUS\"")
98 #:tests? #f)) ; no ‘check’ target
99 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
100 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
101 (description
102 "Dnsmasq is a light-weight DNS forwarder and DHCP server. It is designed
103 to provide DNS and, optionally, DHCP to a small network. It can serve the
104 names of local machines which are not in the global DNS. The DHCP server
105 integrates with the DNS server and allows machines with DHCP-allocated
106 addresses to appear in the DNS with names configured either on each host or in
107 a central configuration file. Dnsmasq supports static and dynamic DHCP leases
108 and BOOTP/TFTP for network booting of diskless machines.")
109 ;; Source files only say GPL2 and GPL3 are allowed.
110 (license (list license:gpl2 license:gpl3))))
111
112 ;; 'bind' is the name of a built-in Guile procedure, which is why we choose a
113 ;; different name here.
114 (define-public isc-bind
115 (package
116 (name "bind")
117 (version "9.14.10")
118 (source (origin
119 (method url-fetch)
120 (uri (string-append
121 "https://ftp.isc.org/isc/bind9/" version
122 "/bind-" version ".tar.gz"))
123 (sha256
124 (base32
125 "0nkkc2phkkzwgl922xg41gx5pc5f4safabqslaw3880hwdf8vfaa"))))
126 (build-system gnu-build-system)
127 (outputs `("out" "utils"))
128 (inputs
129 ;; It would be nice to add GeoIP and gssapi once there are packages.
130 `(("libcap" ,libcap)
131 ("libxml2" ,libxml2)
132 ("openssl" ,openssl)
133 ("p11-kit" ,p11-kit)
134 ("python" ,python)
135 ("python-ply" ,python-ply)))
136 (native-inputs `(("perl" ,perl)
137 ("net-tools" ,net-tools)))
138 (arguments
139 `(#:configure-flags
140 (list (string-append "--with-openssl="
141 (assoc-ref %build-inputs "openssl"))
142 (string-append "--with-pkcs11="
143 (assoc-ref %build-inputs "p11-kit")))
144 #:phases
145 (modify-phases %standard-phases
146 (add-after 'strip 'move-to-utils
147 (lambda _
148 (for-each
149 (lambda (file)
150 (let ((target (string-append (assoc-ref %outputs "utils") file))
151 (src (string-append (assoc-ref %outputs "out") file)))
152 (mkdir-p (dirname target))
153 (link src target)
154 (delete-file src)))
155 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
156 "/share/man/man1/dig.1"
157 "/share/man/man1/host.1"
158 "/share/man/man1/nslookup.1"
159 "/share/man/man1/nsupdate.1"))
160 #t))
161 ;; When and if guix provides user namespaces for the build process,
162 ;; then the following can be uncommented and the subsequent "force-test"
163 ;; will not be necessary.
164 ;;
165 ;; (add-before 'check 'set-up-loopback
166 ;; (lambda _
167 ;; (system "bin/tests/system/ifconfig.sh up")))
168 (replace 'check
169 (lambda _
170 ;; XXX Even ‘make force-test’ tries to create network interfaces
171 ;; and fails. The only working target is the (trivial) fuzz test.
172 (with-directory-excursion "fuzz"
173 (invoke "make" "check"))
174 #t)))))
175 (synopsis "An implementation of the Domain Name System")
176 (description "BIND is an implementation of the @dfn{Domain Name System}
177 (DNS) protocols for the Internet. It is a reference implementation of those
178 protocols, but it is also production-grade software, suitable for use in
179 high-volume and high-reliability applications. The name BIND stands for
180 \"Berkeley Internet Name Domain\", because the software originated in the early
181 1980s at the University of California at Berkeley.")
182 (home-page "https://www.isc.org/downloads/bind")
183 (license (list license:mpl2.0))))
184
185 (define-public dnscrypt-proxy
186 (package
187 (name "dnscrypt-proxy")
188 (version "1.9.5")
189 (source (origin
190 (method url-fetch)
191 (uri (string-append
192 "https://download.dnscrypt.org/dnscrypt-proxy/"
193 "dnscrypt-proxy-" version ".tar.bz2"))
194 (sha256
195 (base32
196 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
197 (modules '((guix build utils)))
198 (snippet
199 ;; Delete bundled libltdl. XXX: This package also bundles
200 ;; a modified libevent that cannot currently be removed.
201 '(begin
202 (delete-file-recursively "libltdl")
203 #t))))
204 (build-system gnu-build-system)
205 (arguments
206 `(#:phases
207 (modify-phases %standard-phases
208 (add-after 'unpack 'autoreconf
209 (lambda _
210 ;; Re-generate build files due to unbundling ltdl.
211 ;; TODO: Prevent generating new libltdl and building it.
212 ;; The system version is still favored and referenced.
213 (invoke "autoreconf" "-vif"))))))
214 (native-inputs
215 `(("pkg-config" ,pkg-config)
216 ("automake" ,automake)
217 ("autoconf" ,autoconf)
218 ("libtool" ,libtool)))
219 (inputs
220 `(("libltdl" ,libltdl)
221 ("libsodium" ,libsodium)))
222 (home-page "https://www.dnscrypt.org/")
223 (synopsis "Securely send DNS requests to a remote server")
224 (description
225 "@command{dnscrypt-proxy} is a tool for securing communications
226 between a client and a DNS resolver. It verifies that responses you get
227 from a DNS provider was actually sent by that provider, and haven't been
228 tampered with. For optimal performance it is recommended to use this as
229 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
230 can also be used as a normal DNS \"server\". A list of public dnscrypt
231 servers is included, and an up-to-date version is available at
232 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
233 (license (list license:isc
234 ;; Libevent and src/ext/queue.h is 3-clause BSD.
235 license:bsd-3))))
236
237 (define-public dnscrypt-wrapper
238 (package
239 (name "dnscrypt-wrapper")
240 (version "0.2.2")
241 (source (origin
242 (method url-fetch)
243 (uri (string-append
244 "https://github.com/cofyc/dnscrypt-wrapper/releases"
245 "/download/v" version "/" name "-v" version ".tar.bz2"))
246 (sha256
247 (base32
248 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
249 (build-system gnu-build-system)
250 (arguments
251 `(#:make-flags '("CC=gcc")
252 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
253 #:tests? #f
254 #:phases
255 (modify-phases %standard-phases
256 (add-after 'unpack 'create-configure
257 (lambda _
258 (invoke "make" "configure"))))))
259 (native-inputs
260 `(("autoconf" ,autoconf)))
261 (inputs
262 `(("libevent" ,libevent)
263 ("libsodium" ,libsodium)))
264 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
265 (synopsis "Server-side dnscrypt proxy")
266 (description
267 "@command{dnscrypt-wrapper} is a tool to expose a name server over
268 the @code{dnscrypt} protocol. It can be used as an endpoint for the
269 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
270 the two.")
271 (license (list license:isc
272 ;; Bundled argparse is MIT. TODO: package and unbundle.
273 license:expat
274 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
275 license:gpl2
276 license:gpl3))))
277
278 (define-public libasr
279 (package
280 (name "libasr")
281 (version "1.0.3")
282 (source
283 (origin
284 (method url-fetch)
285 (uri (string-append "https://www.opensmtpd.org/archives/"
286 "libasr-" version ".tar.gz"))
287 (sha256
288 (base32 "13fn4sr4vlcx1xijpl26nmnxawyls4lr5q3mi11jdm76f80qxn4w"))))
289 (build-system gnu-build-system)
290 (arguments
291 `(#:phases
292 (modify-phases %standard-phases
293 (replace 'bootstrap
294 ;; ‘GNU build system bootstrapping not needed’, the default lies.
295 (lambda _
296 (invoke "sh" "./bootstrap")))
297 (add-after 'install 'install-documentation
298 (lambda* (#:key outputs #:allow-other-keys)
299 (let ((out (assoc-ref outputs "out")))
300 (install-file "src/asr_run.3"
301 (string-append out "/share/man/man3"))
302 #t))))))
303 (native-inputs
304 `(("autoconf" ,autoconf)
305 ("automake" ,automake)
306 ("libtool" ,libtool)
307 ("pkg-config" ,pkg-config)))
308 (home-page "https://www.opensmtpd.org")
309 (synopsis "Asynchronous resolver library by the OpenBSD project")
310 (description
311 "libasr is a free, simple and portable asynchronous resolver library.
312 It allows to run DNS queries and perform hostname resolutions in a fully
313 asynchronous fashion.")
314 (license (list license:isc
315 license:bsd-2 ; last part of getrrsetbyname_async.c
316 license:bsd-3
317 (license:non-copyleft "file://LICENSE") ; includes.h
318 license:openssl))))
319
320 (define-public nsd
321 (package
322 (name "nsd")
323 (version "4.2.4")
324 (source
325 (origin
326 (method url-fetch)
327 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
328 version ".tar.gz"))
329 (sha256
330 (base32 "0z7j3vwqqj0hh8n5irb2yqwzl45k4sn2wczbq1b1lqv5cxv6vgcy"))))
331 (build-system gnu-build-system)
332 (arguments
333 `(#:configure-flags
334 (list "--enable-pie" ; fully benefit from ASLR
335 "--enable-ratelimit"
336 "--enable-recvmmsg"
337 "--enable-relro-now" ; protect GOT and .dtor areas
338 "--disable-radix-tree"
339 (string-append "--with-libevent="
340 (assoc-ref %build-inputs "libevent"))
341 (string-append "--with-ssl="
342 (assoc-ref %build-inputs "openssl"))
343 "--with-configdir=/etc"
344 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
345 "--with-logfile=/var/log/nsd.log"
346 "--with-pidfile=/var/db/nsd/nsd.pid"
347 "--with-dbfile=/var/db/nsd/nsd.db"
348 "--with-zonesdir=/etc/nsd"
349 "--with-xfrdfile=/var/db/nsd/xfrd.state"
350 "--with-zonelistfile=/var/db/nsd/zone.list")
351 #:phases
352 (modify-phases %standard-phases
353 (add-before 'configure 'patch-installation-paths
354 (lambda* (#:key outputs #:allow-other-keys)
355 (let* ((out (assoc-ref outputs "out"))
356 (doc (string-append out "/share/doc/" ,name "-" ,version)))
357 ;; The ‘make install’ target tries to create the parent
358 ;; directories of run-time things like ‘pidfile’ above, and
359 ;; useless empty directories like 'configdir'. Remove such
360 ;; '$(INSTALL)' lines and install the example configuration file
361 ;; in an appropriate location.
362 (substitute* "Makefile.in"
363 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
364 (string-append "#" command))
365 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
366 (string-append doc "/examples/" file-name)))
367 #t))))
368 #:tests? #f)) ; no tests
369 (inputs
370 `(("libevent" ,libevent)
371 ("openssl" ,openssl)))
372 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
373 (synopsis "Authoritative DNS name server")
374 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
375 name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
376 RFC-compliant nameserver.
377
378 NSD uses zone information compiled via @command{zonec} into a binary database
379 file (@file{nsd.db}). This allows fast startup of the name service daemon and
380 allows syntax-structural errors in zone files to be flagged at compile time,
381 before being made available to NSD service itself. However, most traditional
382 BIND-style zone files can be directly imported into NSD without modification.
383
384 The collection of programs and processes that make up NSD are designed so that
385 the daemon itself runs as a non-privileged user and can be easily configured to
386 run in a @code{chroot} jail, thus making any security flaws in NSD less likely
387 to result in system-wide compromise.")
388 (license (list license:bsd-3))))
389
390 (define-public unbound
391 (package
392 (name "unbound")
393 (version "1.9.5")
394 (source
395 (origin
396 (method url-fetch)
397 (uri (string-append "https://www.unbound.net/downloads/unbound-"
398 version ".tar.gz"))
399 (sha256
400 (base32 "0myv8l886gmlh9nh4j3q5549idxnl51hf9cw20yxfqbwd47l13ca"))))
401 (build-system gnu-build-system)
402 (outputs '("out" "python"))
403 (native-inputs
404 `(("flex" ,flex)
405 ("swig" ,swig)))
406 (inputs
407 `(("expat" ,expat)
408 ("libevent" ,libevent)
409 ("protobuf" ,protobuf)
410 ("python-wrapper" ,python-wrapper)
411 ("openssl" ,openssl)))
412 (arguments
413 `(#:configure-flags
414 (list "--disable-static" ; save space and non-determinism in libunbound.a
415 (string-append
416 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
417 (string-append
418 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
419 (string-append
420 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
421 "--with-pythonmodule" "--with-pyunbound")
422 #:phases
423 (modify-phases %standard-phases
424 (add-after 'configure 'fix-python-site-package-path
425 ;; Move python modules into their own output.
426 (lambda* (#:key outputs #:allow-other-keys)
427 (let ((pyout (assoc-ref outputs "python"))
428 (ver ,(version-major+minor (package-version python))))
429 (substitute* "Makefile"
430 (("^PYTHON_SITE_PKG=.*$")
431 (string-append
432 "PYTHON_SITE_PKG="
433 pyout "/lib/python-" ver "/site-packages\n"))))
434 #t))
435 (add-before 'check 'fix-missing-nss-for-tests
436 ;; Unfortunately, the package's unittests involve some checks
437 ;; looking up protocols and services which are not provided
438 ;; by the minimalistic build environment, in particular,
439 ;; /etc/protocols and /etc/services are missing.
440 ;; Also, after plain substitution of protocol and service names
441 ;; in the test data, the tests still fail because the
442 ;; corresponding Resource Records have been signed by
443 ;; RRSIG records.
444 ;; The following LD_PRELOAD library overwrites the glibc
445 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
446 ;; ‘getservbyport’ providing the few records required for the
447 ;; unit tests to pass.
448 (lambda* (#:key inputs outputs #:allow-other-keys)
449 (let* ((source (assoc-ref %build-inputs "source"))
450 (gcc (assoc-ref %build-inputs "gcc")))
451 (call-with-output-file "/tmp/nss_preload.c"
452 (lambda (port)
453 (display "#include <stdlib.h>
454 #include <string.h>
455 #include <strings.h>
456
457 #include <netdb.h>
458
459 struct protoent *getprotobyname(const char *name) {
460 struct protoent *p = malloc(sizeof(struct protoent));
461 p->p_aliases = malloc(sizeof(char*));
462 if (strcasecmp(name, \"tcp\") == 0) {
463 p->p_name = \"tcp\";
464 p->p_proto = 6;
465 p->p_aliases[0] = \"TCP\";
466 } else if (strcasecmp(name, \"udp\") == 0) {
467 p->p_name = \"udp\";
468 p->p_proto = 17;
469 p->p_aliases[0] = \"UDP\";
470 } else
471 p = NULL;
472 return p;
473 }
474
475 struct protoent *getprotobynumber(int proto) {
476 struct protoent *p = malloc(sizeof(struct protoent));
477 p->p_aliases = malloc(sizeof(char*));
478 switch(proto) {
479 case 6:
480 p->p_name = \"tcp\";
481 p->p_proto = 6;
482 p->p_aliases[0] = \"TCP\";
483 break;
484 case 17:
485 p->p_name = \"udp\";
486 p->p_proto = 17;
487 p->p_aliases[0] = \"UDP\";
488 break;
489 default:
490 p = NULL;
491 break;
492 }
493 return p;
494 }
495
496 struct servent *getservbyname(const char *name, const char *proto) {
497 struct servent *s = malloc(sizeof(struct servent));
498 char* buf = malloc((strlen(proto)+1)*sizeof(char));
499 strcpy(buf, proto);
500 s->s_aliases = malloc(sizeof(char*));
501 s->s_aliases[0] = NULL;
502 if (strcasecmp(name, \"domain\") == 0) {
503 s->s_name = \"domain\";
504 s->s_port = htons(53);
505 s->s_proto = buf;
506 } else
507 s = NULL;
508 return s;
509 }
510
511 struct servent *getservbyport(int port, const char *proto) {
512 char buf[32];
513 struct servent *s = malloc(sizeof(struct servent));
514 strcpy(buf, proto);
515 s->s_aliases = malloc(sizeof(char*));
516 s->s_aliases[0] = NULL;
517 switch(port) {
518 case 53:
519 s->s_name = \"domain\";
520 s->s_port = 53;
521 s->s_proto = \"udp\";
522 break;
523 default:
524 s = NULL;
525 break;
526 }
527 return s;
528 }" port)))
529 (invoke (string-append gcc "/bin/gcc")
530 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
531 "/tmp/nss_preload.c")
532 ;; The preload library only affects the unittests.
533 (substitute* "Makefile"
534 (("./unittest")
535 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
536 #t)))))
537 (home-page "https://www.unbound.net")
538 (synopsis "Validating, recursive, and caching DNS resolver")
539 (description
540 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
541 validation of results. It implements only a minimal amount of authoritative
542 service to prevent leakage to the root nameservers: forward lookups for
543 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
544 served by AS112. Stub and forward zones are supported.")
545 (license license:bsd-4)))
546
547 (define-public yadifa
548 (package
549 (name "yadifa")
550 (version "2.3.9")
551 (source
552 (let ((build "8497"))
553 (origin
554 (method url-fetch)
555 (uri
556 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
557 "yadifa-" version "-" build ".tar.gz"))
558 (sha256
559 (base32 "0xvyr91sfgzkpw6g3h893ldbwnki3w2472n56rr18w67qghs1sa5")))))
560 (build-system gnu-build-system)
561 (native-inputs
562 `(("which" ,which)))
563 (inputs
564 `(("openssl" ,openssl)))
565 (arguments
566 `(#:phases
567 (modify-phases %standard-phases
568 (add-before 'configure 'omit-example-configurations
569 (lambda _
570 (substitute* "Makefile.in"
571 ((" (etc|var)") ""))
572 #t)))
573 #:configure-flags
574 (list "--sysconfdir=/etc"
575 "--localstatedir=/var"
576 "--disable-build-timestamp" ; build reproducibly
577 "--enable-shared"
578 "--disable-static"
579 "--enable-acl"
580 "--enable-caching"
581 "--enable-ctrl" ; enable remote control
582 "--enable-nsec"
583 "--enable-nsec3"
584 "--enable-tsig")))
585 (home-page "http://www.yadifa.eu/")
586 (synopsis "Authoritative DNS name server")
587 (description "YADIFA is an authoritative name server for the @dfn{Domain
588 Name System} (DNS). It aims for both higher performance and a smaller memory
589 footprint than other implementations, while remaining fully RFC-compliant.
590 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
591 Extensions} (DNSSEC).")
592 (license license:bsd-3)))
593
594 (define-public knot
595 (package
596 (name "knot")
597 (version "2.9.2")
598 (source
599 (origin
600 (method url-fetch)
601 (uri (string-append "https://secure.nic.cz/files/knot-dns/"
602 "knot-" version ".tar.xz"))
603 (sha256
604 (base32 "1vmndmbzwwrqczhygkhpdn5xxljcnaa3d0z5yw6vb2bmm8rxz319"))
605 (modules '((guix build utils)))
606 (snippet
607 '(begin
608 ;; Delete bundled libraries.
609 (with-directory-excursion "src/contrib"
610 (delete-file-recursively "lmdb"))
611 #t))))
612 (build-system gnu-build-system)
613 (native-inputs
614 `(("pkg-config" ,pkg-config)))
615 (inputs
616 `(("fstrm" ,fstrm)
617 ("gnutls" ,gnutls)
618 ("jansson" ,jansson)
619 ("libcap-ng" ,libcap-ng)
620 ("libedit" ,libedit)
621 ("libidn" ,libidn)
622 ("liburcu" ,liburcu)
623 ("lmdb" ,lmdb)
624 ("ncurses" ,ncurses)
625 ("protobuf-c" ,protobuf-c)))
626 (arguments
627 `(#:phases
628 (modify-phases %standard-phases
629 (add-before 'configure 'disable-directory-pre-creation
630 (lambda _
631 ;; Don't install empty directories like ‘/etc’ outside the store.
632 ;; This is needed even when using ‘make config_dir=... install’.
633 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
634 #t))
635 (replace 'install
636 (lambda* (#:key outputs #:allow-other-keys)
637 (let* ((out (assoc-ref outputs "out"))
638 (doc (string-append out "/share/doc/" ,name "-" ,version))
639 (etc (string-append doc "/examples/etc")))
640 (invoke "make"
641 (string-append "config_dir=" etc)
642 "install")))))
643 #:configure-flags
644 (list "--sysconfdir=/etc"
645 "--localstatedir=/var"
646 "--enable-dnstap" ; let tools read/write capture files
647 "--with-module-dnstap=yes" ; detailed query capturing & logging
648 (string-append "--with-bash-completions="
649 (assoc-ref %outputs "out")
650 "/etc/bash_completion.d"))))
651 (home-page "https://www.knot-dns.cz/")
652 (synopsis "Authoritative DNS name server")
653 (description "Knot DNS is an authoritative name server for the @dfn{Domain
654 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
655 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
656 number of programming techniques to improve speed. For example, the responder
657 is completely lock-free, resulting in a very high response rate. Other features
658 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
659 synthesis, and on-the-fly re-configuration.")
660 (license
661 (list
662 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
663 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
664 license:expat
665 license:lgpl2.0+ ; parts of scr/contrib/ucw
666 license:public-domain ; src/contrib/fnv and possibly murmurhash3
667 license:gpl3+)))) ; everything else
668
669 (define-public knot-resolver
670 (package
671 (name "knot-resolver")
672 (version "4.3.0")
673 (source (origin
674 (method url-fetch)
675 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
676 "knot-resolver-" version ".tar.xz"))
677 (sha256
678 (base32
679 "09ffmqx79lv5psr433x4n946njgsn071b9b7161pcb9bmrqz380c"))))
680 (build-system meson-build-system)
681 (arguments
682 '(#:configure-flags '("-Ddoc=enabled")
683 #:phases
684 (modify-phases %standard-phases
685 (add-before 'configure 'disable-default-ta
686 (lambda _
687 ;; Disable the default managed root TA, since we don't have
688 ;; write access to the keyfile and its directory in store.
689 (substitute* "daemon/lua/sandbox.lua.in"
690 (("^trust_anchors\\.add_file.*") ""))
691 #t))
692 (add-after 'build 'build-doc
693 (lambda _
694 (invoke "ninja" "doc")))
695 (add-after 'install 'wrap-binary
696 (lambda* (#:key inputs outputs #:allow-other-keys)
697 (let* ((out (assoc-ref outputs "out"))
698 (lua-* (map cdr (filter
699 (lambda (input)
700 (string-prefix? "lua-" (car input)))
701 inputs)))
702 (lua-path (lambda (p)
703 (string-append p "/share/lua/5.1/?.lua")))
704 (lua-cpath (lambda (p)
705 (string-append p "/lib/lua/5.1/?.so"))))
706 (wrap-program (string-append out "/sbin/kresd")
707 `("LUA_PATH" ";" prefix ,(map lua-path lua-*))
708 `("LUA_CPATH" ";" prefix ,(map lua-cpath lua-*)))
709 #t))))))
710 (native-inputs
711 `(("cmocka" ,cmocka) ; for unit tests
712 ("doxygen" ,doxygen)
713 ("protobuf-c" ,protobuf-c)
714 ("pkg-config" ,pkg-config)
715 ("python-breathe" ,python-breathe)
716 ("python-sphinx" ,python-sphinx)
717 ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)))
718 (inputs
719 `(("fstrm" ,fstrm)
720 ("gnutls" ,gnutls)
721 ("knot" ,knot)
722 ("libuv" ,libuv)
723 ("lmdb" ,lmdb)
724 ("luajit" ,luajit)
725 ;; TODO: Add optional lua modules: basexx, cqueues and psl.
726 ("lua-bitop" ,lua5.1-bitop)
727 ("lua-filesystem" ,lua5.1-filesystem)
728 ("lua-sec" ,lua5.1-sec)
729 ("lua-socket" ,lua5.1-socket)))
730 (home-page "https://www.knot-resolver.cz/")
731 (synopsis "Caching validating DNS resolver")
732 (description
733 "Knot Resolver is a caching full resolver implementation written in C and
734 LuaJIT, both a resolver library and a daemon.")
735 (license (list license:gpl3+
736 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
737 license:expat
738 license:cc0
739 license:lgpl2.0))))
740
741 (define-public ddclient
742 (package
743 (name "ddclient")
744 (version "3.9.0")
745 (source (origin
746 (method url-fetch)
747 (uri (string-append "mirror://sourceforge/ddclient/ddclient/ddclient-"
748 version "/ddclient-" version ".tar.gz"))
749 (sha256
750 (base32
751 "0fwyhab8yga2yi1kdfkbqxa83wxhwpagmj1w1mwkg2iffh1fjjlw"))))
752 (build-system trivial-build-system) ; no Makefile.PL
753 (native-inputs
754 `(("bash" ,bash)
755 ("gzip" ,gzip)
756 ("perl" ,perl)
757 ("tar" ,tar)))
758 (inputs
759 `(("inetutils" ,inetutils) ; logger
760 ("net-tools" ,net-tools)
761 ("perl-data-validate-ip" ,perl-data-validate-ip)
762 ("perl-digest-sha1" ,perl-digest-sha1)
763 ("perl-io-socket-ssl" ,perl-io-socket-ssl)))
764 (arguments
765 `(#:modules ((guix build utils)
766 (ice-9 match)
767 (srfi srfi-26))
768 #:builder
769 (begin
770 (use-modules (guix build utils)
771 (ice-9 match)
772 (srfi srfi-26))
773 ;; bootstrap
774 (setenv "PATH" (string-append
775 (assoc-ref %build-inputs "bash") "/bin" ":"
776 (assoc-ref %build-inputs "tar") "/bin" ":"
777 (assoc-ref %build-inputs "gzip") "/bin" ":"
778 (assoc-ref %build-inputs "perl") "/bin"))
779 ;; extract source
780 (invoke "tar" "xvf" (assoc-ref %build-inputs "source"))
781 ;; package
782 (with-directory-excursion (string-append ,name "-" ,version)
783 (let* ((out (assoc-ref %outputs "out"))
784 (bin (string-append out "/bin")))
785 (let ((file "ddclient"))
786 (substitute* file
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)
796 `("PATH" ":" =
797 ("$PATH"
798 ,@(map (lambda (input)
799 (match input
800 ((name . store)
801 (string-append store "/bin"))))
802 %build-inputs)))
803 `("PERL5LIB" ":" =
804 ,(delete
805 ""
806 (map (match-lambda
807 (((? (cut string-prefix? "perl-" <>) name) . dir)
808 (string-append dir "/lib/perl5/site_perl"))
809 (_ ""))
810 %build-inputs)))))
811 (for-each (cut install-file <> (string-append out
812 "/share/ddclient"))
813 (find-files "." "sample.*$")))))))
814 (home-page "https://sourceforge.net/projects/ddclient/")
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}.
819
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.
822
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+)))
827
828 (define-public hnsd
829 ;; There have been no releases yet, hence this commit.
830 (let ((revision "0")
831 (commit "895d89c25d316d18df9d374fe78aae3902bc89fb"))
832 (package
833 (name "hnsd")
834 (version (git-version "0.0" revision commit))
835 (source (origin
836 (method git-fetch)
837 (uri (git-reference
838 (url "https://github.com/handshake-org/hnsd")
839 (commit commit)))
840 (sha256
841 (base32
842 "0704y73sddn24jga9csw4gxyfb3pnrfnk0vdcph84n1h38490l16"))
843 (file-name (git-file-name name version))
844 (modules '((guix build utils)))
845 (snippet
846 '(begin
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")
854
855 ;; Make sure the 'hnsd' binary is installed and
856 ;; dynamically-linked.
857 (("noinst_PROGRAMS") "bin_PROGRAMS")
858 (("hnsd_LDFLAGS = -static") ""))
859
860 ;; This script tries to chdir to "uv" and doesn't do more
861 ;; than "autoreconf" so remove it.
862 (delete-file "autogen.sh")
863 #t))))
864 (build-system gnu-build-system)
865 (arguments
866 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
867 (native-inputs
868 `(("autoconf" ,autoconf)
869 ("automake" ,automake)
870 ("libtool" ,libtool)))
871 (inputs
872 `(("unbound" ,unbound)
873 ("libuv" ,libuv)))
874 (home-page "https://www.handshake.org/")
875 (synopsis "Resolver daemon for the Handshake naming protocol")
876 (description
877 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
878 System (HNS) peer-to-peer network.")
879 (license license:expat))))
880
881 (define-public libmicrodns
882 (package
883 (name "libmicrodns")
884 (version "0.0.10")
885 (source (origin
886 (method git-fetch)
887 (uri (git-reference
888 (url "https://github.com/videolabs/libmicrodns")
889 (commit version)))
890 (file-name (git-file-name name version))
891 (sha256
892 (base32
893 "1xvl9k49ng35wbsqmnjnyqvkyjf8dcq2ywsq3jp3wh0rgmxhq2fh"))))
894 (build-system gnu-build-system)
895 (native-inputs
896 `(("pkg-config" ,pkg-config)
897 ("autoconf" ,autoconf)
898 ("automake" ,automake)
899 ("libtool" ,libtool)))
900 (home-page "https://github.com/videolabs/libmicrodns")
901 (synopsis "Minimal mDNS resolver library")
902 (description "@code{libmicrodns} provides a minimal implementation of a
903 mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
904 a zero-config service that allows one to resolve host names to IP addresses in
905 local networks.")
906 (license license:lgpl2.1)))
907
908 (define-public public-suffix-list
909 ;; Mozilla releases the official list here:
910 ;;
911 ;; https://publicsuffix.org/list/public_suffix_list.dat
912 ;;
913 ;; However, Mozilla syncs that file from the GitHub repository periodically,
914 ;; so its contents will change over time. If you update this commit, please
915 ;; make sure that the new commit refers to a list which is identical to the
916 ;; officially published list available from the URL above.
917 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
918 (package
919 (name "public-suffix-list")
920 (version (git-version "0" "1" commit))
921 (source (origin
922 (method git-fetch)
923 (uri (git-reference
924 (url "https://github.com/publicsuffix/list.git")
925 (commit commit)))
926 (file-name (git-file-name name version))
927 (sha256
928 (base32
929 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
930 (build-system trivial-build-system)
931 (arguments
932 `(#:modules ((guix build utils))
933 #:builder
934 (begin
935 (use-modules (guix build utils))
936 (let* ((out (assoc-ref %outputs "out"))
937 ;; Install to /share because that is where "read-only
938 ;; architecture-independent data files" should go (see:
939 ;; (standards) Directory Variables). Include the version in
940 ;; the directory name so that if multiple versions are ever
941 ;; installed in the same profile, they will not conflict.
942 (destination (string-append
943 out "/share/public-suffix-list-" ,version))
944 (source (assoc-ref %build-inputs "source")))
945 (with-directory-excursion source
946 (install-file "public_suffix_list.dat" destination)
947 (install-file "LICENSE" destination))
948 #t))))
949 (home-page "https://publicsuffix.org/")
950 (synopsis "Database of current and historical DNS suffixes")
951 (description "This is the Public Suffix List maintained by Mozilla. A
952 \"public suffix\" is one under which Internet users can (or historically
953 could) directly register names in the Domain Name System (DNS). Some examples
954 of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
955 known public suffixes.")
956 (license license:mpl2.0))))