doc: Add 'Debugging Build Failures' node.
[jackhill/guix/guix.git] / gnu / packages / dns.scm
CommitLineData
dd2efd3d
TUBK
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
d912db5b 3;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
b2844d8f 4;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
0d88031c 5;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
be86b7ad 6;;; Copyright © 2016 John Darrington <jmd@gnu.org>
71f048c6 7;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
f9cdf1c1 8;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me@tobias.gr>
afe62a8b 9;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
dd2efd3d
TUBK
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
36fb36b5 26(define-module (gnu packages dns)
f9cdf1c1 27 #:use-module (gnu packages admin)
71f048c6 28 #:use-module (gnu packages autotools)
6cf626e8 29 #:use-module (gnu packages base)
1e744399 30 #:use-module (gnu packages databases)
afe62a8b 31 #:use-module (gnu packages crypto)
f9cdf1c1 32 #:use-module (gnu packages datastructures)
cb6d322a 33 #:use-module (gnu packages glib)
71f048c6 34 #:use-module (gnu packages groff)
f9cdf1c1
TGR
35 #:use-module (gnu packages groff)
36 #:use-module (gnu packages libedit)
afe62a8b 37 #:use-module (gnu packages libevent)
f9cdf1c1 38 #:use-module (gnu packages libidn)
1e744399 39 #:use-module (gnu packages linux)
f9cdf1c1
TGR
40 #:use-module (gnu packages ncurses)
41 #:use-module (gnu packages nettle)
1e744399 42 #:use-module (gnu packages perl)
71f048c6 43 #:use-module (gnu packages pkg-config)
a7fd7b68 44 #:use-module (gnu packages tls)
f9cdf1c1 45 #:use-module (gnu packages web)
1e744399
46 #:use-module (gnu packages xml)
47 #:use-module ((guix licenses) #:prefix license:)
dd2efd3d
TUBK
48 #:use-module (guix packages)
49 #:use-module (guix download)
50 #:use-module (guix build-system gnu))
51
52(define-public dnsmasq
53 (package
54 (name "dnsmasq")
c99bf9b2 55 (version "2.76")
dd2efd3d
TUBK
56 (source (origin
57 (method url-fetch)
58 (uri (string-append
59 "http://www.thekelleys.org.uk/dnsmasq/dnsmasq-"
60 version ".tar.xz"))
61 (sha256
62 (base32
c99bf9b2 63 "15lzih6671gh9knzpl8mxchiml7z5lfqzr7jm2r0rjhrxs6nk4jb"))))
dd2efd3d 64 (build-system gnu-build-system)
cb6d322a
CB
65 (native-inputs
66 `(("pkg-config" ,pkg-config)))
67 (inputs
68 `(("dbus" ,dbus)))
dd2efd3d
TUBK
69 (arguments
70 `(#:phases
71 (alist-delete 'configure %standard-phases)
72 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
cb6d322a
CB
73 "CC=gcc"
74 "COPTS=\"-DHAVE_DBUS\"")
dd2efd3d
TUBK
75 ;; No 'check' target.
76 #:tests? #f))
77 (home-page "http://www.thekelleys.org.uk/dnsmasq/doc.html")
78 (synopsis "Small caching DNS proxy and DHCP/TFTP server")
79 (description
80 "Dnsmasq is a lightweight DNS forwarder and DHCP server. It is designed
81to provide DNS and optionally, DHCP, to a small network. It can serve the
82names of local machines which are not in the global DNS. The DHCP server
83integrates with the DNS server and allows machines with DHCP-allocated
84addresses to appear in the DNS with names configured either in each host or in
85a central configuration file. Dnsmasq supports static and dynamic DHCP leases
86and BOOTP/TFTP for network booting of diskless machines.")
87 ;; Source files only say GPL2 and GPL3 are allowed.
1e744399
88 (license (list license:gpl2 license:gpl3))))
89
be86b7ad 90(define-public bind
1e744399 91 (package
be86b7ad 92 (name "bind")
61b64acf 93 (version "9.10.4-P8")
1e744399
94 (source (origin
95 (method url-fetch)
be86b7ad
JD
96 (uri (string-append
97 "ftp://ftp.isc.org/isc/bind9/" version "/" name "-"
98 version ".tar.gz"))
1e744399
99 (sha256
100 (base32
61b64acf 101 "1sv6fp5gznjj1kmx9q8wr2c6js10wqckgy25sqj83bbf8smmdlvx"))))
1e744399 102 (build-system gnu-build-system)
be86b7ad 103 (outputs `("out" "utils"))
1e744399
104 (inputs
105 ;; it would be nice to add GeoIP and gssapi once there is package
106 `(("libcap" ,libcap)
107 ("libxml2" ,libxml2)
1e744399 108 ("openssl" ,openssl)
1e744399 109 ("p11-kit" ,p11-kit)))
be86b7ad
JD
110 (native-inputs `(("perl" ,perl)
111 ("net-tools" ,net-tools)))
1e744399 112 (arguments
be86b7ad 113 `(#:configure-flags
1e744399
114 (list (string-append "--with-openssl="
115 (assoc-ref %build-inputs "openssl"))
1e744399
116 (string-append "--with-pkcs11="
117 (assoc-ref %build-inputs "p11-kit")))
118 #:phases
be86b7ad
JD
119 (modify-phases %standard-phases
120 (add-after 'strip 'move-to-utils
121 (lambda _
122 (for-each
123 (lambda (file)
124 (let ((target (string-append (assoc-ref %outputs "utils") file))
125 (src (string-append (assoc-ref %outputs "out") file)))
126 (mkdir-p (dirname target))
127 (link src target)
128 (delete-file src)))
129 '("/bin/dig" "/bin/delv" "/bin/nslookup" "/bin/host" "/bin/nsupdate"
130 "/share/man/man1/dig.1"
131 "/share/man/man1/host.1"
132 "/share/man/man1/nslookup.1"
133 "/share/man/man1/nsupdate.1"))))
134 ;; When and if guix provides user namespaces for the build process,
135 ;; then the following can be uncommented and the subsequent "force-test"
136 ;; will not be necessary.
137 ;;
138 ;; (add-before 'check 'set-up-loopback
139 ;; (lambda _
140 ;; (system "bin/tests/system/ifconfig.sh up")))
141 (replace 'check
142 (lambda _
143 (zero? (system* "make" "force-test")))))))
144 (synopsis "An implementation of the Domain Name System")
366efcb2
TGR
145 (description "BIND is an implementation of the @dfn{Domain Name System}
146(DNS) protocols for the Internet. It is a reference implementation of those
be86b7ad
JD
147protocols, but it is also production-grade software, suitable for use in
148high-volume and high-reliability applications. The name BIND stands for
149\"Berkeley Internet Name Domain\", because the software originated in the early
1501980s at the University of California at Berkeley.")
151 (home-page "https://www.isc.org/downloads/bind")
1e744399 152 (license (list license:isc))))
be86b7ad 153
d24727c0
MB
154(define-public dnscrypt-proxy
155 (package
156 (name "dnscrypt-proxy")
602d70f3 157 (version "1.9.4")
d24727c0
MB
158 (source (origin
159 (method url-fetch)
160 (uri (string-append
161 "https://download.dnscrypt.org/dnscrypt-proxy/"
162 "dnscrypt-proxy-" version ".tar.bz2"))
163 (sha256
164 (base32
602d70f3 165 "07piwsjczamwvdpv1585kg4awqakip51bwsm8nqi6bljww4agx7x"))
d24727c0
MB
166 (modules '((guix build utils)))
167 (snippet
168 ;; Delete bundled libltdl. XXX: This package also bundles
169 ;; a modified libevent that cannot currently be removed.
170 '(delete-file-recursively "libltdl"))))
171 (build-system gnu-build-system)
172 (arguments
173 `(#:phases
174 (modify-phases %standard-phases
175 (add-before 'configure 'autoreconf
176 (lambda _
177 ;; Re-generate build files due to unbundling ltdl.
178 ;; TODO: Prevent generating new libltdl and building it.
179 ;; The system version is still favored and referenced.
180 (zero? (system* "autoreconf" "-vif")))))))
181 (native-inputs
182 `(("pkg-config" ,pkg-config)
183 ("automake" ,automake)
184 ("autoconf" ,autoconf)
185 ("libtool" ,libtool)))
186 (inputs
187 `(("libltdl" ,libltdl)
188 ("libsodium" ,libsodium)))
189 (home-page "https://www.dnscrypt.org/")
190 (synopsis "Securely send DNS requests to a remote server")
191 (description
192 "@command{dnscrypt-proxy} is a tool for securing communications
193between a client and a DNS resolver. It verifies that responses you get
194from a DNS provider was actually sent by that provider, and haven't been
195tampered with. For optimal performance it is recommended to use this as
196a forwarder for a caching DNS resolver such as @command{dnsmasq}, but it
197can also be used as a normal DNS \"server\". A list of public dnscrypt
198servers is included, and an up-to-date version is available at
199@url{https://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-resolvers.csv}.")
200 (license (list license:isc
201 ;; Libevent and src/ext/queue.h is 3-clause BSD.
202 license:bsd-3))))
203
afe62a8b
MB
204(define-public dnscrypt-wrapper
205 (package
206 (name "dnscrypt-wrapper")
207 (version "0.2.2")
208 (source (origin
209 (method url-fetch)
210 (uri (string-append
211 "https://github.com/cofyc/dnscrypt-wrapper/releases"
212 "/download/v" version "/" name "-v" version ".tar.bz2"))
213 (sha256
214 (base32
215 "1vhg4g0r687f51wcdn7z9w1hxapazx6vyh5rsr8wa48sljzd583g"))))
216 (build-system gnu-build-system)
217 (arguments
218 `(#:make-flags '("CC=gcc")
219 ;; TODO: Tests require ruby-cucumber and ruby-aruba.
220 #:tests? #f
221 #:phases
222 (modify-phases %standard-phases
223 (add-before 'configure 'create-configure
224 (lambda _
225 (zero? (system* "make" "configure")))))))
226 (native-inputs
227 `(("autoconf" ,autoconf)))
228 (inputs
229 `(("libevent" ,libevent)
230 ("libsodium" ,libsodium)))
231 (home-page "https://github.com/Cofyc/dnscrypt-wrapper")
232 (synopsis "Server-side dnscrypt proxy")
233 (description
234 "@command{dnscrypt-wrapper} is a tool to expose a name server over
235the @code{dnscrypt} protocol. It can be used as an endpoint for the
236@command{dnscrypt-proxy} client to securely tunnel DNS requests between
237the two.")
238 (license (list license:isc
239 ;; Bundled argparse is MIT. TODO: package and unbundle.
240 license:expat
241 ;; dns-protocol.h and rfc1035.{c,h} is gpl2 or gpl3 (either).
242 license:gpl2
243 license:gpl3))))
244
71f048c6 245(define-public libasr
246 (package
247 (name "libasr")
248 (version "201602131606")
249 (source
250 (origin
251 (method url-fetch)
252 (uri (string-append "https://www.opensmtpd.org/archives/"
253 name "-" version ".tar.gz"))
254 (sha256
255 (base32
256 "18kdmbjsxrfai16d66qslp48b1zf7gr8him2jj5dcqgbsl44ls75"))))
257 (build-system gnu-build-system)
258 (native-inputs
259 `(("autoconf" ,autoconf)
260 ("automake" ,automake)
261 ("pkg-config" ,pkg-config)
262 ("groff" ,groff)))
263 (home-page "https://www.opensmtpd.org")
264 (synopsis "Asynchronous resolver library by the OpenBSD project")
265 (description
266 "libasr is a free, simple and portable asynchronous resolver library.
267It allows to run DNS queries and perform hostname resolutions in a fully
268asynchronous fashion.")
269 (license (list license:isc
270 license:bsd-2 ; last part of getrrsetbyname_async.c
271 license:bsd-3
272 (license:non-copyleft "file://LICENSE") ; includes.h
273 license:openssl))))
6cf626e8
TGR
274
275(define-public yadifa
276 (package
277 (name "yadifa")
9b9cc951 278 (version "2.2.4")
6cf626e8 279 (source
9b9cc951 280 (let ((revision "6924"))
8769d482
TGR
281 (origin
282 (method url-fetch)
283 (uri
284 (string-append "http://cdn.yadifa.eu/sites/default/files/releases/"
285 name "-" version "-" revision ".tar.gz"))
286 (sha256
287 (base32
9b9cc951 288 "060ydcfn9876bs6p5xi3p1k20ca547f4jck25r5x1hnxjlv7ss03")))))
6cf626e8
TGR
289 (build-system gnu-build-system)
290 (native-inputs
291 `(("which" ,which)))
292 (inputs
293 `(("openssl" ,openssl)))
294 (arguments
295 `(#:phases (modify-phases %standard-phases
296 (add-before 'configure 'omit-example-configurations
2d431b01
TGR
297 (lambda _
298 (substitute* "Makefile.in"
299 ((" (etc|var)") ""))
300 #t)))
6cf626e8
TGR
301 #:configure-flags (list "--sysconfdir=/etc" "--localstatedir=/var"
302 "--enable-shared" "--disable-static"
303 "--enable-messages" "--enable-ctrl"
4d2fd1c0
TGR
304 "--enable-nsec" "--enable-nsec3"
305 "--enable-tsig" "--enable-caching"
6cf626e8
TGR
306 ;; NSID is a rarely-used debugging aid, that also
307 ;; causes the build to fail. Just disable it.
308 "--disable-nsid")))
309 (home-page "http://www.yadifa.eu/")
310 (synopsis "Authoritative DNS name server")
366efcb2
TGR
311 (description "YADIFA is an authoritative name server for the @dfn{Domain
312Name System} (DNS). It aims for both higher performance and a smaller memory
6cf626e8 313footprint than other implementations, while remaining fully RFC-compliant.
366efcb2
TGR
314YADIFA supports dynamic record updates and the @dfn{Domain Name System Security
315Extensions} (DNSSEC).")
6cf626e8 316 (license license:bsd-3)))
f9cdf1c1
TGR
317
318(define-public knot
319 (package
320 (name "knot")
d4bcbbb9 321 (version "2.4.3")
f9cdf1c1
TGR
322 (source (origin
323 (method url-fetch)
324 (uri (string-append "https://secure.nic.cz/files/knot-dns/"
325 name "-" version ".tar.xz"))
326 (sha256
327 (base32
d4bcbbb9 328 "0kvhibnnk77nqi9gdw2zbnp0dydfcy6zy96qv0f3a7wwnay5h0pr"))
f9cdf1c1
TGR
329 (modules '((guix build utils)))
330 (snippet
331 '(begin
332 ;; Remove bundled libraries and dependencies on them.
333 (substitute* "configure"
334 (("src/contrib/dnstap/Makefile") ""))
335 (substitute* "src/Makefile.in"
336 (("contrib/dnstap ") ""))
337 (with-directory-excursion "src/contrib"
338 (for-each delete-file-recursively
2d431b01
TGR
339 (list "dnstap" "lmdb")))
340 #t))))
f9cdf1c1
TGR
341 (build-system gnu-build-system)
342 (native-inputs
343 `(("pkg-config" ,pkg-config)))
344 (inputs
345 `(("gnutls" ,gnutls)
346 ("jansson" ,jansson)
347 ("libcap-ng" ,libcap-ng)
348 ("libedit" ,libedit)
349 ("libidn" ,libidn)
350 ("liburcu" ,liburcu)
351 ("lmdb" ,lmdb)
352 ("ncurses" ,ncurses)
353 ("nettle" ,nettle)))
354 (arguments
355 `(#:phases
356 (modify-phases %standard-phases
357 (add-before 'configure 'disable-directory-pre-creation
358 (lambda _
359 ;; Don't install empty directories like ‘/etc’ outside the store.
2d431b01
TGR
360 (substitute* "src/Makefile.in" (("\\$\\(INSTALL\\) -d") "true"))
361 #t))
f9cdf1c1
TGR
362 (replace 'install
363 (lambda* (#:key outputs #:allow-other-keys)
364 (let* ((out (assoc-ref outputs "out"))
365 (doc (string-append out "/share/doc/knot"))
366 (etc (string-append doc "/examples/etc")))
367 (zero?
368 (system* "make"
369 (string-append "config_dir=" etc)
370 "install"))))))
371 #:configure-flags
372 (list "--sysconfdir=/etc"
373 "--localstatedir=/var"
374 "--enable-rosedb" ; serve static records from a database
375 (string-append "--with-bash-completions="
376 (assoc-ref %outputs "out")
377 "/etc/bash_completion.d"))))
378 (home-page "https://www.knot-dns.cz/")
379 (synopsis "Authoritative DNS name server")
d1e4ad1b 380 (description "Knot DNS is an authoritative name server for the @dfn{Domain
f9cdf1c1
TGR
381Name System} (DNS), designed to meet the needs of root and @dfn{top-level
382domain} (TLD) name servers. It is implemented as a threaded daemon and uses a
383number of programming techniques to improve speed. For example, the responder
384is completely lock-free, resulting in a very high response rate. Other features
385include automatic @dfn{DNS Security Extensions} (DNSSEC) signing, dynamic record
386synthesis, and on-the-fly re-configuration.")
387 (license (list license:expat ; src/contrib/{hat-trie,murmurhash3}
388 license:lgpl2.0+ ; parts of scr/contrib/ucw
389 license:gpl3+)))) ; everything else