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