gnu: bind: Update to 9.16.34.
[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 Nikita <nikita@n0.is>
8 ;;; Copyright © 2016–2022 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, 2022 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, 2021 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>
20 ;;; Copyright © 2020 Simon South <simon@simonsouth.net>
21 ;;; Copyright © 2021 Zheng Junjie <873216071@qq.com>
22 ;;;
23 ;;; This file is part of GNU Guix.
24 ;;;
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
29 ;;;
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
34 ;;;
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37
38 (define-module (gnu packages dns)
39 #:use-module (gnu packages admin)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages base)
42 #:use-module (gnu packages bash)
43 #:use-module (gnu packages check)
44 #:use-module (gnu packages curl)
45 #:use-module (gnu packages databases)
46 #:use-module (gnu packages documentation)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages crypto)
49 #:use-module (gnu packages datastructures)
50 #:use-module (gnu packages elf)
51 #:use-module (gnu packages flex)
52 #:use-module (gnu packages freedesktop)
53 #:use-module (gnu packages gcc)
54 #:use-module (gnu packages glib)
55 #:use-module (gnu packages groff)
56 #:use-module (gnu packages groff)
57 #:use-module (gnu packages gtk)
58 #:use-module (gnu packages libedit)
59 #:use-module (gnu packages libevent)
60 #:use-module (gnu packages libidn)
61 #:use-module (gnu packages linux)
62 #:use-module (gnu packages lua)
63 #:use-module (gnu packages ncurses)
64 #:use-module (gnu packages nettle)
65 #:use-module (gnu packages networking)
66 #:use-module (gnu packages perl)
67 #:use-module (gnu packages pkg-config)
68 #:use-module (gnu packages protobuf)
69 #:use-module (gnu packages python)
70 #:use-module (gnu packages python-xyz)
71 #:use-module (gnu packages ragel)
72 #:use-module (gnu packages serialization)
73 #:use-module (gnu packages shells)
74 #:use-module (gnu packages sphinx)
75 #:use-module (gnu packages swig)
76 #:use-module (gnu packages texinfo)
77 #:use-module (gnu packages tls)
78 #:use-module (gnu packages web)
79 #:use-module (gnu packages xml)
80 #:use-module (gnu packages)
81 #:use-module (guix gexp)
82 #:use-module ((guix licenses) #:prefix license:)
83 #:use-module (guix packages)
84 #:use-module (guix download)
85 #:use-module (guix git-download)
86 #:use-module (guix utils)
87 #:use-module (guix build-system copy)
88 #:use-module (guix build-system glib-or-gtk)
89 #:use-module (guix build-system gnu)
90 #:use-module (guix build-system meson)
91 #:use-module (guix build-system trivial))
92
93 (define-public cloudflare-cli
94 (let ((commit "2d986d3ec1b0e3158c4bd40e8918947cb74aa392")
95 (revision "1"))
96 (package
97 (name "cloudflare-cli")
98 (version (git-version "0.0.0" revision commit))
99 (source
100 (origin
101 (method git-fetch)
102 (uri (git-reference
103 (url "https://github.com/earlchew/cloudflare-cli")
104 (commit commit)))
105 (file-name (git-file-name name version))
106 (sha256
107 (base32
108 "0f86g6n86kwykl3jnhqjrdfy8ybkp03ghr3dlr70q2552qw4axw2"))))
109 (build-system copy-build-system)
110 (arguments
111 `(#:install-plan '(("cloudflare-cli" "bin/") ("cloudflare-cli.sh" "bin/"))
112 #:phases
113 (modify-phases %standard-phases
114 (add-after 'unpack 'find-jsonsh
115 (lambda* (#:key inputs #:allow-other-keys)
116 (substitute* "cloudflare-cli.sh"
117 (("\\$\\{0%/\\*\\}/jsonsh")
118 (string-append (assoc-ref inputs "json.sh") "/bin/JSON.sh")))
119 #t))
120 (add-after 'install 'wrap-program
121 (lambda* (#:key inputs outputs #:allow-other-keys)
122 (wrap-program (string-append (assoc-ref outputs "out") "/bin/cloudflare-cli")
123 `("PATH" ":" prefix
124 (,(string-join
125 (map (lambda (in) (string-append (assoc-ref inputs in) "/bin"))
126 '("grep" "curl"))
127 ":"))))
128 #t)))))
129 (inputs
130 (list bash-minimal curl grep json.sh))
131 (synopsis
132 "CLI to edit Cloudflare DNS records")
133 (description
134 "This command line tool to update Cloudfare DNS records is useful for tasks
135 such as updating dynamic DNS records or updating DNS records for the ACME DNS-01
136 protocol.")
137 (home-page "https://github.com/earlchew/cloudflare-cli")
138 (license license:expat))))
139
140 (define-public ldns
141 (package
142 (name "ldns")
143 (version "1.8.3")
144 (source
145 (origin
146 (method url-fetch)
147 (uri
148 (string-append "https://www.nlnetlabs.nl/downloads/"
149 "ldns/ldns-" version ".tar.gz"))
150 (sha256
151 (base32 "0q3q1svyxpj2g5wdkfy1ndb14m9fzffwyskflpihfabb0g8jvxy3"))
152 (patches
153 (search-patches
154 ;; To create make-flag variables,
155 ;; for splitting installation of drill and examples.
156 "ldns-drill-examples.patch"))))
157 (build-system gnu-build-system)
158 (outputs '("out" "drill" "examples" "pyldns"))
159 (arguments
160 (list
161 #:tests? #f ; tests require <https://tpkg.github.io>
162 #:configure-flags
163 #~(list
164 "--disable-static"
165 "--enable-gost-anyway"
166 "--enable-rrtype-ninfo"
167 "--enable-rrtype-rkey"
168 "--enable-rrtype-ta"
169 "--enable-rrtype-avc"
170 "--enable-rrtype-doa"
171 "--enable-rrtype-amtrelay"
172 "--with-drill"
173 "--with-examples"
174 "--with-pyldns"
175 ;; Perl module DNS::LDNS not available.
176 ;; https://github.com/erikoest/DNS-LDNS.git
177 ;; "--with-p5-dns-ldns"
178 (string-append "--with-ssl=" #$(this-package-input "openssl"))
179 (string-append "--with-ca-path=/etc/ssl/certs"))
180 #:make-flags
181 #~(list
182 (string-append "drillbindir=" #$output:drill "/bin")
183 (string-append "drillmandir=" #$output:drill "/share/man")
184 (string-append "examplesbindir=" #$output:examples "/bin")
185 (string-append "examplesmandir=" #$output:examples "/share/man")
186 (string-append "python_site=" #$output:pyldns "/lib/python"
187 #$(version-major+minor (package-version
188 (this-package-input
189 "python-wrapper")))
190 "/site-packages"))))
191 (native-inputs
192 (list doxygen perl perl-devel-checklib pkg-config swig))
193 (inputs
194 (list libpcap openssl python-wrapper))
195 (synopsis "DNS library that facilitates DNS tool programming")
196 (description "LDNS aims to simplify DNS programming, it supports recent
197 RFCs like the DNSSEC documents, and allows developers to easily create
198 software conforming to current RFCs, and experimental software for current
199 Internet Drafts. A secondary benefit of using ldns is speed; ldns is written in
200 C it should be a lot faster than Perl.")
201 (home-page "https://nlnetlabs.nl/projects/ldns/about/")
202 (license license:bsd-3)))
203
204 (define-public dnssec-trigger
205 (package
206 (name "dnssec-trigger")
207 (version "0.17")
208 (source
209 (origin
210 (method url-fetch)
211 (uri
212 (string-append "https://www.nlnetlabs.nl/downloads/"
213 name "/" name "-" version ".tar.gz"))
214 (sha256
215 (base32 "10928q406x9r66a090xl5kznzgyxpja88w4srwcv454hd351j9f0"))))
216 (build-system glib-or-gtk-build-system)
217 (outputs '("out" "gui" "nm"))
218 (arguments
219 (list #:test-target "test"
220 #:configure-flags
221 #~(list
222 (string-append "--with-ssl=" #$(this-package-input "openssl"))
223 "--with-hooks=networkmanager"
224 (string-append "--with-networkmanager-dispatch="
225 #$output:nm
226 "/etc/NetworkManager/dispatcher.d")
227 (string-append "--with-xdg-autostart="
228 #$output:gui
229 "/etc/xdg/autostart")
230 (string-append "--with-uidir="
231 #$output:gui
232 "/share/dnssec-trigger")
233 (string-append "--with-python="
234 #$(this-package-native-input "python-wrapper")
235 "/bin/python")
236 (string-append "--with-unbound-control="
237 #$(this-package-input "unbound")
238 "/sbin/unbound-control")
239 "--with-forward-zones-support")
240 #:phases
241 #~(modify-phases %standard-phases
242 (add-after 'unpack 'patch-configure
243 (lambda _
244 (substitute* "configure"
245 (("appindicator-0.1")
246 "appindicator3-0.1"))))
247 (add-before 'configure 'patch-makefile
248 (lambda _
249 (substitute* "Makefile.in"
250 (("/usr")
251 "$(prefix)")
252 (("/etc")
253 "$(prefix)/etc")
254 ((".*gtk-update-icon-cache.*")
255 ""))))
256 (add-after 'install 'remove-systemd
257 (lambda _
258 (delete-file-recursively
259 (string-append #$output "/lib/systemd"))))
260 (add-after 'remove-systemd 'move-gui
261 (lambda _
262 (mkdir-p (string-append #$output:gui "/bin"))
263 (mkdir-p (string-append #$output:gui "/share"))
264 (rename-file
265 (string-append #$output "/bin")
266 (string-append #$output:gui "/bin"))
267 (rename-file
268 (string-append #$output "/share/icons")
269 (string-append #$output:gui "/share/icons"))))
270 (add-after 'move-gui 'move-nm
271 (lambda _
272 (mkdir-p (string-append #$output:nm "/libexec"))
273 (rename-file
274 (string-append #$output "/libexec")
275 (string-append #$output:nm "/libexec")))))))
276 (native-inputs
277 (list cmocka pkg-config python-wrapper))
278 (inputs
279 (list gtk+-2 ldns libappindicator openssl unbound))
280 (synopsis "DNSSEC protection for the DNS traffic")
281 (description "DNSSEC-Trigger enables your computer to use DNSSEC protection
282 for the DNS traffic. It relies on the Unbound DNS resolver running locally on
283 your system, which performs DNSSEC validation. It reconfigures Unbound in such
284 a way that it will signal it to to use the DHCP obtained forwarders if possible,
285 fallback to doing its own AUTH queries if that fails, and if that fails it will
286 prompt the user with the option to go with insecure DNS only.")
287 (home-page "https://www.nlnetlabs.nl/projects/dnssec-trigger/about/")
288 (license license:bsd-3)))
289
290 (define-public dnsmasq
291 (package
292 (name "dnsmasq")
293 (version "2.86")
294 (source (origin
295 (method url-fetch)
296 (uri (string-append
297 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
298 version ".tar.xz"))
299 (sha256
300 (base32
301 "027b0ycw8h8yvvkq46vnr7dv8iqn5srm4kr7hm7sq110kvy2rm98"))))
302 (build-system gnu-build-system)
303 (native-inputs
304 (list pkg-config))
305 (inputs
306 (list dbus))
307 (arguments
308 `(#:phases
309 (modify-phases %standard-phases (delete 'configure))
310 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
311 (string-append "CC=" ,(cc-for-target))
312 (string-append "PKG_CONFIG=" ,(pkg-config-for-target))
313 "COPTS=\"-DHAVE_DBUS\"")
314 #:tests? #f)) ; no ‘check’ target
315 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
316 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
317 (description
318 "Dnsmasq is a light-weight DNS forwarder and DHCP server. It is designed
319 to provide DNS and, optionally, DHCP to a small network. It can serve the
320 names of local machines which are not in the global DNS. The DHCP server
321 integrates with the DNS server and allows machines with DHCP-allocated
322 addresses to appear in the DNS with names configured either on each host or in
323 a central configuration file. Dnsmasq supports static and dynamic DHCP leases
324 and BOOTP/TFTP for network booting of diskless machines.")
325 ;; Source files only say GPL2 and GPL3 are allowed.
326 (license (list license:gpl2 license:gpl3))))
327
328 ;; 'bind' is the name of a built-in Guile procedure, which is why we choose a
329 ;; different name here.
330 (define-public isc-bind
331 (package
332 (name "bind")
333 ;; When updating, check whether isc-dhcp's bundled copy should be as well.
334 ;; The BIND release notes are available here:
335 ;; https://www.isc.org/bind/
336 (version "9.16.34")
337 (source
338 (origin
339 (method url-fetch)
340 (uri (string-append "https://ftp.isc.org/isc/bind9/" version
341 "/bind-" version ".tar.xz"))
342 (sha256
343 (base32 "05ig8y20qksam7s466h15v6j2zgidn5nkbrk1d5c29nmypy2wgai"))
344 (patches
345 (search-patches "bind-re-add-attr-constructor-priority.patch"))))
346 (build-system gnu-build-system)
347 (outputs `("out" "utils"))
348 (inputs
349 ;; It would be nice to add GeoIP and gssapi once there are packages.
350 (list libcap
351 libuv
352 libxml2
353 openssl
354 p11-kit
355 python
356 python-ply))
357 (native-inputs
358 (list perl pkg-config))
359 (arguments
360 `(#:configure-flags
361 (list (string-append "--with-pkcs11="
362 (assoc-ref %build-inputs "p11-kit")))
363 #:phases
364 (modify-phases %standard-phases
365 (add-after 'strip 'move-to-utils
366 (lambda _
367 (for-each
368 (lambda (file)
369 (let ((target (string-append (assoc-ref %outputs "utils") file))
370 (src (string-append (assoc-ref %outputs "out") file)))
371 (mkdir-p (dirname target))
372 (link src target)
373 (delete-file src)))
374 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
375 "/share/man/man1/dig.1"
376 "/share/man/man1/host.1"
377 "/share/man/man1/nslookup.1"
378 "/share/man/man1/nsupdate.1"))
379 #t))
380 ;; When and if guix provides user namespaces for the build process,
381 ;; then the following can be uncommented and the subsequent "force-test"
382 ;; will not be necessary.
383 ;;
384 ;; (add-before 'check 'set-up-loopback
385 ;; (lambda _
386 ;; (system "bin/tests/system/ifconfig.sh up")))
387 (replace 'check
388 (lambda _
389 ;; XXX Even ‘make force-test’ tries to create network interfaces
390 ;; and fails. The only working target is the (trivial) fuzz test.
391 (with-directory-excursion "fuzz"
392 (invoke "make" "check"))
393 #t)))))
394 (synopsis "@acronym{DNS, Domain Name System} implementation")
395 (description "BIND implements the @acronym{DNS, Domain Name System}
396 protocols for the Internet. It is both a reference implementation of those
397 protocols and production-grade software, suitable for use in high-volume and
398 high-reliability applications.
399
400 The name stands for \"Berkeley Internet Name Domain\" because the software
401 originated in the early 1980s at the University of California at Berkeley.
402
403 The @code{utils} output of this package contains the following command line
404 utilities related to DNS name servers:
405
406 @table @code
407 @item delv
408 DNS lookup and validation utility
409 @item dig
410 DNS lookup utility
411 @item host
412 DNS lookup utility
413 @item nslookup
414 Internet name servers interactive query utility
415 @item nsupdate
416 Dynamic DNS update utility
417 @end table")
418 (home-page "https://www.isc.org/bind/")
419 (license (list license:mpl2.0))))
420
421 (define-public dnscrypt-proxy
422 (package
423 (name "dnscrypt-proxy")
424 (version "1.9.5")
425 (source (origin
426 (method url-fetch)
427 (uri (string-append
428 "https://download.dnscrypt.org/dnscrypt-proxy/"
429 "dnscrypt-proxy-" version ".tar.bz2"))
430 (sha256
431 (base32
432 "1dhvklr4dg2vlw108n11xbamacaryyg3dbrg629b76lp7685p7z8"))
433 (modules '((guix build utils)))
434 (snippet
435 ;; Delete bundled libltdl. XXX: This package also bundles
436 ;; a modified libevent that cannot currently be removed.
437 '(begin
438 (delete-file-recursively "libltdl")
439 #t))))
440 (build-system gnu-build-system)
441 (arguments
442 `(#:phases
443 (modify-phases %standard-phases
444 (add-after 'unpack 'autoreconf
445 (lambda _
446 ;; Re-generate build files due to unbundling ltdl.
447 ;; TODO: Prevent generating new libltdl and building it.
448 ;; The system version is still favored and referenced.
449 (invoke "autoreconf" "-vif"))))))
450 (native-inputs
451 (list pkg-config automake autoconf libtool))
452 (inputs
453 (list libltdl libsodium))
454 (home-page "https://www.dnscrypt.org/")
455 (synopsis "Securely send DNS requests to a remote server")
456 (description
457 "@command{dnscrypt-proxy} is a tool for securing communications
458 between a client and a DNS resolver. It verifies that responses you get
459 from a DNS provider was actually sent by that provider, and haven't been
460 tampered with. For optimal performance it is recommended to use this as
461 a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
462 can also be used as a normal DNS \"server\". A list of public dnscrypt
463 servers is included, and an up-to-date version is available at
464 @url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
465 (license (list license:isc
466 ;; Libevent and src/ext/queue.h is 3-clause BSD.
467 license:bsd-3))))
468
469 (define-public dnscrypt-wrapper
470 (package
471 (name "dnscrypt-wrapper")
472 (version "0.2.2")
473 (source (origin
474 (method url-fetch)
475 (uri (string-append
476 "https://github.com/cofyc/dnscrypt-wrapper/releases"
477 "/download/v" version "/" name "-v" version ".tar.bz2"))
478 (sha256
479 (base32
480 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
481 (build-system gnu-build-system)
482 (arguments
483 `(#:make-flags '("CC=gcc")
484 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
485 #:tests? #f
486 #:phases
487 (modify-phases %standard-phases
488 (add-after 'unpack 'create-configure
489 (lambda _
490 (invoke "make" "configure"))))))
491 (native-inputs
492 (list autoconf))
493 (inputs
494 (list libevent libsodium))
495 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
496 (synopsis "Server-side dnscrypt proxy")
497 (description
498 "@command{dnscrypt-wrapper} is a tool to expose a name server over
499 the @code{dnscrypt} protocol. It can be used as an endpoint for the
500 @command{dnscrypt-proxy} client to securely tunnel DNS requests between
501 the two.")
502 (license (list license:isc
503 ;; Bundled argparse is MIT. TODO: package and unbundle.
504 license:expat
505 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
506 license:gpl2
507 license:gpl3))))
508
509 (define-public libasr
510 (package
511 (name "libasr")
512 (version "1.0.4")
513 (source
514 (origin
515 (method url-fetch)
516 (uri (string-append "https://www.opensmtpd.org/archives/"
517 "libasr-" version ".tar.gz"))
518 (sha256
519 (base32 "1d6s8njqhvayx2gp47409sp1fn8m608ws26hr1srfp6i23nnpyqr"))))
520 (build-system gnu-build-system)
521 (arguments
522 `(#:phases
523 (modify-phases %standard-phases
524 (add-after 'install 'install-documentation
525 (lambda* (#:key outputs #:allow-other-keys)
526 (let ((out (assoc-ref outputs "out")))
527 (install-file "src/asr_run.3"
528 (string-append out "/share/man/man3"))
529 #t))))))
530 (native-inputs
531 (list autoconf automake libtool pkg-config))
532 (home-page "https://www.opensmtpd.org")
533 (synopsis "Asynchronous resolver library by the OpenBSD project")
534 (description
535 "libasr is a free, simple and portable asynchronous resolver library.
536 It runs DNS queries and performs hostname resolution in a fully
537 asynchronous fashion.")
538 (license (list license:isc
539 license:bsd-2 ; last part of getrrsetbyname_async.c
540 license:bsd-3
541 (license:non-copyleft "file://LICENSE") ; includes.h
542 license:openssl))))
543
544 (define-public nsd
545 (package
546 (name "nsd")
547 (version "4.4.0")
548 (source
549 (origin
550 (method url-fetch)
551 (uri (string-append "https://www.nlnetlabs.nl/downloads/nsd/nsd-"
552 version ".tar.gz"))
553 (sha256
554 (base32 "0dl8iriy0mscppfa6ar5qcglgvxw87140abwxyksak1lk7fnzkfg"))))
555 (build-system gnu-build-system)
556 (arguments
557 `(#:configure-flags
558 (list "--enable-pie" ; fully benefit from ASLR
559 "--enable-ratelimit"
560 "--enable-recvmmsg"
561 "--enable-relro-now" ; protect GOT and .dtor areas
562 "--disable-radix-tree"
563 (string-append "--with-libevent="
564 (assoc-ref %build-inputs "libevent"))
565 (string-append "--with-ssl="
566 (assoc-ref %build-inputs "openssl"))
567 "--with-configdir=/etc"
568 "--with-nsd_conf_file=/etc/nsd/nsd.conf"
569 "--with-logfile=/var/log/nsd.log"
570 "--with-pidfile=/var/db/nsd/nsd.pid"
571 "--with-dbfile=/var/db/nsd/nsd.db"
572 "--with-zonesdir=/etc/nsd"
573 "--with-xfrdfile=/var/db/nsd/xfrd.state"
574 "--with-zonelistfile=/var/db/nsd/zone.list")
575 #:phases
576 (modify-phases %standard-phases
577 (add-before 'configure 'patch-installation-paths
578 (lambda* (#:key outputs #:allow-other-keys)
579 (let* ((out (assoc-ref outputs "out"))
580 (doc (string-append out "/share/doc/" ,name "-" ,version)))
581 ;; The ‘make install’ target tries to create the parent
582 ;; directories of run-time things like ‘pidfile’ above, and
583 ;; useless empty directories like 'configdir'. Remove such
584 ;; '$(INSTALL)' lines and install the example configuration file
585 ;; in an appropriate location.
586 (substitute* "Makefile.in"
587 ((".*INSTALL.*\\$\\((config|pid|xfr|db)dir" command)
588 (string-append "#" command))
589 (("\\$\\(nsdconfigfile\\)\\.sample" file-name)
590 (string-append doc "/examples/" file-name)))))))
591 #:tests? #f)) ; no tests
592 (inputs
593 (list libevent openssl))
594 (home-page "https://www.nlnetlabs.nl/projects/nsd/about/")
595 (synopsis "Authoritative DNS name server")
596 (description "@dfn{NSD}, short for Name Server Daemon, is an authoritative
597 name server for the Domain Name System (@dfn{DNS}). It aims to be a fast and
598 RFC-compliant nameserver.
599
600 NSD uses zone information compiled via @command{zonec} into a binary database
601 file (@file{nsd.db}). This allows fast startup of the name service daemon and
602 allows syntax-structural errors in zone files to be flagged at compile time,
603 before being made available to NSD service itself. However, most traditional
604 BIND-style zone files can be directly imported into NSD without modification.
605
606 The collection of programs and processes that make up NSD are designed so that
607 the daemon itself runs as a non-privileged user and can be easily configured to
608 run in a @code{chroot} jail, thus making any security flaws in NSD less likely
609 to result in system-wide compromise.")
610 (license (list license:bsd-3))))
611
612 (define-public rbldnsd
613 (package
614 (name "rbldnsd")
615 (version "0.998b")
616 (source
617 (origin
618 (method git-fetch)
619 (uri (git-reference
620 (url "https://github.com/spamhaus/rbldnsd")
621 (commit version)))
622 (file-name (git-file-name name version))
623 (sha256
624 (base32 "0jj3kyir43qnjgd9rk0wz13iggf3p4p1779v0wgmx3ci0ypnglcr"))))
625 (build-system gnu-build-system)
626 (arguments
627 `(#:phases
628 (modify-phases %standard-phases
629 (replace 'configure
630 ;; The ./configure is hand-written and doesn't ignore unknown
631 ;; standard autotools options like CONFIG_SHELL.
632 (lambda _
633 (invoke "./configure")))
634 (replace 'install
635 ;; There is no Makefile ‘install’ target. contrib/debian/rules has
636 ;; one but relies on Debian-specific helpers, so install manually.
637 (lambda* (#:key outputs #:allow-other-keys)
638 (let* ((out (assoc-ref outputs "out"))
639 (sbin (string-append out "/sbin"))
640 (man8 (string-append out "/share/man/man8")))
641 (install-file "rbldnsd" sbin)
642 (install-file "rbldnsd.8" man8)))))))
643 (inputs
644 (list zlib))
645 (native-inputs
646 ;; For running the test suite. Python 3 is not yet supported by a release:
647 ;; see <https://github.com/spamhaus/rbldnsd/issues/16>.
648 `(("python" ,python-2)))
649 (home-page "https://rbldnsd.io/")
650 (synopsis
651 "Small nameserver to efficiently serve @acronym{DNSBL, DNS blocklists}")
652 (description
653 "This package contains a small DNS daemon especially made to handle queries
654 of @acronym{DNSBL, DNS blocklists}, a simple way to publish IP addresses and/or
655 (domain) names which are somehow notable. Such lists are frequently used to
656 refuse e-mail service to clients known to send unwanted (spam) messages.
657
658 @command{rbldnsd} is not a general-purpose nameserver. It answers to a limited
659 variety of queries. This makes it extremely fast---greatly outperforming both
660 BIND and djbdns---whilst using relatively little memory.")
661 (license
662 (list license:bsd-3 ; btrie.[ch]
663 license:lgpl2.1+ ; qsort.c
664 license:gpl2+)))) ; the rest
665
666 (define-public unbound
667 (package
668 (name "unbound")
669 (version "1.13.2")
670 (source
671 (origin
672 (method url-fetch)
673 (uri (string-append "https://www.unbound.net/downloads/unbound-"
674 version ".tar.gz"))
675 (sha256
676 (base32 "10qs1q26lzw18ljggnbz0cc5f7lr9ksj615xbrmh4amryd3va4qa"))))
677 (build-system gnu-build-system)
678 (outputs '("out" "python"))
679 (native-inputs
680 (list flex swig))
681 (inputs
682 (list expat
683 libevent
684 `(,nghttp2 "lib")
685 protobuf
686 python-wrapper
687 openssl))
688 (arguments
689 `(#:configure-flags
690 (list "--disable-static" ; save space and non-determinism in libunbound.a
691 (string-append
692 "--with-libnghttp2=" (assoc-ref %build-inputs "nghttp2"))
693 (string-append
694 "--with-ssl=" (assoc-ref %build-inputs "openssl"))
695 (string-append
696 "--with-libevent=" (assoc-ref %build-inputs "libevent"))
697 (string-append
698 "--with-libexpat=" (assoc-ref %build-inputs "expat"))
699 "--with-pythonmodule" "--with-pyunbound")
700 #:phases
701 (modify-phases %standard-phases
702 (add-after 'configure 'fix-python-site-package-path
703 ;; Move python modules into their own output.
704 (lambda* (#:key outputs #:allow-other-keys)
705 (let ((pyout (assoc-ref outputs "python"))
706 (ver ,(version-major+minor (package-version python))))
707 (substitute* "Makefile"
708 (("^PYTHON_SITE_PKG=.*$")
709 (string-append
710 "PYTHON_SITE_PKG="
711 pyout "/lib/python-" ver "/site-packages\n"))))
712 #t))
713 (add-before 'check 'fix-missing-nss-for-tests
714 ;; Unfortunately, the package's unittests involve some checks
715 ;; looking up protocols and services which are not provided
716 ;; by the minimalistic build environment, in particular,
717 ;; /etc/protocols and /etc/services are missing.
718 ;; Also, after plain substitution of protocol and service names
719 ;; in the test data, the tests still fail because the
720 ;; corresponding Resource Records have been signed by
721 ;; RRSIG records.
722 ;; The following LD_PRELOAD library overwrites the glibc
723 ;; functions ‘get{proto,serv}byname’, ‘getprotobynumber’ and
724 ;; ‘getservbyport’ providing the few records required for the
725 ;; unit tests to pass.
726 (lambda* (#:key inputs outputs #:allow-other-keys)
727 (let* ((source (assoc-ref %build-inputs "source"))
728 (gcc (assoc-ref %build-inputs "gcc")))
729 (call-with-output-file "/tmp/nss_preload.c"
730 (lambda (port)
731 (display "#include <stdlib.h>
732 #include <string.h>
733 #include <strings.h>
734
735 #include <netdb.h>
736
737 struct protoent *getprotobyname(const char *name) {
738 struct protoent *p = malloc(sizeof(struct protoent));
739 p->p_aliases = malloc(sizeof(char*));
740 if (strcasecmp(name, \"tcp\") == 0) {
741 p->p_name = \"tcp\";
742 p->p_proto = 6;
743 p->p_aliases[0] = \"TCP\";
744 } else if (strcasecmp(name, \"udp\") == 0) {
745 p->p_name = \"udp\";
746 p->p_proto = 17;
747 p->p_aliases[0] = \"UDP\";
748 } else
749 p = NULL;
750 return p;
751 }
752
753 struct protoent *getprotobynumber(int proto) {
754 struct protoent *p = malloc(sizeof(struct protoent));
755 p->p_aliases = malloc(sizeof(char*));
756 switch(proto) {
757 case 6:
758 p->p_name = \"tcp\";
759 p->p_proto = 6;
760 p->p_aliases[0] = \"TCP\";
761 break;
762 case 17:
763 p->p_name = \"udp\";
764 p->p_proto = 17;
765 p->p_aliases[0] = \"UDP\";
766 break;
767 default:
768 p = NULL;
769 break;
770 }
771 return p;
772 }
773
774 struct servent *getservbyname(const char *name, const char *proto) {
775 struct servent *s = malloc(sizeof(struct servent));
776 char* buf = malloc((strlen(proto)+1)*sizeof(char));
777 strcpy(buf, proto);
778 s->s_aliases = malloc(sizeof(char*));
779 s->s_aliases[0] = NULL;
780 if (strcasecmp(name, \"domain\") == 0) {
781 s->s_name = \"domain\";
782 s->s_port = htons(53);
783 s->s_proto = buf;
784 } else
785 s = NULL;
786 return s;
787 }
788
789 struct servent *getservbyport(int port, const char *proto) {
790 char buf[32];
791 struct servent *s = malloc(sizeof(struct servent));
792 strcpy(buf, proto);
793 s->s_aliases = malloc(sizeof(char*));
794 s->s_aliases[0] = NULL;
795 switch(port) {
796 case 53:
797 s->s_name = \"domain\";
798 s->s_port = 53;
799 s->s_proto = \"udp\";
800 break;
801 default:
802 s = NULL;
803 break;
804 }
805 return s;
806 }" port)))
807 (invoke (string-append gcc "/bin/gcc")
808 "-shared" "-fPIC" "-o" "/tmp/nss_preload.so"
809 "/tmp/nss_preload.c")
810 ;; The preload library only affects the unittests.
811 (substitute* "Makefile"
812 (("./unittest")
813 "LD_PRELOAD=/tmp/nss_preload.so ./unittest")))
814 #t)))))
815 (home-page "https://www.unbound.net")
816 (synopsis "Validating, recursive, and caching DNS resolver")
817 (description
818 "Unbound is a recursive-only caching DNS server which can perform DNSSEC
819 validation of results. It implements only a minimal amount of authoritative
820 service to prevent leakage to the root nameservers: forward lookups for
821 localhost, reverse for @code{127.0.0.1} and @code{::1}, and NXDOMAIN for zones
822 served by AS112. Stub and forward zones are supported.")
823 (license license:bsd-4)))
824
825 (define-public yadifa
826 (package
827 (name "yadifa")
828 (version "2.5.3")
829 (source
830 (let ((build "10333"))
831 (origin
832 (method url-fetch)
833 (uri
834 (string-append "https://www.yadifa.eu/sites/default/files/releases/"
835 "yadifa-" version "-" build ".tar.gz"))
836 (sha256
837 (base32 "1mwy6sfnlaslx26f3kpj9alh8i8y8bf1nbnsdd5j04hjsbavd07p")))))
838 (build-system gnu-build-system)
839 (native-inputs
840 (list which))
841 (inputs
842 (list openssl))
843 (arguments
844 `(#:phases
845 (modify-phases %standard-phases
846 (add-before 'configure 'omit-example-configurations
847 (lambda _
848 (substitute* "Makefile.in"
849 ((" (etc|var)") ""))))
850 (add-after 'configure 'omit-spurious-references
851 (lambda _
852 ;; The many Makefile.in grep this(!) to #define BUILD_OPTIONS.
853 (substitute* "config.log"
854 (("(=/gnu/store/)[^-]*" _ match)
855 (string-append match "..."))))))
856 #:configure-flags
857 (list "--sysconfdir=/etc"
858 "--localstatedir=/var"
859 "--enable-shared" "--disable-static"
860 "--disable-build-timestamp" ; build reproducibly
861 "--enable-tcp-manager")))
862 (home-page "https://www.yadifa.eu/")
863 (synopsis "Authoritative DNS name server")
864 (description "YADIFA is an authoritative name server for the @dfn{Domain
865 Name System} (DNS). It aims for both higher performance and a smaller memory
866 footprint than other implementations, while remaining fully RFC-compliant.
867 YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
868 Extensions} (DNSSEC).")
869 (license license:bsd-3)))
870
871 (define-public knot
872 (package
873 (name "knot")
874 (version "3.1.9")
875 (source
876 (origin
877 (method git-fetch)
878 (uri (git-reference
879 (url "https://gitlab.nic.cz/knot/knot-dns")
880 (commit (string-append "v" version))))
881 (file-name (git-file-name name version))
882 (sha256
883 (base32 "0w3jyz9qgkb34gkv2lr71phk5ad3rycn86qyw7n88ryhdsk45j73"))
884 (modules '((guix build utils)))
885 (snippet
886 '(begin
887 ;; Remove Ragel-generated C files. We'll recreate them below.
888 (for-each delete-file (find-files "." "\\.c\\.[gt]."))
889 (delete-file "src/libknot/yparser/ypbody.c")
890 ;; Remove bundled library to ensure we always use the system's.
891 (delete-file-recursively "src/contrib/libbpf")))))
892 (build-system gnu-build-system)
893 (outputs (list "out" "doc" "lib" "tools"))
894 (arguments
895 `(#:configure-flags
896 (list (string-append "--docdir=" (assoc-ref %outputs "doc")
897 "/share/" ,name "-" ,version)
898 (string-append "--infodir=" (assoc-ref %outputs "doc")
899 "/share/info")
900 (string-append "--libdir=" (assoc-ref %outputs "lib") "/lib")
901 "--sysconfdir=/etc"
902 "--localstatedir=/var"
903 "--disable-static" ; static libraries are built by default
904 "--enable-dnstap" ; let tools read/write capture files
905 "--enable-fastparser" ; disabled by default when .git/ exists
906 "--enable-xdp=yes"
907 "--with-module-dnstap=yes") ; detailed query capturing & logging
908 #:phases
909 (modify-phases %standard-phases
910 (add-after 'unpack 'link-missing-libbpf-dependency
911 ;; Linking against -lbpf later would fail to find -lz: libbpf.pc has
912 ;; zlib in its Requires.private (not Requires) field. Add it here.
913 (lambda _
914 (substitute* "configure.ac"
915 (("enable_xdp=yes" match)
916 (string-append match "\nlibbpf_LIBS=\"$libbpf_LIBS -lz\"")))))
917 (add-before 'bootstrap 'update-parser
918 (lambda _
919 (with-directory-excursion "src"
920 (invoke "sh" "../scripts/update-parser.sh"))))
921 (add-before 'configure 'disable-directory-pre-creation
922 (lambda _
923 ;; Don't install empty directories like ‘/etc’ outside the store.
924 ;; This is needed even when using ‘make config_dir=... install’.
925 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))))
926 (add-after 'build 'build-info
927 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
928 (apply invoke "make" "info"
929 `(,@(if parallel-build?
930 `("-j" ,(number->string (parallel-job-count)))
931 '())
932 ,@make-flags))))
933 (replace 'install
934 (lambda* (#:key make-flags outputs parallel-build? #:allow-other-keys)
935 (let* ((out (assoc-ref outputs "out"))
936 (doc (string-append out "/share/doc/" ,name "-" ,version))
937 (etc (string-append doc "/examples/etc")))
938 (apply invoke "make" "install"
939 (string-append "config_dir=" etc)
940 `(,@(if parallel-build?
941 `("-j" ,(number->string (parallel-job-count)))
942 '())
943 ,@make-flags)))))
944 (add-after 'install 'install-info
945 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
946 (apply invoke "make" "install-info"
947 `(,@(if parallel-build?
948 `("-j" ,(number->string (parallel-job-count)))
949 '())
950 ,@make-flags))))
951 (add-after 'install 'break-circular-:lib->:out-reference
952 (lambda* (#:key outputs #:allow-other-keys)
953 (let ((lib (assoc-ref outputs "lib")))
954 (for-each (lambda (file)
955 (substitute* file
956 (("(prefix=).*" _ assign)
957 (string-append assign lib "\n"))))
958 (find-files lib "\\.pc$")))))
959 (add-after 'install 'split-:tools
960 (lambda* (#:key outputs #:allow-other-keys)
961 (let* ((out (assoc-ref outputs "out"))
962 (tools (assoc-ref outputs "tools")))
963 (mkdir-p (string-append tools "/share/man"))
964 (rename-file (string-append out "/bin")
965 (string-append tools "/bin"))
966 (rename-file (string-append out "/share/man/man1")
967 (string-append tools "/share/man/man1"))))))))
968 (native-inputs
969 (list autoconf
970 automake
971 libtool
972 pkg-config
973 python-sphinx
974 ragel
975 texinfo))
976 (inputs
977 `(("fstrm" ,fstrm)
978 ("gnutls" ,gnutls)
979 ("jansson" ,jansson)
980 ("libbpf" ,libbpf)
981 ("libcap-ng" ,libcap-ng)
982 ("libedit" ,libedit)
983 ("libelf" ,libelf)
984 ("libidn" ,libidn)
985 ("libmnl" ,libmnl)
986 ("libnghttp2" ,nghttp2 "lib")
987 ("liburcu" ,liburcu)
988 ("lmdb" ,lmdb)
989 ("ncurses" ,ncurses)
990 ("protobuf-c" ,protobuf-c)))
991 (home-page "https://www.knot-dns.cz/")
992 (synopsis "Authoritative DNS name server")
993 (description "Knot DNS is an authoritative name server for the @dfn{Domain
994 Name System} (DNS), designed to meet the needs of root and @dfn{top-level
995 domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
996 number of programming techniques to improve speed. For example, the responder
997 is completely lock-free, resulting in a very high response rate. Other features
998 include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
999 synthesis, and on-the-fly re-configuration.")
1000 (license
1001 (list
1002 ;; src/contrib/{hat-trie,murmurhash3,openbsd},
1003 ;; src/dnssec/contrib/vpool.[ch], and parts of libtap/ are ‘MIT’ (expat).
1004 license:expat
1005 license:lgpl2.0+ ; parts of scr/contrib/ucw
1006 license:public-domain ; src/contrib/fnv and possibly murmurhash3
1007 license:gpl3+)))) ; everything else
1008
1009 (define-public knot-resolver
1010 (package
1011 (name "knot-resolver")
1012 (version "5.4.4")
1013 (source (origin
1014 (method url-fetch)
1015 (uri (string-append "https://secure.nic.cz/files/knot-resolver/"
1016 "knot-resolver-" version ".tar.xz"))
1017 (sha256
1018 (base32
1019 "1sic5ccbbqml4c01dbikkg6qx1gg81nqi76cj79pjdllkqqn92aq"))))
1020 (build-system meson-build-system)
1021 (outputs '("out" "doc"))
1022 (arguments
1023 '(#:configure-flags '("-Ddoc=enabled")
1024 #:phases
1025 (modify-phases %standard-phases
1026 (add-before 'configure 'disable-default-ta
1027 (lambda _
1028 ;; Disable the default managed root TA, since we don't have
1029 ;; write access to the keyfile and its directory in store.
1030 (substitute* "daemon/lua/sandbox.lua.in"
1031 (("^trust_anchors\\.add_file.*") ""))))
1032 (add-after 'build 'build-doc
1033 (lambda _
1034 (invoke "ninja" "doc")))
1035 (add-after 'install 'move-doc
1036 (lambda* (#:key outputs #:allow-other-keys)
1037 ;; Move the manual and the example configuration files to the
1038 ;; "doc" output.
1039 (let ((out (assoc-ref outputs "out"))
1040 (doc (assoc-ref outputs "doc")))
1041 (mkdir-p (string-append doc "/share/doc/knot-resolver"))
1042 (for-each
1043 (lambda (dir)
1044 (rename-file (string-append out "/share/" dir)
1045 (string-append doc "/share/" dir)))
1046 '("doc/knot-resolver/examples"
1047 "doc/knot-resolver/html"
1048 "info")))))
1049 (add-after 'install 'wrap-binary
1050 (lambda* (#:key inputs outputs #:allow-other-keys)
1051 (let* ((out (assoc-ref outputs "out"))
1052 (lua-* (map cdr (filter
1053 (lambda (input)
1054 (string-prefix? "lua-" (car input)))
1055 inputs)))
1056 (lua-path (lambda (p)
1057 (string-append p "/share/lua/5.1/?.lua")))
1058 (lua-cpath (lambda (p)
1059 (string-append p "/lib/lua/5.1/?.so"))))
1060 (wrap-program (string-append out "/sbin/kresd")
1061 `("LUA_PATH" ";" prefix ,(map lua-path lua-*))
1062 `("LUA_CPATH" ";" prefix ,(map lua-cpath lua-*)))))))))
1063 (native-inputs
1064 (list cmocka ; for unit tests
1065 doxygen
1066 protobuf-c
1067 pkg-config
1068 python-breathe
1069 python-sphinx
1070 python-sphinx-rtd-theme
1071 texinfo))
1072 (inputs
1073 `(("fstrm" ,fstrm)
1074 ("gnutls" ,gnutls)
1075 ("knot:lib" ,knot "lib")
1076 ("libuv" ,libuv)
1077 ("lmdb" ,lmdb)
1078 ("luajit" ,luajit)
1079 ;; TODO: Add optional lua modules: basexx and psl.
1080 ("lua-bitop" ,lua5.1-bitop)
1081 ("nghttp2" ,nghttp2 "lib")
1082 ("python" ,python)))
1083 (home-page "https://www.knot-resolver.cz/")
1084 (synopsis "Caching validating DNS resolver")
1085 (description
1086 "Knot Resolver is a caching full resolver implementation written in C and
1087 LuaJIT, both a resolver library and a daemon.")
1088 (license (list license:gpl3+
1089 ;; Some 'contrib' files are under MIT, CC0 and LGPL2.
1090 license:expat
1091 license:cc0
1092 license:lgpl2.0))))
1093
1094 (define-public ddclient
1095 (package
1096 (name "ddclient")
1097 (version "3.9.1")
1098 (source
1099 (origin
1100 (method git-fetch)
1101 (uri (git-reference
1102 (url "https://github.com/ddclient/ddclient")
1103 (commit (string-append "v" version))))
1104 (file-name (git-file-name name version))
1105 (sha256
1106 (base32 "0hf377g4j9r9sac75xp17nk2h58mazswz4vkg4g2gl2yyhvzq91w"))))
1107 (build-system trivial-build-system) ; no Makefile.PL
1108 (native-inputs
1109 (list bash perl))
1110 (inputs
1111 (list inetutils ; logger
1112 net-tools
1113 perl-data-validate-ip
1114 perl-digest-sha1
1115 perl-io-socket-ssl))
1116 (arguments
1117 `(#:modules ((guix build utils))
1118 #:builder
1119 (begin
1120 (use-modules (guix build utils)
1121 (ice-9 match)
1122 (srfi srfi-26))
1123 (setenv "PATH" (string-append
1124 (assoc-ref %build-inputs "bash") "/bin" ":"
1125 (assoc-ref %build-inputs "perl") "/bin"))
1126
1127 ;; Copy the (read-only) source into the (writable) build directory.
1128 (copy-recursively (assoc-ref %build-inputs "source") ".")
1129
1130 ;; Install.
1131 (let* ((out (assoc-ref %outputs "out"))
1132 (bin (string-append out "/bin")))
1133 (let ((file "ddclient"))
1134 (substitute* file
1135 (("/usr/bin/perl") (which "perl"))
1136 ;; Strictly use ‘/etc/ddclient/ddclient.conf’.
1137 (("\\$\\{program\\}\\.conf") "/etc/ddclient/ddclient.conf")
1138 (("\\$etc\\$program.conf") "/etc/ddclient/ddclient.conf")
1139 ;; Strictly use ‘/var/cache/ddclient/ddclient.cache’
1140 (("\\$cachedir\\$program\\.cache")
1141 "/var/cache/ddclient/ddclient.cache"))
1142 (install-file file bin)
1143 (wrap-program (string-append bin "/" file)
1144 `("PATH" ":" =
1145 ("$PATH"
1146 ,@(map (lambda (input)
1147 (match input
1148 ((name . store)
1149 (string-append store "/bin"))))
1150 %build-inputs)))
1151 `("PERL5LIB" ":" =
1152 ,(delete
1153 ""
1154 (map (match-lambda
1155 (((? (cut string-prefix? "perl-" <>) name) . dir)
1156 (string-append dir "/lib/perl5/site_perl"))
1157 (_ ""))
1158 %build-inputs)))))
1159 (for-each (cut install-file <> (string-append out
1160 "/share/ddclient"))
1161 (find-files "." "sample.*$"))))))
1162 (home-page "https://ddclient.net/")
1163 (synopsis "Address updating utility for dynamic DNS services")
1164 (description "This package provides a client to update dynamic IP
1165 addresses with several dynamic DNS service providers, such as
1166 @uref{https://www.dyndns.com/account/login.html,DynDNS.com}.
1167
1168 This makes it possible to use a fixed hostname (such as myhost.dyndns.org) to
1169 access a machine with a dynamic IP address.
1170
1171 The client supports both dynamic and (near) static services, as well as MX
1172 record and alternative name management. It caches the address, and only
1173 attempts the update when it has changed.")
1174 (license license:gpl2+)))
1175
1176 (define-public hnsd
1177 (package
1178 (name "hnsd")
1179 (version "1.0.0")
1180 (source (origin
1181 (method git-fetch)
1182 (uri (git-reference
1183 (url "https://github.com/handshake-org/hnsd")
1184 (commit (string-append "v" version))))
1185 (sha256
1186 (base32
1187 "1kdgff8rf8gmvwz2p758ilbjxpvz4xm6z41pa5353asg6xb853bb"))
1188 (file-name (git-file-name name version))
1189 (modules '((guix build utils)))
1190 (snippet
1191 '(begin
1192 ;; Delete the bundled copy of libuv.
1193 (delete-file-recursively "uv")
1194 (substitute* "configure.ac"
1195 (("AC_CONFIG_SUBDIRS\\(\\[uv\\]\\)") ""))
1196 (substitute* "Makefile.am"
1197 (("SUBDIRS = uv") "\n")
1198 (("\\$\\(top_builddir\\)/uv/libuv.la") "-luv")
1199
1200 ;; Make sure the 'hnsd' binary is installed and
1201 ;; dynamically-linked.
1202 (("noinst_PROGRAMS") "bin_PROGRAMS")
1203 (("hnsd_LDFLAGS = -static") ""))
1204
1205 ;; This script tries to chdir to "uv" and doesn't do more
1206 ;; than "autoreconf" so remove it.
1207 (delete-file "autogen.sh")
1208 #t))))
1209 (build-system gnu-build-system)
1210 (arguments
1211 '(#:configure-flags '("--disable-static"))) ;no need for libhsk.a
1212 (native-inputs
1213 (list autoconf automake libtool))
1214 (inputs
1215 (list unbound libuv))
1216 (home-page "https://www.handshake.org/")
1217 (synopsis "Resolver daemon for the Handshake naming protocol")
1218 (description
1219 "@command{hnsd} is a @dfn{host name resolver} for the Handshake Naming
1220 System (HNS) peer-to-peer network.")
1221 (license license:expat)))
1222
1223 (define-public libmicrodns
1224 (package
1225 (name "libmicrodns")
1226 (version "0.1.2")
1227 (source (origin
1228 (method url-fetch)
1229 (uri (string-append "https://github.com/videolabs/libmicrodns/"
1230 "releases/download/" version "/microdns-"
1231 version ".tar.xz"))
1232 (sha256
1233 (base32
1234 "0p4va18zxgmzcdwhlbg2mmjwswlbgqy4ay5vaxrw7cxmhsflnv36"))))
1235 (build-system meson-build-system)
1236 (home-page "https://github.com/videolabs/libmicrodns")
1237 (synopsis "Minimal mDNS resolver library")
1238 (description "@code{libmicrodns} provides a minimal implementation of a
1239 mDNS resolver as well as an announcer. mDNS (Multicast Domain Name System) is
1240 a zero-config service that allows one to resolve host names to IP addresses in
1241 local networks.")
1242 (license license:lgpl2.1)))
1243
1244 (define-public public-suffix-list
1245 ;; Mozilla releases the official list here:
1246 ;;
1247 ;; https://publicsuffix.org/list/public_suffix_list.dat
1248 ;;
1249 ;; However, Mozilla syncs that file from the GitHub repository periodically,
1250 ;; so its contents will change over time. If you update this commit, please
1251 ;; make sure that the new commit refers to a list which is identical to the
1252 ;; officially published list available from the URL above.
1253 (let ((commit "9375b697baddb0827a5995c81bd3c75877a0b35d"))
1254 (package
1255 (name "public-suffix-list")
1256 (version (git-version "0" "1" commit))
1257 (source (origin
1258 (method git-fetch)
1259 (uri (git-reference
1260 (url "https://github.com/publicsuffix/list")
1261 (commit commit)))
1262 (file-name (git-file-name name version))
1263 (sha256
1264 (base32
1265 "1sm7pni01rnl4ldzi8z8nc4cbgq8nxda9gwc68v0s3ij7jd1jmik"))))
1266 (build-system trivial-build-system)
1267 (arguments
1268 `(#:modules ((guix build utils))
1269 #:builder
1270 (begin
1271 (use-modules (guix build utils))
1272 (let* ((out (assoc-ref %outputs "out"))
1273 ;; Install to /share because that is where "read-only
1274 ;; architecture-independent data files" should go (see:
1275 ;; (standards) Directory Variables). Include the version in
1276 ;; the directory name so that if multiple versions are ever
1277 ;; installed in the same profile, they will not conflict.
1278 (destination (string-append
1279 out "/share/public-suffix-list-" ,version))
1280 (source (assoc-ref %build-inputs "source")))
1281 (with-directory-excursion source
1282 (install-file "public_suffix_list.dat" destination)
1283 (install-file "LICENSE" destination))
1284 #t))))
1285 (home-page "https://publicsuffix.org/")
1286 (synopsis "Database of current and historical DNS suffixes")
1287 (description "This is the Public Suffix List maintained by Mozilla. A
1288 \"public suffix\" is one under which Internet users can (or historically
1289 could) directly register names in the Domain Name System (DNS). Some examples
1290 of public suffixes are .com, .co.uk and pvt.k12.ma.us. This is a list of all
1291 known public suffixes.")
1292 (license license:mpl2.0))))
1293
1294 (define-public maradns
1295 (package
1296 (name "maradns")
1297 (version "3.5.0020")
1298 (source
1299 (origin
1300 (method url-fetch)
1301 (uri (string-append "https://maradns.samiam.org/download/"
1302 (version-major+minor version) "/"
1303 version "/maradns-" version ".tar.xz"))
1304 (sha256
1305 (base32 "1qgabw6y2bwy6y88dikis62k789i0xh7iwxan8jmqpzvksqwjfgw"))))
1306 (build-system gnu-build-system)
1307 (arguments
1308 `(#:tests? #f ; need to be root to run tests
1309 #:make-flags
1310 (list
1311 ,(string-append "CC=" (cc-for-target))
1312 (string-append "PREFIX=" %output)
1313 (string-append "RPM_BUILD_ROOT=" %output))
1314 #:phases
1315 (modify-phases %standard-phases
1316 (replace 'configure
1317 (lambda* (#:key native-inputs target #:allow-other-keys)
1318 ;; make_32bit_tables generates a header file that is used during
1319 ;; compilation. Hence, during cross compilation, it should be
1320 ;; built for the host system.
1321 (when target
1322 (substitute* "rng/Makefile"
1323 (("\\$\\(CC\\) -o make_32bit_tables")
1324 (string-append (assoc-ref native-inputs "gcc")
1325 "/bin/gcc -o make_32bit_tables"))))
1326 (invoke "./configure")))
1327 (add-before 'install 'create-install-directories
1328 (lambda* (#:key outputs #:allow-other-keys)
1329 (let ((out (assoc-ref outputs "out")))
1330 (for-each (lambda (dir)
1331 (mkdir-p (string-append out dir)))
1332 (list "/bin" "/sbin" "/etc"
1333 "/share/man/man1"
1334 "/share/man/man5"
1335 "/share/man/man8"))
1336 #t))))))
1337 (home-page "https://maradns.samiam.org")
1338 (synopsis "Small lightweight DNS server")
1339 (description "MaraDNS is a small and lightweight DNS server. MaraDNS
1340 consists of a UDP-only authoritative DNS server for hosting domains, and a UDP
1341 and TCP-capable recursive DNS server for finding domains on the internet.")
1342 (license license:bsd-2)))
1343
1344 (define-public openresolv
1345 (package
1346 (name "openresolv")
1347 (version "3.12.0")
1348 (source (origin
1349 (method url-fetch)
1350 (uri (string-append "https://roy.marples.name/downloads/openresolv/"
1351 "openresolv-" version ".tar.xz"))
1352 (sha256
1353 (base32
1354 "15qvp5va2yrqpz0ba54clvn8cbc66v4sl7k3bi9ji8jpx040bcs2"))
1355 (patches
1356 (search-patches "openresolv-restartcmd-guix.patch"))))
1357 (build-system gnu-build-system)
1358 (arguments
1359 `(#:tests? #f ; No test suite
1360 #:configure-flags
1361 (list (string-append "--sysconfdir=/etc"))
1362 #:make-flags
1363 (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))
1364 #:phases
1365 (modify-phases %standard-phases
1366 (add-after 'install 'wrap-program
1367 (lambda* (#:key inputs outputs #:allow-other-keys)
1368 (let ((out (assoc-ref outputs "out"))
1369 (coreutils (assoc-ref inputs "coreutils-minimal")))
1370 (substitute* (string-append out "/sbin/resolvconf")
1371 (("RESOLVCONF=\"\\$0\"")
1372 (format #f "\
1373 RESOLVCONF=\"$0\"
1374 PATH=~a/bin:$PATH"
1375 coreutils)))))))))
1376 (inputs
1377 (list coreutils-minimal))
1378 (home-page "https://roy.marples.name/projects/openresolv/")
1379 (synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
1380 (description "openresolv is an implementation of @command{resolvconf}, the
1381 middleman between the network configuration services and
1382 @file{/etc/resolv.conf}. @command{resolvconf} itself is just a script that
1383 stores, removes and lists a full @file{resolv.conf} generated for the
1384 interface. It then calls all the helper scripts it knows about so it can
1385 configure the real @file{/etc/resolv.conf} and optionally any local
1386 nameservers other than libc.")
1387 (license license:bsd-2)))