1MARADNS(8) MaraDNS reference MARADNS(8)
2
3
4
5Erre con erre cigarro
6Erre con erre barril
7Rápido ruedan los carros
8En el ferrocarril
9
11 maradns - DNS server
12
14 maradns [ -v | -f mararc_file_location ]
15
17 This man page has the following sections:
18
19 Name
20 Synopsis
21 Table of Contents
22 Description
23 Usage
24 Firewall Configuration
25 Frequently Asked Questions
26 Bugs
27 Unimplemented Features
28 Legal Disclaimer
29 Authors
30
32 maradns is a DNS server written with security, simplicity, and
33 performance in mind.
34
35 maradns has two forms of arguments, both of which are optional.
36
37 The first is the location of a mararc file which MaraDNS obtains all
38 configuration information from. The default location of this file is
39 /etc/mararc. This is specified in the form maradns -f
40 mararc_file_location;
41
42 mararc_file_location is the location of the mararc file.
43
44 It is also possible to have MaraDNS display the version number and
45 exit. This is specified by invoking maradns in the form maradns -v or
46 maradns --version
47
49 MaraDNS consists of two programs: maradns, an authoritative-only
50 nameserver, and Deadwood, a recursive name server. Deadwood has its own
51 man page.
52
53 In order for MaraDNS to function as an authoritative nameserver, two or
54 more files need to be set up: the mararc file and one or more "csv2"
55 (or "csv1") zone files.
56
57 The format of a csv2 zone file can be obtained from the csv2(5) manual
58 page. The configuration format of the mararc file can be obtained from
59 the mararc(5) manual page.
60
61 Please note that, in order to reload a zone file, it is necessary to
62 restart MaraDNS and reload all zone files. MaraDNS uses a hash data
63 format which loads records very quickly from memory, but requires a
64 restart to update.
65
66 In order to have MaraDNS run as a daemon, the duende program is used to
67 daemonize MaraDNS. See the duende(8) manual page for details.
68
70 When using the maradns authoritative nameserver, allow UDP connections
71 from all hosts on the internet to UDP port 53 for the IP that the
72 authoritative nameserver uses.
73
74 When using the Deadwood recursive nameserver:
75
76 * Allow UDP connections from the Deadwood server to any machine on the
77 internet where the UDP destination port is 53
78
79 * Allow UDP connections from any machine on the internet to the IP of
80 the recursive server, where the source port from the remote server is
81 53, and the destination port is between 15000 and 19095 (inclusive)
82
83 * Allow UDP connections from IPs that use Deadwood as a recursive DNS
84 server to port 53
85
86 Deadwood uses a strong secure RNG (RadioGatun[32]) for both the query
87 (16 bits of entropy) and the source port of the query (12 bits of
88 entropy). This makes spoofing replies to a Deadwood recursive server
89 more difficult, since the attacker has only a one in 250 million chance
90 that a given spoofed reply will be considered valid.
91
93 INDEX
94
95 1. I'm using an older version of MaraDNS
96
97 2. How do I try out MaraDNS?
98
99 3. What license is MaraDNS released under?
100
101 4. How do I report bugs in MaraDNS?
102
103 5. Some of the postings to the mailing list do not talk about
104 MaraDNS!
105
106 6. How do I get off the mailing list?
107
108 7. How do I set up reverse DNS on MaraDNS?
109
110 8. I am on a slow network, and MaraDNS can not process recursive
111 queries
112
113 9. When I try to run MaraDNS, I get a cryptic error message.
114
115 10. After I start MaraDNS, I can not see the process when I run
116 netstat -na
117
118 11. What string library does MaraDNS use?
119
120 12. Why does MaraDNS use a multi-threaded model?
121
122 13. I feel that XXX feature should be added to MaraDNS
123
124 14. I feel that MaraDNS should use another documentation format
125
126 15. Is there any process I need to follow to add a patch to
127 MaraDNS?
128
129 16. Can MaraDNS act as a primary nameserver?
130
131 17. Can MaraDNS act as a secondary nameserver?
132
133 18. What is the difference between an authoritative and a recursive
134 DNS server?
135
136 19. The getzone client isn't allowing me to add certain hostnames
137 to my zone
138
139 20. Is MaraDNS portable?
140
141 21. Can I use MaraDNS in Windows?
142
143 22. MaraDNS freezes up after being used for a while
144
145 23. What kind of Python integration does MaraDNS have
146
147 24. Doesn't "kvar" mean "four" in Esperanto?
148
149 25. How scalable is MaraDNS?
150
151 26. I am having problems setting upstream_servers
152
153 27. Why doesn't the MaraDNS.org web page validate?
154
155 28. How do MX records work?
156
157 29. Does MaraDNS have support for SPF?
158
159 30. I'm having problems resolving CNAMES I have set up.
160
161 31. I have a NS delegation, and MaraDNS is doing strange things.
162
163 32. I am transferring a zone from another server, but the NS
164 records are these strange "synth-ip" records.
165
166 33. Where is the root.hints file?
167
168 34. Are there any plans to use autoconf to build MaraDNS?
169
170 35. How do I change the compiler or compile-time flags with
171 MaraDNS' build process?
172
173 36. Will you make a package for the particular Linux distribution I
174 am using?
175
176 37. I am using the native Windows port of MaraDNS, and some
177 features are not working.
178
179 38. MaraDNS isn't starting up
180
181 39. You make a lot of releases of MaraDNS; at our ISP/IT
182 department, updating software is non-trivial.
183
184 40. I have star records in my zones, and am having problems with
185 NXDOMAINs/IPV6 resolution
186
187 41. I have a zone with only SOA/NS records, and the zone is not
188 working.
189
190 42. I am having problems registering my domain with AFNIC (the
191 registrar for .fr domains)
192
193 43. I can't see the full answers for subdomains I have delegated
194
195 44. MaraDNS 1 has a problem resolving a domain
196
197 45. MaraDNS 1.2 has issues with NXDOMAINS and case sensitivity.
198
199 46. Can MaraDNS offer protection from phishing and malicious sites?
200
201 47. Does maradns support star (wildcard) records?
202
203 48. I'm having problems using MaraDNS with some *NIX command line
204 applications like telnet
205
206 49. My virus scanner reports that MaraDNS or Deadwood has a virus
207
208 50. I can not subscribe to the MaraDNS mailing list
209
210 51. How does MaraDNS respond to EDNS (RFC2671) packets?
211
212 52. How to I get MaraDNS to always give the same IP to all DNS
213 queries?
214
215 53. Why did you change MaraDNS' tagline?
216
217 54. How do you stop MaraDNS from taking part in a distributed
218 denial-of-service attack?
219
220 55. What about DNS-over-TCP?
221
222 56. How do I use MaraDNS with systemd?
223
224 57. Why doesn't MaraDNS use IP_FREEBIND?
225
226 58. Is there a web interface for MaraDNS?
227
228 59. What does the message “don’t forget the trailing dot” mean?
229
230 60. Does MaraDNS support newer top level domains?
231
232 61. Can MaraDNS handle IDN domain names?
233
234 ANSWERS
235
236 1. I'm using an older version of MaraDNS
237
238 Upgrade to MaraDNS 2.0. Here is an upgrade guide.
239
240 MaraDNS 1 is no longer supported; support ended on June 21, 2015.
241
242 2. How do I try out MaraDNS?
243
244 Read the quick start guide, which is the file named 0QuickStart in the
245 MaraDNS distribution.
246
247 3. What license is MaraDNS released under?
248
249 MaraDNS is released with the following two-clause BSD-type license:
250
251 Copyright (c) 2002-2016 Sam Trenholme and others
252
253 TERMS
254
255 Redistribution and use in source and binary forms, with or without
256 modification, are permitted provided that the following conditions
257 are met:
258
259 1. Redistributions of source code must retain the above copyright
260 notice, this list of conditions and the following disclaimer.
261
262 2. Redistributions in binary form must reproduce the above
263 copyright notice, this list of conditions and the following
264 disclaimer in the documentation and/or other materials provided
265 with the distribution.
266
267 This software is provided 'as is' with no guarantees of correctness
268 or fitness for purpose.
269
270 4. How do I report bugs in MaraDNS?
271
272 Post your bug report as a Github issue.
273
274 5. Some of the postings to the mailing list do not talk about MaraDNS!
275
276 As of September 2013, the mailing list has become moderated and only
277 postings on the mailing list are relevant MaraDNS announcements.
278
279 6. How do I get off the mailing list?
280
281 Send an email to list-unsubscribe@maradns.org, or an email to list-
282 request@maradns.org with "unsubscribe" as the subject line.
283
284 The mailing list will send you an email confirming the unsubscribe
285 request; this email needs to be replied to in order to get off the
286 list.
287
288 7. How do I set up reverse DNS on MaraDNS?
289
290 Reverse DNS (sometimes called "reverse mapping") is set up by using PTR
291 (pointer) records. For example, the PTR record which performs the
292 reverse DNS lookup for the ip 10.2.3.4 looks like this in a CSV2 zone
293 file:
294
295 4.3.2.10.in-addr.arpa. PTR www.example.com.
296
297 It is also possible to use a special "FQDN4" which automatically sets
298 up the reverse mapping of a given record:
299
300 www.example.com. FQDN4 10.2.3.4
301
302 If you wish to have a PTR (reverse DNS lookup; getting a DNS name from
303 a numeric IP) record work on the internet at large, it is not a simple
304 matter of just adding a record like this to a MaraDNS zonefile. One
305 also needs control of the appropriate in-addr.arpa. domain.
306
307 While it could make logical sense to contact the IP 10.11.12.13 when
308 trying to get the reverse DNS lookup (fully qualified domain name) for
309 a given IP, DNS servers don't do this. DNS server, instead, contact the
310 root DNS servers for a given in-addr.arpa name to get the reverse DNS
311 lookup, just like they do with any other record type.
312
313 When an internet service provider is given a block of IPs, they are
314 also given control of the DNS zones which allow them to control reverse
315 DNS lookups for those IPs. While it is possible to obtain a domain and
316 run a DNS server without the knowledge or intervention of an ISP, being
317 able to control reverse DNS lookups for those IPs requires ISP
318 intervention.
319
320 8. I am on a slow network, and Deadwood can not process recursive queries
321
322 Deadwood, by default, only waits two seconds for a reply from a remote
323 DNS server. This default can be increased by adding a line like this in
324 the mararc file:
325
326 timeout_seconds = 5
327
328 Note that making this too high will slow MaraDNS down when DNS servers
329 are down, which is, alas, all too common on today's internet.
330
331 9. When I try to run MaraDNS, I get a cryptic error message.
332
333 There is usually some context of where there is a syntax error in a
334 data file before the cryptic error message. For example, when there is
335 a syntax error in a csv2 zone file, MaraDNS will tell you exactly at
336 what point it had to terminate parsing of the zone file.
337
338 If MaraDNS does return a cryptic error message without letting you know
339 what is wrong, let us know in a Github issue so that we can fix the
340 bug. MaraDNS is designed to be easy to use; cryptic error messages go
341 against this spirit.
342
343 10. After I start MaraDNS, I can not see the process when I run netstat
344 -na
345
346 Udp services do not have a prominent "LISTEN" when netstat is run.
347
348 When MaraDNS is up, the relevant line in the netstat output looks like
349 this: udp 0 0 127.0.0.1:53 0.0.0.0:*
350
351 While on the topic of netstat, if you run netstat -nap as root on Linux
352 and some other *nix operating systems, you can see the names of the
353 processes which are providing internet services.
354
355 11. What string library does MaraDNS use?
356
357 MaraDNS uses its own string library, which is called the "js_string"
358 library. Man pages for most of the functions in the js_string library
359 are in the folder doc/man of the MaraDNS distribution
360
361 12. Why does MaraDNS use a multi-threaded model?
362
363 MaraDNS 2.0 no longer uses threads.
364
365 It took me three years to rewrite MaraDNS' recursive resolver as a
366 separate non-threaded daemon. This has been done, and now all recursion
367 is done with Deadwood which does not need threads.
368
369 13. I feel that XXX feature should be added to MaraDNS
370
371 There are no plans to add new features to MaraDNS or Deadwood at this
372 time.
373
374 14. I feel that MaraDNS should use another documentation format
375
376 The reason that MaraDNS uses its own documentation format is to satisfy
377 both the needs of translators to have a unified document format and my
378 own need to use a documentation format that is simple enough to be
379 readily understood and which I can add features on an as needed basis.
380
381 The documentation format is essentially simplified HTML with some
382 special tags added to meet MaraDNS' special needs.
383
384 This gives me more flexibility to adapt the documentation format to
385 changing needs. For example, when someone pointed out that it's not a
386 good idea to have man pages with hi-bit characters, it was a simple
387 matter to add a new HIBIT tag which allows man pages to be without hi-
388 bit characters, and other document formats to retain hi-bit characters.
389
390 Having a given program have its own documentation format is not without
391 precedent; Perl uses its own "pod" documentation format.
392
393 15. Is there any process I need to follow to add a patch to MaraDNS?
394
395 I no longer accept third party patches
396
397 16. Can MaraDNS act as a primary nameserver?
398
399 Yes.
400
401 The zoneserver program serves zones so that other DNS servers can be
402 secondaries for zones which MaraDNS serves. This is a separate program
403 from the maradns server, which processes authoritative UDP DNS queries,
404 and Deadwood which processes recursive DNS queries.
405
406 See the DNS master document in the MaraDNS tutorial for details.
407
408 17. Can MaraDNS act as a secondary nameserver?
409
410 Yes.
411
412 Please read the DNS slave document, which is part of the MaraDNS
413 tutorial.
414
415 18. What is the difference between an authoritative and a recursive DNS
416 server?
417
418 A recursive DNS server is a DNS server that is able to contact other
419 DNS servers in order to resolve a given domain name label. This is the
420 kind of DNS server one points to in /etc/resolv.conf. MaraDNS uses the
421 Deadwood daemon to process recursive DNS queries.
422
423 An authoritative DNS server is a DNS server that a recursive server
424 contacts in order to find out the answer to a given DNS query. The
425 maradns daemon processes authoritative DNS queries.
426
427 19. The fetchzone client isn't allowing me to add certain hostnames to my
428 zone
429
430 For security reasons, MaraDNS' fetchzone client does not add records
431 which are not part of the zone in question. For example, if someone has
432 a zone for example.com, and this record in the zone:
433
434 1.1.1.10.in-addr.arpa. PTR dns.example.com.
435
436 MaraDNS will not add the record, since the record is out-of-bailiwick.
437 In other words, it is a host name that does not end in .example.com.
438
439 There are two workarounds for this issue:
440
441 * Create a zone file for 1.1.10.in-addr.arpa., and put the PTR records
442 there.
443
444 * Use rcp, rsync, or another method to copy over the zone files in
445 question.
446
447 20. Is MaraDNS portable?
448
449 MaraDNS is developed in CentOS 6 and Windows 7. MaraDNS may or may not
450 compile and run on other systems.
451
452 21. Can I use MaraDNS in Windows?
453
454 Yes. There is both a partial mingw32 (native win32 binary) port and a
455 full Cygwin port of MaraDNS; both of these ports are part of the native
456 build of MaraDNS. Deadwood has full Windows support, including the
457 ability to run as a service.
458
459 22. MaraDNS freezes up after being used for a while
460
461 If using your ISP's name servers or some other name servers which are
462 not, in fact, root name servers, please make sure that you are using
463 the upstream_servers dictionary variable instead of the root_servers
464 dictionary variable.
465
466 If you still see MaraDNS freeze up after making this correction, please
467 send a bug report as a Github issue.
468
469 23. What kind of Python integration does MaraDNS have
470
471 The mararc file uses the same syntax that Python uses; in fact, Python
472 can parse a properly formatted mararc file.
473
474 There is no other integration with Python.
475
476 24. Doesn't kvar mean four in Esperanto?
477
478 Indeed, it does. However the use of "kvar" in the MaraDNS source code
479 only coincidentally is an Esperanto word. "kvar" is short for "Kiwi
480 variable"; a lot of the parsing code comes from the code used in the
481 Kiwi spam filter project.
482
483 25. How scalable is MaraDNS?
484
485 MaraDNS is optimized for serving a small number of domains as quickly
486 as possible. That said, MaraDNS is remarkably efficnent for serving a
487 large number of domains, as long as the server MaraDNS is on has the
488 memory to fit all of the domains, and as long as the startup time for
489 loading a large number of domains can be worked around.
490
491 The "big-O" or "theta" growth rates for various MaraDNS functions are
492 as follows, where N is the number of authoritative host names being
493 served:
494
495 Startup time N
496 Memory usage N
497 Processing incoming DNS requests 1
498
499 As can be seen, MaraDNS will process 1 or 100000 domains in the same
500 amount of time, once the domain names are loaded in to memory. <h2>26.
501 I am having problems setting upstream_servers</h2> upstream_servers is
502 only supported by Deadwood, and is no longer supported in MaraDNS 2.0.
503 The upstream_servers dwood3rc variable is set thusly:
504
505 upstream_servers["."] = "10.3.28.79, 10.2.19.83"
506
507 Note the ["."].
508
509 Note that the upstream_servers variable needs to be initialized before
510 being used via upstream_servers = {} (the reason for this is so that a
511 dwood3rc file has 100% Python-compatible syntax). A complete dwood3rc
512 file that uses upstream_servers may look like this:
513
514 ipv4_bind_addresses = "127.0.0.1"
515 chroot_dir = "/etc/maradns"
516 recursive_acl = "127.0.0.1/8"
517 upstream_servers = {}
518 upstream_servers["."] = "10.1.2.3, 10.2.4.6"
519
520 27. Why doesn't the MaraDNS.org web page validate?
521
522 HTML pages on the MaraDNS.org web site should validate as HTML 4.0
523 Transitional. However, the CSS will not validate.
524
525 I have designed MaraDNS' web page to be usable and as attractive as
526 possible in any major browser released in the last ten years. Cross-
527 browser support is more important than strict W3 validation. The reason
528 why the CSS does not validate is because I need a way to make sure
529 there is always a scrollbar on the web page, even if the content is not
530 big enough to merit one; this is to avoid the content jumping from page
531 to page. There is no standard CSS tag that lets me do this. I'm using
532 a non-standard tag to enable this in Gecko (Firefox's rendering
533 engine); this is enabled by default in Trident (Internet Explorer's
534 rendering engine). The standards are deficient and blind adherence to
535 them would result in an inferior web site.
536
537 There are also two validation warnings generated by redefinitions which
538 are needed as part of the CSS filters used to make the site attractive
539 on older browsers with limited CSS support.
540
541 On a related note, the reason why I use tables instead of CSS for some
542 of the layout is because Microsoft Internet Explorer 6 and other
543 browsers do not have support for the max-width CSS property. Without
544 this property, the web page will not scale down correctly without using
545 tables. Additionally, tables allow a reasonably attractive header in
546 browsers without CSS support.
547
548 28. How do MX records work?
549
550 How MX records work:
551
552 * The mail transport agent (Sendmail, Postfix, Qmail, MS Exchange,
553 etc.) looks up the MX record for the domain
554
555 * For each of the records returned, the MTA (mail transport agent)
556 looks up the IP for the names.
557
558 * It will choose, at random, any of the MXes with the lowest priority
559 number.
560
561 * Should that server fail, it will try another server with the same
562 priority number.
563
564 * Should all MX records with a given priority number fail, the MTA will
565 try sending email to any of the MX records with the second-lowest
566 priority value.
567
568 As an aside, do not have MX records point to CNAMEs.
569
570 29. Does MaraDNS have support for SPF?
571
572 SPF, or sender policy framework, is method of using DNS that makes it
573 more difficult to forge email. MaraDNS has full support for SPF, both
574 via TXT records and RFC4408 SPF records.
575
576 SPF configuration is beyond the scope of MaraDNS' documentation.
577 However, at the time this FAQ entry was last updated (July, 2013),
578 information and documentation concerning SPF is available at
579 http://openspf.org. The BIND examples will work in MaraDNS csv2 zone
580 files as long as the double quotes (") are replaced by single quotes
581 ('). For example, a SPF TXT record that looks like example.net. IN TXT
582 "v=spf1 +mx a:colo.example.com/28 -all" in a BIND zone file will look
583 like example.net. TXT 'v=spf1 +mx a:colo.example.com/28 -all' in a
584 MaraDNS zone file. MaraDNS can also make the corresponding SPF record,
585 which will have the syntax example.net. SPF 'v=spf1 +mx
586 a:colo.example.com/28 -all'.
587
588 Use '\x7e' to put a tilde ("~" character) in a SPF record:
589
590 example.com. SPF 'v=spf1 +mx a:colo.example.com/28 '\x7e'all'
591
592 30. I'm having problems resolving CNAMES I have set up.
593
594 This is probably because you have set up what MaraDNS calls a dangling
595 CNAME record.
596
597 Let us suppose we have a CNAME record without an A record in the local
598 DNS server's database, such as:
599
600 google.example.com. CNAME www.google.com.
601
602 This record, which is a CNAME record for "google.example.com", points
603 to "www.google.com". Some DNS servers will recursively look up
604 www.google.com, and render the above record like this:
605
606 google.example.com. CNAME www.google.com.
607 www.google.com. A 66.102.7.104
608
609 For security reasons, MaraDNS doesn't do this. Instead, MaraDNS will
610 simply output:
611
612 google.example.com. CNAME www.google.com.
613
614 Some stub resolvers will be unable to resolve google.example.com as a
615 consequence.
616
617 If you set up MaraDNS to resolve CNAMEs thusly, you will get a warning
618 in your logs about having a dangling CNAME record.
619
620 If you want to remove these warnings, add the following to your mararc
621 file:
622
623 no_cname_warnings = 1
624
625 Information about how to get MaraDNS to resolve dangling CNAME records
626 is in the tutorial file dangling.html
627
628 31. I have a NS delegation, and MaraDNS is doing strange things.
629
630 This is only an issue in MaraDNS 1.4. MaraDNS 2.0 does not allow the
631 same IP to both authoritatively and recursively resolve records.
632
633 32. I am transferring a zone from another server, but the NS records are
634 these strange synth-ip records.
635
636 MaraDNS expects, in csv2 zone files, for all delegation NS records to
637 be between the SOA record and the first non-NS record.
638
639 If a zone looks like this:
640
641 example.net. +600 soa ns1.example.net.
642 hostmaster@example.net 10 10800 3600 604800 1080
643 example.net. +600 mx 10 mail.example.net.
644 example.net. +600 a 10.2.3.5
645 example.net. +600 ns ns1.example.net.
646 example.net. +600 ns ns3.example.net.
647 mail.example.net. +600 a 10.2.3.7
648 www.example.net. +600 a 10.2.3.11
649
650 Then the NS records will be "synth-ip" records.
651
652 The zone should look like this:
653
654 example.net. +600 soa ns1.example.net.
655 hostmaster@example.net 10 10800 3600 604800 1080
656 example.net. +600 ns ns1.example.net.
657 example.net. +600 ns ns3.example.net.
658 example.net. +600 mx 10 mail.example.net.
659 example.net. +600 a 10.2.3.5
660 mail.example.net. +600 a 10.2.3.7
661 www.example.net. +600 a 10.2.3.11
662
663 This will remove the "synth-ip" records.
664
665 To automate this process, this awk script is useful:
666
667 fetchzone whatever.zone.foo 10.1.2.3 | awk '
668 {if($3 ~ /ns/ || $3 ~ /soa/){print}
669 else{a = a "\n" $0}}
670 END{print a}' > zonefile.csv2
671
672 Replace "whatever.zone.foo" with the name of the zone you are fetchin
673 10.1.2.3 with the IP address of the DNS master, and zonefile.csv2 with
674 the name of the zone file MaraDNS loads.
675
676 33. Where is the root.hints file?
677
678 MaraDNS (actually, Deadwood), unlike BIND, does not need a complicated
679 root.hints file in order to have custom root servers. In order to
680 change the root.hints file, add something like this to your dwood3rc
681 file:
682
683 root_servers["."] = "131.161.247.232,"
684 root_servers["."] += "208.185.249.250,"
685 root_servers["."] += "66.227.42.140,"
686 root_servers["."] += "66.227.42.149,"
687 root_servers["."] += "65.243.92.254"
688
689 Note that there is no "+=" in the first line, and the last line does
690 not have a comma at the end. Read the recursive tutorial document for
691 more information.
692
693 34. Are there any plans to use autoconf to build MaraDNS?
694
695 No.
696
697 In more detail, MaraDNS does not use autoconf for the following
698 reasons:
699
700 * Autoconf is designed to solve a problem that existed in the mid 1990s
701 but does not exist today: A large number of different incompatible C
702 compilers and libc implementations. These days, most systems are
703 using gcc as the compiler and some version of glibc as the libc.
704 There is no longer a need, for example, to figure out whether a given
705 implementation of getopt() allows '--' options. MaraDNS's the 3-5
706 minute process autoconf's ./configure needs.
707
708 * Autoconf leaves GPL-tained files in a program's build tree. MaraDNS
709 is licensed under a BSD license that is not GPL-compatible, so
710 MaraDNS can not be distributed with these GPL-licensed files.
711
712 This leads us to the next question:
713
714 35. How do I change the compiler or compile-time flags with MaraDNS' build
715 process?
716
717 To change the compiler used by MaraDNS:
718
719 * Run the ./configure script
720
721 * Open up the file Makefile with an editor
722
723 * Look for a line that starts with CC
724
725 * If there is no line that starts with CC, create one just before the
726 line that starts with FLAGS
727
728 * Change (or create) that line to look something like CC=gcc296 In this
729 example, the 2.96 version of gcc is used to compile MaraDNS.
730
731 * Note that it is important to not remove anything from this line you
732 do not understand; doing so will make MaraDNS unable to compile or
733 run. So, if the CC line looks like CC=gcc $(LDFLAGS) -DNO_FLOCK and
734 you want to compile with gcc 2.96, change the line to look like
735 CC=gcc296 $(LDFLAGS) -DNO_FLOCK retaining the flags added by the
736 configuration script.
737
738 Changing compile-time flags is a similar process:
739
740 * Run the ./configure script
741
742 * Open up the file Makefile with an editor
743
744 * Look for a line that starts with FLAGS
745
746 * Change (or create) that line to look something like FLAGS=-O3 In this
747 example, MaraDNS is compiled with the -O3 option.
748
749 * Note that it is important to not remove anything from this line you
750 do not understand; doing so will make MaraDNS unable to compile or
751 run. So, if the FLAGS line looks like FLAGS=-O2 -Wall
752 -DSELECT_PROBLEM and you want to compile at optimization level three,
753 change this line to look like FLAGS=-O2 -Wall -DSELECT_PROBLEM
754 retaining the flags added by the configuration script.
755 -DSELECT_PROBLEM for example, is needed in the Linux compile or
756 MaraDNS will have problems with freezing up.
757
758 36. Will you make a package for the particular Linux distribution I am
759 using?
760
761 No.
762
763 There is, however, a CentOS 5-compatible RPM spec file in the build
764 directory.
765
766 37. I am using the native Windows port of MaraDNS, and some features are
767 not working.
768
769 Since Windows 32 does not have some features that *NIX OSes have, the
770 native Windows port does not have all of the features of the *NIX
771 version of MaraDNS. In particular, the following features are disabled:
772
773
774 * ipv6 (this is actually a mingw32, not a Windows deficiency)
775
776 * The chroot_dir mararc variable
777
778 * The maradns_gid and maradns_uid mararc variables
779
780 * The maxprocs mararc variable
781
782 * The synth_soa_serial variable can not have a value of 2
783
784 * There is no DNS-over-TCP support
785
786 If any of the above features are desired, try compiling MaraDNS using
787 Cygwin. Note that the Cygwin port of MaraDNS does not have ipv6
788 support, and that while chroot_dir works in Cygwin, it does not have
789 the security that the *NIX chroot() call has.
790
791 38. MaraDNS isn't starting up
792
793 This is usually caused by a syntax error in one's mararc file, or by
794 another MaraDNS process already running. To see what is happening, look
795 at your system log (/var/log/messages in Centos 3) to see what errors
796 MaraDNS reports. If you do not know how to look at a system log, you
797 can also invoke MaraDNS from the command line as root; any errors will
798 be visible when starting MaraDNS.
799
800 39. You make a lot of releases of MaraDNS; at our ISP/IT department,
801 updating software is non-trivial.
802
803 Regularly updating software is required to keep something as
804 complicated as a DNS server secure; there is not a DNS server out there
805 so secure that it never needs to be updated.
806
807 Since MaraDNS is finished, updates usually only happen about once a
808 year.
809
810 The last security bug which required a MaraDNS update was made before
811 September 28, 2015.
812
813 40. I have star records in my zones, and am having problems with
814 NXDOMAINs/IPV6 resolution
815
816 This was a bug in MaraDNS 1.2 which has long since been fixed.
817
818 41. I have a zone with only SOA/NS records, and the zone is not working.
819
820 MaraDNS 1.2 had a bug where it did not correctly process zones without
821 any "normal" records. Upgrade to MaraDNS 2.0.
822
823 42. I am having problems registering my domain with AFNIC (the registrar
824 for .fr domains)
825
826 Because of an issue with AFNIC (who, annoyingly enough, check the RA
827 bit when registering a domain), in order to register a domain with
828 AFNIC using MaraDNS as your DNS server, the following steps need to be
829 followed:
830
831 * MaraDNS version 1.4 or 2.0 needs to be used; if you're using an older
832 version of MaraDNS, upgrade.
833
834 * It is necessary to have recursion disabled, if using MaraDNS 1.4,
835 either by compiling MaraDNS without recursive support (./configure
836 --authonly ; make), or by making sure MaraDNS does not have recursion
837 enabled (by not having recursive_acl set in one's MaraDNS 1.4 mararc
838 file)
839
840 If one wishes to both register domains with AFNIC and use MaraDNS 1.4
841 as a recursive DNS server, it is required to have the recursive server
842 be a separate instance of MaraDNS on a separate IP. It is not possible
843 to have the same DNS server both send DNS packets in a way that both
844 makes AFNIC happy and allows recursive queries.
845
846 Note also: AFNIC gives warnings about reverse DNS lookups; more
847 information about this issue can be found in the FAQ entry about
848 reverse DNS mappings (question 7). In addition, AFNIC requires DNS-
849 over-TCP to work; information on configuring MaraDNS to have this can
850 be found in the DNS-over-TCP tutorial.
851
852 43. I can't see the full answers for subdomains I have delegated
853
854 To have the subdomains be visible to MaraDNS 1.4 recursive nameservers,
855 add the following to your mararc file:
856
857 recurse_delegation = 1
858
859 44. MaraDNS 1 has a problem resolving a domain
860
861 This issue should be fixed in MaraDNS 2.0.
862
863 Here's what happening: I have rewritten the recursive resolver for
864 MaraDNS. The old code was always designed to be a placeholder until I
865 wrote a new recursive resolver.
866
867 The new recursive resolver is called "Deadwood"; right now it's fully
868 functional and part of MaraDNS 2.0. More information is here:
869
870 http://maradns.blogspot.com/search/label/Deadwood
871
872 http://maradns.samiam.org/deadwood/
873
874 Since the old recursive code is a bit difficult to maintain, and since
875 I in the process of rewriting the recursive code, my rule is that I
876 will only resolve security issues with MaraDNS 1.0's recursive
877 resolver.
878
879 45. MaraDNS 1.2 had issues with NXDOMAINS and case sensitivity.
880
881 There was a known bug in MaraDNS 1.2.12 where, should a client ask for
882 a non-existent record in all caps, MaraDNS 1.2.12 will return a
883 NXDOMAIN instead of a "not there" reply. Upgrade to 2.0.
884
885 46. Can MaraDNS offer protection from phishing and malicious sites?
886
887 Deadwood can block up to about 20,000 domains. More details are in the
888 Deadwood FAQ.
889
890 47. Does maradns support star (wildcard) records?
891
892 Yes.
893
894 MaraDNS supports both having stars at the beginning of records and the
895 end of records. For example, to have anything.example.com. have the IP
896 10.1.2.3, add this line to the zone file for example.com:
897
898 *.example.com. A 10.1.2.3
899
900 To have stars at the end of records, csv2_default_zonefile has to be
901 set. The mararc parameter bind_star_handling affects how star records
902 are handled. More information is in the mararc man page.
903
904 48. I'm having problems using MaraDNS with some *NIX command line
905 applications like telnet.
906
907 Some *NIX command line networking applications, such as telnet and ssh,
908 try to do either a reverse DNS lookup (IP-to-host name conversion) or
909 an IPv6 lookup. This slows things down and sometimes causes the
910 applications to not work at all.
911
912 For people who do not need IPv6 lookups, add the following line to
913 one's mararc file to have MaraDNS respond to all IPv6 lookups with a
914 bogus "not found" reply:
915
916 reject_aaaa = 1
917
918 If knowing the hostname a given IP has isn't important, these kinds of
919 lookups can also be disabled:
920
921 reject_ptr = 1
922
923 49. My virus scanner reports that MaraDNS or Deadwood has a virus
924
925 This can be caused either by a poorly written anti-virus program
926 reporting a false positive, or because a virus on your system has
927 infected your copy of MaraDNS/Deadwood.
928
929 Please use GPG to verify that the file which your scanner reports
930 having a virus in has not been altered. In addition, please scan the
931 file with AVG (free for non-commercial use) to verify your virus
932 scanner has not reported a false positive.
933
934 If you have verified the GPG signature of the program and AVG reports a
935 virus, please let us know with a Github issue. Otherwise, please use a
936 better virus scanner and make sure there are no viruses on your
937 computer.
938
939 50. I can not subscribe to the MaraDNS mailing list
940
941 Please note that the mailing list is no longer used to handle MaraDNS
942 support requests. Please file a Github issue at
943 https://github.com/samboy/MaraDNS/issues to file a MaraDNS bug report."
944
945 The procedure for subscribing to the mailing list is as follows:
946
947 * Send an email to list-request@maradns.org with "Subscribe" as the
948 subject, or an email to list-subscribe@maradns.org
949
950 * You will get an email from list-request@maradns.org asking you to
951 confirm your subscription. This can be done by replying to the
952 message, or, more simply, by clicking on the link in the message.
953
954 * Once you click on that link, click on the button marked "subscribe to
955 list list"
956
957 * You will now get a message stating 'Welcome to the "list" mailing
958 list'.
959
960 * Note that the mailing list is moderated and only relevant MaraDNS
961 announcements are approved. People who need help should read the
962 manuals or search the MaraDNS webpage for support.
963
964 If you get an email from list-request@maradns.org with the subject "The
965 results of your email commands", you did not correctly send an email to
966 list-request@maradns.org with the subject "Subscribe".
967
968 If you do not get the email from list-request@maradns.org asking you
969 for a confirmation, ensure that this email is not in your "spam" or
970 "junk mail" folder. If you are unable to get these emails at your email
971 address, please get a gmail email account, which can successfully
972 subscribe to the MaraDNS mailing list. Note that subscription
973 confirmation emails may be in Gmail's "promotions" tab.
974
975 51. How does MaraDNS respond to EDNS (RFC2671) packets?
976
977 MaraDNS 2 (both the authoritative maradns server and the recursive
978 Deadwood server) responds to EDNS packets by ignoring the OPT record
979 and acting as if it the packet did not have an OPT record.
980
981 MicroDNS (available in the tools/misc directory of any MaraDNS 2
982 release) responds to EDNS queries the same way Deadwood 2.9.03 did: By
983 giving back "NOTIMPL" instead of answering the query with the default
984 IP. NanoDNS, in the interest of minimizing code side, responds to EDNS
985 requests by returning NOTIMPL in the header, giving the OPT query in
986 the AN section of the response, and giving the default IP in the AR
987 section of the DNS reply packet.
988
989 52. How to I get MaraDNS to always give the same IP to all DNS queries?
990
991 There are three ways to have MaraDNS always give the same IP in reply
992 to any DNS query given to it:
993
994 * The best way to do this is to set up a default zonefile that causes
995 any and all A queries to always give the IP (and also allows all AAAA
996 queries to always give out the same IP6, all SPF or TXT queries to
997 give out the same SPF record, etc.).
998
999 * Another possibility, if someone just wants a simple DNS server that
1000 always gives out the same IP address to any and all DNS queries, is
1001 to use the MicroDNS program, available in tools/misc, as well as
1002 having its own web page.
1003
1004 * If MicroDNS is too bloated, there is also NanoDNS, which I will
1005 include the source code of below:
1006
1007 #include <arpa/inet.h>
1008 #include <string.h>
1009 #include <stdint.h>
1010 #define Z struct sockaddr
1011 #define Y sizeof(d)
1012 int main(int a,char **b){uint32_t i;char q[512]
1013 ,p[17]="\xc0\f\0\x01\0\x01\0\0\0\0\0\x04";if(a>
1014 1){struct sockaddr_in d;socklen_t f=511;bzero(&
1015 d,Y);a=socket(AF_INET,SOCK_DGRAM,0);*((uint32_t
1016 *)(p+12))=inet_addr(b[1]);d.sin_family=AF_INET;
1017 d.sin_port=htons(53);bind(a,(Z*)&d,Y);for(;;){i
1018 =recvfrom(a,q,255,0,(Z*)&d,&f);if(i>9&&q[2]>=0)
1019 {q[2]|=128;q[11]?q[3]|=4:1;q[7]++;memcpy(q+i,p,
1020 16);sendto(a,q,i+16,0,(Z*)&d,Y);}}}return 0;}
1021
1022 NanoDNS takes one argument: The IP we return. This program binds to all
1023 IP addresses a given machine has on the UDP DNS port (port 53). For
1024 example, to make a DNS server that binds to all IPs your system has and
1025 return the IP 10.11.12.13 to any UDP DNS queries sent to it, compile
1026 the above C program, call it NanoDNS, and invoke it with NanoDNS
1027 10.11.12.13 Note that NanoDNS does not daemonize, nor log anything, nor
1028 have any other space-wasting features.
1029
1030 Why did you change MaraDNS' tagline?
1031
1032 I have changed MaraDNS' tagline from "MaraDNS: A security-aware DNS
1033 server" to "MaraDNS: A small open-source DNS server" because MaraDNS
1034 does not support DNSSEC. I have blogged about this:
1035
1036 http://samiam.org/blog/20120326.html
1037
1038 How do you stop MaraDNS from taking part in a distributed denial-of-
1039 service attack?
1040
1041 While I do not have time to implement rate limiting, CentOS 6 does
1042 support response rate limiting at the firewall level. The following
1043 iptables commands allow a given IP to only send MaraDNS/Deadwood 20 DNS
1044 queries every four seconds:
1045
1046 iptables -A INPUT -p udp --dport 53 -m state --state NEW -m recent
1047 --set --name DDOS --rsource
1048
1049
1050 iptables -A INPUT -p udp --dport 53 -m state --state NEW -m recent
1051 --update --seconds 4 --hitcount 20 --name DDOS --rsource -j DROP
1052
1053
1054 To verify they are applied:
1055
1056 iptables --list
1057
1058
1059 To save these commands in CentOS so they are applied at system boot
1060 time:
1061
1062 iptables-save > /etc/sysconfig/iptables
1063
1064
1065 Disclaimer
1066
1067 These incantations work in CentOS 6 but may or may not work in other
1068 versions of Linux. I do not support non-CentOS6 Linux installs of
1069 MaraDNS.
1070
1071 What about DNS-over-TCP?
1072
1073 For people who want DNS-over-TCP, instructions are in the DNS-over-TCP
1074 tutorial. Note that Windows users will have to use Cygwin to have DNS-
1075 over-TCP.
1076
1077 However, DNS-over-TCP is not necessary. DNS-over-TCP is optional as per
1078 section 6.1.3.2 of RFC1123; any program or web service that considers
1079 no DNS-over-TCP an error is not RFC-compliant.
1080
1081 Not having DNS-over-TCP is more secure, because it gives attackers a
1082 smaller surface to attack.
1083
1084 How do I use MaraDNS with systemd?
1085
1086 While I like systemd, it is not part of CentOS 6 nor, obviously,
1087 Windows 7. That in mind, I have no plans to support systemd until 2017,
1088 when I plan to update MaraDNS' supported operating systems.
1089
1090 However, Tomasz Torcz has kindly made some systemd files for MaraDNS,
1091 which people are free to use.
1092
1093 As an aside, I do not like the fact that Debian will probably not make
1094 systemd the default init; I do not think this kind of fragmentation is
1095 good for Linux.
1096
1097 Why doesn't MaraDNS use IP_FREEBIND?
1098
1099 IP_FREEBIND is a non-POSIX Linux-specific extension to POSIX's
1100 netinet/in.h, and, as such, has no place in MaraDNS' code. MaraDNS
1101 strives to use POSIX-compliant calls so that it can compile on as many
1102 systems as possible.
1103
1104 When I say that Windows 7 and CentOS 6 are the only supported operating
1105 systems for MaraDNS, this does not mean that MaraDNS will not compile
1106 and run on other systems; it merely means that I can not provide
1107 support for Github bug reports for people who want to run MaraDNS in
1108 Minix, one of the open-source BSD variants, or what not.
1109
1110 Is there a web interface for MaraDNS?
1111
1112 The Kloxo-MR control panel has MaraDNS support.
1113
1114 What does the message “don’t forget the trailing dot” mean?
1115
1116 It means to not forget the tailing dot.
1117
1118 Hostnames in zone files need to be properly terminated; if a hostname
1119 is in the form “foo.example.com”, this name will not parse and return
1120 an error with a note to not forget the trailing dot.
1121
1122 To fix this, put a trailing dot at the end of the hostname, so it looks
1123 like “foo.example.com.” (observe that dot at the end) instead of
1124 “foo.example.com”
1125
1126 Does MaraDNS support newer top level domains?
1127
1128 MaraDNS does not impose any limitations on the top level domain used in
1129 zone files and other places, as is fully compatible with newer top
1130 level domains like “today.”
1131
1132 Note that, if using an internationalized domain name, it needs to be
1133 translated in to Punycode first. For example, if using the domain name
1134 “ñ.com.”, it needs to be in the form “xn--ida.com.” in MaraDNS’ mararc
1135 and zone files.
1136
1137 Can MaraDNS handle IDN domain names?
1138
1139 Yes, but the internationalized domain name (IDN) needs to be translated
1140 in to Punycode first. For example, if using the domain name “ñ.com.”,
1141 it needs to be in the form “xn--ida.com.” in MaraDNS’ mararc and zone
1142 files.
1143
1145 In the unusual case of having a csv2 zone file with Macintosh-style
1146 newlines (as opposed to DOS or UNIX newlines), while the file will
1147 parse, any errors in the file will be reported as being on line 1.
1148
1149 The system startup script included with MaraDNS assumes that the only
1150 MaraDNS processes running are started by the script; it stops all
1151 MaraDNS processes running on the server when asked to stop MaraDNS.
1152
1153 MaraDNS needs to use the zoneserver program to serve DNS records over
1154 TCP. See zoneserver(8) for usage information.
1155
1156 MaraDNS does not use the zone file ("master file") format specified in
1157 chapter 5 of RFC1035.
1158
1159 MaraDNS default behavior with star records is not RFC-compliant. In
1160 more detail, if a wildcard MX record exists in the form
1161 "*.example.com", and there is an A record for "www.example.com", but no
1162 MX record for "www.example.com", the correct behavior (based on RFC1034
1163 §4.3.3) is to return "no host" (nothing in the answer section, SOA in
1164 the authority section, 0 result code) for a MX request to
1165 "www.example.com". Instead, MaraDNS returns the MX record attached to
1166 "*.example.com". This can be changed by setting bind_star_handling to
1167 1.
1168
1169 Star records (what RFC1034 calls "wildcards") can not be attached to NS
1170 records.
1171
1172 MaraDNS, like every other known DNS implementation, only supports a
1173 QDCOUNT of 0 or 1.
1174
1176 These are features which I do not plan to implement in MaraDNS.
1177
1178 MaraDNS does not have a disk-based caching scheme for authoritative
1179 zones.
1180
1181 MaraDNS' UDP server only loads zone files while MaraDNS is first
1182 started. UDP Zone information can only be updated by stopping MaraDNS,
1183 and restarting MaraDNS again. Note that TCP zone files are loaded from
1184 the filesystem at the time the client requests a zone.
1185
1186 MaraDNS does not have support for allowing given host names to only
1187 resolve for a limited range of IPs querying the DNS server, or for host
1188 names to resolve differently, depending on the IP querying the host
1189 name.
1190
1191 MaraDNS only allows wildcards at the beginning or end of a host name.
1192 E.g. names with wildcards like "foo.*.example.com". "www.*" will work,
1193 however, if a default zonefile is set up. Likewise, MaraDNS does not
1194 have regular expression hostname substitution.
1195
1196 MaraDNS does not have support for MRTG or any other SNMP-based logging
1197 mechanism.
1198
1200 THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS OR
1201 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1202 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1203 DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
1204 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1205 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1206 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1207 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1208 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
1209 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
1210 POSSIBILITY OF SUCH DAMAGE.
1211
1213 Sam Trenholme (http://www.samiam.org) is responsible for this man page.
1214
1215 MaraDNS is written by me, Sam Trenholme, with a little help from my
1216 friends. Naturally, all errors in MaraDNS are my own (but read the
1217 disclaimer above).
1218
1219 Here is a partial list of people who have provided assistance:
1220
1221 Floh has generously set up a FreeBSD 4, FreeBSD 6, and Mac OS X system
1222 so that I can port MaraDNS to more platforms.
1223
1224 Albert Lee has provided countless bug reports, and, nicely enough,
1225 patches to fix said bugs. He has also made improvements to the code in
1226 the tcp "zoneserver".
1227
1228 Franky Van Liedekerke has provided much invaluable assistance. As just
1229 one example, he provided invaluable assistance in getting MaraDNS to
1230 compile on Solaris. In addition, he has provided much valuable SQA
1231 help.
1232
1233 Christian Kurz, who has provided invaluable bug reports, especially
1234 when I had to re-implement the core hashing algorithm.
1235
1236 Remmy, who is providing both the web space and a mailing list for
1237 maradns.org.
1238
1239 Phil Homewood, who provided invaluable assistance with finding and
1240 fixing bugs in the authoritative portion of the MaraDNS server. He
1241 helped me plug memory leaks, find uninitialized variables being used,
1242 and found a number of bugs I was unable to find.
1243
1244 Albert Prats kindly provided Spanish translations for various text
1245 files.
1246
1247 Shin Zukeran provided a patch to recursive.c which properly makes a
1248 normal null-terminated string from a js_string object, to send as an
1249 argument to open() so we can get the rijndael key for the PRNG.
1250
1251 D Richard Felker III has provided invaluable bug reports. By looking at
1252 his bug reports, I have been able to hunt down and fix many problems
1253 that the recursive nameserver had, in addition to at least one problem
1254 with the authoritative nameserver.
1255
1256 Ole Tange has also given me many valuable MaraDNS bug reports.
1257
1258 Florin Iucha provided a tip in the FAQ for how to compile MaraDNS on
1259 OpenBSD.
1260
1261 Roy Arends (one of the BIND developers, as it turns out) found a
1262 serious security problem with MaraDNS, where MaraDNS would answer
1263 answers, and pointed it out to me.
1264
1265 Code used as the basis for the psudo-random-number generator was
1266 written by Vincent Rijmen, Antoon Bosselaers, and Paulo Barreto. I
1267 appreciate these programmers making the code public domain, which is
1268 the only license under which I can add code to MaraDNS under.
1269
1270 Ross Johnson and others have made a Win32 port of the Pthreads library;
1271 this has made a native win32 port of MaraDNS possible.
1272
1273 I also appreciate the work of Dr. Brian Gladman and Fritz Schneider,
1274 who have both written independent implementations of AES from which I
1275 obtained test vectors. With the help of their hard work, I was able to
1276 discover a subtle security problem that previous releases of MaraDNS
1277 had.
1278
1279
1280
1281
1282MARADNS January 2002 MARADNS(8)