Ravenports generated: 08 Jan 2023 04:18
[ravenports.git] / bucket_6B / bind
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               bind
4 VERSION=                9.18.10
5 KEYWORDS=               dns net
6 VARIANTS=               standard
7 SDESC[standard]=        Berkeley Internet Name Domain (Domain Name Server)
8 HOMEPAGE=               https://www.isc.org/downloads/bind/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            ISC/bind9/9.18.10
13 DISTFILE[1]=            bind-9.18.10.tar.xz:main
14 DF_INDEX=               1
15 SPKGS[standard]=        complete
16                         server
17                         tools
18                         docs
19
20 OPTIONS_AVAILABLE=      FIXED_RRSET GEOIP LARGE_FILE QUERYTRACE
21 OPTIONS_STANDARD=       FIXED_RRSET GEOIP LARGE_FILE QUERYTRACE
22
23 BUILD_DEPENDS=          idnkit:single:standard
24 BUILDRUN_DEPENDS=       libxml2:single:standard
25                         json-c:primary:standard
26                         libuv:single:standard
27                         lmdb:single:standard
28                         libnghttp2:single:standard
29 EXRUN[tools]=           idnkit:single:standard
30
31 USES=                   cclibs:server,tools cpe iconv pkgconfig ssl readline
32                         libtool perl:build
33
34 DISTNAME=               bind-9.18.10
35
36 LICENSE=                MPL:server
37 LICENSE_FILE=           MPL:{{WRKSRC}}/COPYRIGHT
38 LICENSE_SCHEME=         solo
39
40 CPE_VENDOR=             isc
41 FPC_EQUIVALENT=         dns/bind916
42
43 MUST_CONFIGURE=         gnu
44 CONFIGURE_ARGS=         --localstatedir=/var
45                         --sysconfdir={{ETCDIR}}
46                         --disable-linux-caps
47                         --disable-dnstap
48                         --without-gssapi
49                         --with-readline
50                         --with-openssl={{OPENSSLBASE}}
51                         --with-lmdb
52                         STD_CDEFINES="-DDIG_SIGCHASE=1"
53
54 SINGLE_JOB=             yes
55
56 INSTALL_REQ_TOOLCHAIN=  yes
57 PLIST_SUB=              ETCDIR={{BIND_ETCDIR}}
58                         LIBVER=9.18.10
59 RC_SUBR=                named:server
60 SUB_FILES=              pkg-message-server
61                         named.conf
62
63 [FIXED_RRSET].DESCRIPTION=              Enable fixed rrset ordering
64 [FIXED_RRSET].CONFIGURE_ENABLE_BOTH=    fixed-rrset
65
66 [QUERYTRACE].DESCRIPTION=               Enable the very verbose query tracelogging
67 [QUERYTRACE].CONFIGURE_ENABLE_BOTH=     querytrace
68
69 [GEOIP].DESCRIPTION=                    Allow geographically based ACL
70 [GEOIP].BUILDRUN_DEPENDS_ON=            GeoIP:single:standard
71 [GEOIP].CONFIGURE_ENABLE_BOTH=          geoip
72
73 [LARGE_FILE].DESCRIPTION=               64-bit file support
74 [LARGE_FILE].CONFIGURE_ENABLE_BOTH=     largefile
75
76 post-patch:
77         ${REINPLACE_CMD} -e "s|/opt/local|${PREFIX}|g" \
78                 ${WRKSRC}/configure
79
80 post-install:
81         ${MKDIR} ${STAGEDIR}${ETCDIR} ${STAGEDIR}${STD_DOCDIR}/arm
82 .  for i in dynamic master slave working
83         ${MKDIR} ${STAGEDIR}${ETCDIR}/$i
84 .  endfor
85         ${INSTALL_DATA} ${WRKDIR}/named.conf \
86                 ${STAGEDIR}${ETCDIR}/named.conf.sample
87         ${INSTALL_DATA} ${FILESDIR}/named.root \
88                 ${STAGEDIR}${ETCDIR}
89         ${INSTALL_DATA} ${FILESDIR}/empty.db \
90                 ${STAGEDIR}${ETCDIR}/master
91         ${INSTALL_DATA} ${FILESDIR}/localhost-forward.db \
92                 ${STAGEDIR}${ETCDIR}/master
93         ${INSTALL_DATA} ${FILESDIR}/localhost-reverse.db \
94                 ${STAGEDIR}${ETCDIR}/master
95         ${RM} -r ${STAGEDIR}/var
96         # documentation
97         ${INSTALL_DATA} ${WRKSRC}/doc/arm/*.rst ${STAGEDIR}${STD_DOCDIR}/arm
98         ${INSTALL_DATA} ${WRKSRC}/CHANGES ${WRKSRC}/README* ${STAGEDIR}${STD_DOCDIR}
99
100 [FILE:743:descriptions/desc.server]
101 BIND is open source software that enables you to publish your Domain Name 
102 System (DNS) information on the Internet, and to resolve DNS queries for 
103 your users.  The name BIND stands for "Berkeley Internet Name Domain", 
104 because the software originated in the early 1980s at the University of 
105 California at Berkeley.
106
107 BIND is by far the most widely used DNS software on the Internet, 
108 providing a robust and stable platform on top of which organizations can 
109 build distributed computing systems with the knowledge that those systems 
110 are fully compliant with published DNS standards.
111
112 The BIND software distribution has three parts:
113   1. Domain Name Resolver
114   2. Domain Name Authority server
115   3. Tools
116
117 This package contains parts 1 and 2.
118
119
120 [FILE:357:descriptions/desc.tools]
121 BIND is open source software that enables you to publish your Domain Name 
122 System (DNS) information on the Internet, and to resolve DNS queries for 
123 your users.  The name BIND stands for "Berkeley Internet Name Domain", 
124 because the software originated in the early 1980s at the University of 
125 California at Berkeley.
126
127 This package contains the BIND tools.
128
129
130 [FILE:98:distinfo]
131 f415a92feb62568b50854a063cb231e257351f8672186d0ab031a49b3de2cac6      5261572 bind-9.18.10.tar.xz
132
133
134 [FILE:3151:manifests/plist.server]
135 @sample %%ETCDIR%%/named.conf.sample
136 %%ETCDIR%%/
137  bind.keys
138  named.root
139 %%ETCDIR%%/master/
140  empty.db
141  localhost-forward.db
142  localhost-reverse.db
143 include/bind9/
144  check.h
145  getaddresses.h
146 include/dns/
147  acl.h
148  adb.h
149  badcache.h
150  bit.h
151  byaddr.h
152  cache.h
153  callbacks.h
154  catz.h
155  cert.h
156  client.h
157  clientinfo.h
158  compress.h
159  db.h
160  dbiterator.h
161  diff.h
162  dispatch.h
163  dlz.h
164  dlz_dlopen.h
165  dns64.h
166  dnsrps.h
167  dnssec.h
168  dnstap.h
169  ds.h
170  dsdigest.h
171  dyndb.h
172  ecs.h
173  edns.h
174  enumclass.h
175  enumtype.h
176  events.h
177  fixedname.h
178  forward.h
179  geoip.h
180  ipkeylist.h
181  iptable.h
182  journal.h
183  kasp.h
184  keydata.h
185  keyflags.h
186  keymgr.h
187  keytable.h
188  keyvalues.h
189  librpz.h
190  log.h
191  lookup.h
192  master.h
193  masterdump.h
194  message.h
195  name.h
196  ncache.h
197  nsec.h
198  nsec3.h
199  nta.h
200  opcode.h
201  order.h
202  peer.h
203  private.h
204  rbt.h
205  rcode.h
206  rdata.h
207  rdataclass.h
208  rdatalist.h
209  rdataset.h
210  rdatasetiter.h
211  rdataslab.h
212  rdatastruct.h
213  rdatatype.h
214  request.h
215  resolver.h
216  result.h
217  rootns.h
218  rpz.h
219  rriterator.h
220  rrl.h
221  sdb.h
222  sdlz.h
223  secalg.h
224  secproto.h
225  soa.h
226  ssu.h
227  stats.h
228  time.h
229  tkey.h
230  transport.h
231  tsec.h
232  tsig.h
233  ttl.h
234  types.h
235  update.h
236  validator.h
237  view.h
238  xfrin.h
239  zone.h
240  zonekey.h
241  zoneverify.h
242  zt.h
243 include/dst/
244  dst.h
245  gssapi.h
246 include/irs/resconf.h
247 include/isc/
248  aes.h
249  align.h
250  app.h
251  assertions.h
252  astack.h
253  atomic.h
254  attributes.h
255  backtrace.h
256  barrier.h
257  base32.h
258  base64.h
259  bind9.h
260  buffer.h
261  cmocka.h
262  commandline.h
263  condition.h
264  counter.h
265  crc64.h
266  deprecated.h
267  dir.h
268  endian.h
269  errno.h
270  error.h
271  event.h
272  eventclass.h
273  file.h
274  formatcheck.h
275  fsaccess.h
276  fuzz.h
277  glob.h
278  hash.h
279  heap.h
280  hex.h
281  hmac.h
282  ht.h
283  httpd.h
284  interfaceiter.h
285  iterated_hash.h
286  lang.h
287  lex.h
288  list.h
289  log.h
290  magic.h
291  managers.h
292  md.h
293  mem.h
294  meminfo.h
295  mutex.h
296  mutexblock.h
297  net.h
298  netaddr.h
299  netdb.h
300  netmgr.h
301  netscope.h
302  nonce.h
303  offset.h
304  once.h
305  os.h
306  parseint.h
307  pool.h
308  portset.h
309  print.h
310  quota.h
311  radix.h
312  random.h
313  ratelimiter.h
314  refcount.h
315  regex.h
316  region.h
317  resource.h
318  result.h
319  rwlock.h
320  safe.h
321  serial.h
322  siphash.h
323  sockaddr.h
324  stat.h
325  stats.h
326  stdatomic.h
327  stdio.h
328  stdtime.h
329  strerr.h
330  string.h
331  symtab.h
332  syslog.h
333  task.h
334  taskpool.h
335  thread.h
336  time.h
337  timer.h
338  tls.h
339  tm.h
340  types.h
341  url.h
342  utf8.h
343  util.h
344 include/isccc/
345  alist.h
346  base64.h
347  cc.h
348  ccmsg.h
349  events.h
350  sexpr.h
351  symtab.h
352  symtype.h
353  types.h
354  util.h
355 include/isccfg/
356  aclconf.h
357  cfg.h
358  duration.h
359  grammar.h
360  kaspconf.h
361  log.h
362  namedconf.h
363 include/ns/
364  client.h
365  events.h
366  hooks.h
367  interfacemgr.h
368  listenlist.h
369  log.h
370  notify.h
371  query.h
372  server.h
373  sortlist.h
374  stats.h
375  types.h
376  update.h
377  xfrout.h
378 lib/
379  libbind9-%%LIBVER%%.so
380  libbind9.so
381  libdns-%%LIBVER%%.so
382  libdns.so
383  libirs-%%LIBVER%%.so
384  libirs.so
385  libisc-%%LIBVER%%.so
386  libisc.so
387  libisccc-%%LIBVER%%.so
388  libisccc.so
389  libisccfg-%%LIBVER%%.so
390  libisccfg.so
391  libns-%%LIBVER%%.so
392  libns.so
393 lib/bind/
394  filter-a.so
395  filter-aaaa.so
396 sbin/
397  ddns-confgen
398  named
399  rndc
400  rndc-confgen
401  tsig-keygen
402 share/man/man5/
403  named.conf.5.gz
404  rndc.conf.5.gz
405 share/man/man8/
406  ddns-confgen.8.gz
407  filter-a.8.gz
408  filter-aaaa.8.gz
409  named.8.gz
410  rndc-confgen.8.gz
411  rndc.8.gz
412  tsig-keygen.8.gz
413 @dir(bind,bind,) %%ETCDIR%%/dynamic
414 @dir(bind,bind,) %%ETCDIR%%/slave
415 @dir(bind,bind,) %%ETCDIR%%/working
416
417
418 [FILE:768:manifests/plist.tools]
419 bin/
420  arpaname
421  delv
422  dig
423  dnssec-cds
424  dnssec-dsfromkey
425  dnssec-importkey
426  dnssec-keyfromlabel
427  dnssec-keygen
428  dnssec-revoke
429  dnssec-settime
430  dnssec-signzone
431  dnssec-verify
432  host
433  mdig
434  named-checkconf
435  named-checkzone
436  named-compilezone
437  named-journalprint
438  named-nzd2nzf
439  named-rrchecker
440  nsec3hash
441  nslookup
442  nsupdate
443 share/man/man1/
444  arpaname.1.gz
445  delv.1.gz
446  dig.1.gz
447  dnssec-cds.1.gz
448  dnssec-dsfromkey.1.gz
449  dnssec-importkey.1.gz
450  dnssec-keyfromlabel.1.gz
451  dnssec-keygen.1.gz
452  dnssec-revoke.1.gz
453  dnssec-settime.1.gz
454  dnssec-signzone.1.gz
455  dnssec-verify.1.gz
456  host.1.gz
457  mdig.1.gz
458  named-checkconf.1.gz
459  named-checkzone.1.gz
460  named-compilezone.1.gz
461  named-journalprint.1.gz
462  named-nzd2nzf.1.gz
463  named-rrchecker.1.gz
464  nsec3hash.1.gz
465  nslookup.1.gz
466  nsupdate.1.gz
467
468
469 [FILE:148:files/empty.db]
470 $TTL 3h
471 @ SOA @ nobody.localhost. 42 1d 12h 1w 3h
472         ; Serial, Refresh, Retry, Expire, Neg. cache TTL
473
474 @       NS      @
475
476 ; Silence a BIND warning
477 @       A       127.0.0.1
478
479
480 [FILE:158:files/localhost-forward.db]
481 $TTL 3h
482 localhost. SOA localhost. nobody.localhost. 42 1d 12h 1w 3h
483         ; Serial, Refresh, Retry, Expire, Neg. cache TTL
484
485         NS      localhost.
486
487         A       127.0.0.1
488         AAAA    ::1
489
490
491 [FILE:226:files/localhost-reverse.db]
492 $TTL 3h
493 @ SOA localhost. nobody.localhost. 42 1d 12h 1w 3h
494         ; Serial, Refresh, Retry, Expire, Neg. cache TTL
495
496         NS      localhost.
497
498 1.0.0   PTR     localhost.
499
500 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR localhost.
501
502
503
504 [FILE:19802:files/named.conf.in]
505 // Refer to the named.conf(5) and named(8) man pages, and the documentation
506 // in /usr/local/share/doc/bind for more details.
507 //
508 // If you are going to set up an authoritative server, make sure you
509 // understand the hairy details of how DNS works.  Even with
510 // simple mistakes, you can break connectivity for affected parties,
511 // or cause huge amounts of useless Internet traffic.
512
513 options {
514         // All file and path names are relative to the chroot directory,
515         // if any, and should be fully qualified.
516         directory       "%%ETCDIR%%/working";
517         pid-file        "/var/run/named/pid";
518         dump-file       "/var/dump/named_dump.db";
519         statistics-file "/var/stats/named.stats";
520
521 // If named is being used only as a local resolver, this is a safe default.
522 // For named to be accessible to the network, comment this option, specify
523 // the proper IP address, or delete this option.
524         listen-on       { 127.0.0.1; };
525
526 // If you have IPv6 enabled on this system, uncomment this option for
527 // use as a local resolver.  To give access to the network, specify
528 // an IPv6 address, or the keyword "any".
529 //      listen-on-v6    { ::1; };
530
531 // These zones are already covered by the empty zones listed below.
532 // If you remove the related empty zones below, comment these lines out.
533         disable-empty-zone "255.255.255.255.IN-ADDR.ARPA";
534         disable-empty-zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
535         disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
536
537 // If you've got a DNS server around at your upstream provider, enter
538 // its IP address here, and enable the line below.  This will make you
539 // benefit from its cache, thus reduce overall DNS traffic in the Internet.
540 /*
541         forwarders {
542                 127.0.0.1;
543         };
544 */
545
546 // If the 'forwarders' clause is not empty the default is to 'forward first'
547 // which will fall back to sending a query from your local server if the name
548 // servers in 'forwarders' do not have the answer.  Alternatively you can
549 // force your name server to never initiate queries of its own by enabling the
550 // following line:
551 //      forward only;
552
553 // If you wish to have forwarding configured automatically based on
554 // the entries in /etc/resolv.conf, uncomment the following line and
555 // set named_auto_forward=yes in /etc/rc.conf.  You can also enable
556 // named_auto_forward_only (the effect of which is described above).
557 //      include "%%ETCDIR%%/auto_forward.conf";
558
559         /*
560            Modern versions of BIND use a random UDP port for each outgoing
561            query by default in order to dramatically reduce the possibility
562            of cache poisoning.  All users are strongly encouraged to utilize
563            this feature, and to configure their firewalls to accommodate it.
564
565            AS A LAST RESORT in order to get around a restrictive firewall
566            policy you can try enabling the option below.  Use of this option
567            will significantly reduce your ability to withstand cache poisoning
568            attacks, and should be avoided if at all possible.
569
570            Replace NNNNN in the example with a number between 49160 and 65530.
571         */
572         // query-source address * port NNNNN;
573 };
574
575 // If you enable a local name server, don't forget to enter 127.0.0.1
576 // first in your /etc/resolv.conf so this server will be queried.
577 // Also, make sure to enable it in /etc/rc.conf.
578
579 // The traditional root hints mechanism. Use this, OR the slave zones below.
580 zone "." { type hint; file "%%ETCDIR%%/named.root"; };
581
582 /*      Slaving the following zones from the root name servers has some
583         significant advantages:
584         1. Faster local resolution for your users
585         2. No spurious traffic will be sent from your network to the roots
586         3. Greater resilience to any potential root server failure/DDoS
587
588         On the other hand, this method requires more monitoring than the
589         hints file to be sure that an unexpected failure mode has not
590         incapacitated your server.  Name servers that are serving a lot
591         of clients will benefit more from this approach than individual
592         hosts.  Use with caution.
593
594         To use this mechanism, uncomment the entries below, and comment
595         the hint zone above.
596
597         As documented at http://dns.icann.org/services/axfr/ these zones:
598         "." (the root), ARPA, IN-ADDR.ARPA, IP6.ARPA, and a few others
599         are available for AXFR from these servers on IPv4 and IPv6:
600         xfr.lax.dns.icann.org, xfr.cjr.dns.icann.org
601 */
602 /*
603 zone "." {
604         type slave;
605         file "%%ETCDIR%%/slave/root.slave";
606         masters {
607                 192.0.32.132;           // lax.xfr.dns.icann.org
608                 2620:0:2d0:202::132;    // lax.xfr.dns.icann.org
609                 192.0.47.132;           // iad.xfr.dns.icann.org
610                 2620:0:2830:202::132;   // iad.xfr.dns.icann.org
611         };
612         notify no;
613 };
614 zone "arpa" {
615         type slave;
616         file "%%ETCDIR%%/slave/arpa.slave";
617         masters {
618                 192.0.32.132;           // lax.xfr.dns.icann.org
619                 2620:0:2d0:202::132;    // lax.xfr.dns.icann.org
620                 192.0.47.132;           // iad.xfr.dns.icann.org
621                 2620:0:2830:202::132;   // iad.xfr.dns.icann.org
622         };
623         notify no;
624 };
625 zone "in-addr.arpa" {
626         type slave;
627         file "%%ETCDIR%%/slave/in-addr.arpa.slave";
628         masters {
629                 192.0.32.132;           // lax.xfr.dns.icann.org
630                 2620:0:2d0:202::132;    // lax.xfr.dns.icann.org
631                 192.0.47.132;           // iad.xfr.dns.icann.org
632                 2620:0:2830:202::132;   // iad.xfr.dns.icann.org
633         };
634         notify no;
635 };
636 zone "ip6.arpa" {
637         type slave;
638         file "%%ETCDIR%%/slave/ip6.arpa.slave";
639         masters {
640                 192.0.32.132;           // lax.xfr.dns.icann.org
641                 2620:0:2d0:202::132;    // lax.xfr.dns.icann.org
642                 192.0.47.132;           // iad.xfr.dns.icann.org
643                 2620:0:2830:202::132;   // iad.xfr.dns.icann.org
644         };
645         notify no;
646 };
647 */
648
649 /*      Serving the following zones locally will prevent any queries
650         for these zones leaving your network and going to the root
651         name servers.  This has two significant advantages:
652         1. Faster local resolution for your users
653         2. No spurious traffic will be sent from your network to the roots
654 */
655 // RFCs 1912, 5735 and 6303 (and BCP 32 for localhost)
656 zone "localhost"        { type master; file "%%ETCDIR%%/master/localhost-forward.db"; };
657 zone "127.in-addr.arpa" { type master; file "%%ETCDIR%%/master/localhost-reverse.db"; };
658 zone "255.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
659
660 // RFC 1912-style zone for IPv6 localhost address (RFC 6303)
661 zone "0.ip6.arpa"       { type master; file "%%ETCDIR%%/master/localhost-reverse.db"; };
662
663 // "This" Network (RFCs 1912, 5735 and 6303)
664 zone "0.in-addr.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
665
666 // Private Use Networks (RFCs 1918, 5735 and 6303)
667 zone "10.in-addr.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
668 zone "16.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
669 zone "17.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
670 zone "18.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
671 zone "19.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
672 zone "20.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
673 zone "21.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
674 zone "22.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
675 zone "23.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
676 zone "24.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
677 zone "25.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
678 zone "26.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
679 zone "27.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
680 zone "28.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
681 zone "29.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
682 zone "30.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
683 zone "31.172.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
684 zone "168.192.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
685
686 // Shared Address Space (RFC 6598)
687 zone "64.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
688 zone "65.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
689 zone "66.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
690 zone "67.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
691 zone "68.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
692 zone "69.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
693 zone "70.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
694 zone "71.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
695 zone "72.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
696 zone "73.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
697 zone "74.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
698 zone "75.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
699 zone "76.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
700 zone "77.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
701 zone "78.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
702 zone "79.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
703 zone "80.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
704 zone "81.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
705 zone "82.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
706 zone "83.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
707 zone "84.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
708 zone "85.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
709 zone "86.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
710 zone "87.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
711 zone "88.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
712 zone "89.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
713 zone "90.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
714 zone "91.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
715 zone "92.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
716 zone "93.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
717 zone "94.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
718 zone "95.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
719 zone "96.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
720 zone "97.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
721 zone "98.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
722 zone "99.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
723 zone "100.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
724 zone "101.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
725 zone "102.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
726 zone "103.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
727 zone "104.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
728 zone "105.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
729 zone "106.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
730 zone "107.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
731 zone "108.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
732 zone "109.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
733 zone "110.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
734 zone "111.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
735 zone "112.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
736 zone "113.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
737 zone "114.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
738 zone "115.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
739 zone "116.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
740 zone "117.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
741 zone "118.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
742 zone "119.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
743 zone "120.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
744 zone "121.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
745 zone "122.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
746 zone "123.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
747 zone "124.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
748 zone "125.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
749 zone "126.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
750 zone "127.100.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
751
752 // Link-local/APIPA (RFCs 3927, 5735 and 6303)
753 zone "254.169.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
754
755 // IETF protocol assignments (RFCs 5735 and 5736)
756 zone "0.0.192.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
757
758 // TEST-NET-[1-3] for Documentation (RFCs 5735, 5737 and 6303)
759 zone "2.0.192.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
760 zone "100.51.198.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
761 zone "113.0.203.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
762
763 // IPv6 Example Range for Documentation (RFCs 3849 and 6303)
764 zone "8.b.d.0.1.0.0.2.ip6.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
765
766 // Router Benchmark Testing (RFCs 2544 and 5735)
767 zone "18.198.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
768 zone "19.198.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
769
770 // IANA Reserved - Old Class E Space (RFC 5735)
771 zone "240.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
772 zone "241.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
773 zone "242.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
774 zone "243.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
775 zone "244.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
776 zone "245.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
777 zone "246.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
778 zone "247.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
779 zone "248.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
780 zone "249.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
781 zone "250.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
782 zone "251.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
783 zone "252.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
784 zone "253.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
785 zone "254.in-addr.arpa" { type master; file "%%ETCDIR%%/master/empty.db"; };
786
787 // IPv6 Unassigned Addresses (RFC 4291)
788 zone "1.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
789 zone "3.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
790 zone "4.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
791 zone "5.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
792 zone "6.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
793 zone "7.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
794 zone "8.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
795 zone "9.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
796 zone "a.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
797 zone "b.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
798 zone "c.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
799 zone "d.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
800 zone "e.ip6.arpa"       { type master; file "%%ETCDIR%%/master/empty.db"; };
801 zone "0.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
802 zone "1.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
803 zone "2.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
804 zone "3.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
805 zone "4.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
806 zone "5.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
807 zone "6.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
808 zone "7.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
809 zone "8.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
810 zone "9.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
811 zone "a.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
812 zone "b.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
813 zone "0.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
814 zone "1.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
815 zone "2.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
816 zone "3.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
817 zone "4.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
818 zone "5.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
819 zone "6.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
820 zone "7.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
821
822 // IPv6 ULA (RFCs 4193 and 6303)
823 zone "c.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
824 zone "d.f.ip6.arpa"     { type master; file "%%ETCDIR%%/master/empty.db"; };
825
826 // IPv6 Link Local (RFCs 4291 and 6303)
827 zone "8.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
828 zone "9.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
829 zone "a.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
830 zone "b.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
831
832 // IPv6 Deprecated Site-Local Addresses (RFCs 3879 and 6303)
833 zone "c.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
834 zone "d.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
835 zone "e.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
836 zone "f.e.f.ip6.arpa"   { type master; file "%%ETCDIR%%/master/empty.db"; };
837
838 // IP6.INT is Deprecated (RFC 4159)
839 zone "ip6.int"          { type master; file "%%ETCDIR%%/master/empty.db"; };
840
841 // NB: Do not use the IP addresses below, they are faked, and only
842 // serve demonstration/documentation purposes!
843 //
844 // Example slave zone config entries.  It can be convenient to become
845 // a slave at least for the zone your own domain is in.  Ask
846 // your network administrator for the IP address of the responsible
847 // master name server.
848 //
849 // Do not forget to include the reverse lookup zone!
850 // This is named after the first bytes of the IP address, in reverse
851 // order, with ".IN-ADDR.ARPA" appended, or ".IP6.ARPA" for IPv6.
852 //
853 // Before starting to set up a master zone, make sure you fully
854 // understand how DNS and BIND work.  There are sometimes
855 // non-obvious pitfalls.  Setting up a slave zone is usually simpler.
856 //
857 // NB: Don't blindly enable the examples below. :-)  Use actual names
858 // and addresses instead.
859
860 /* An example dynamic zone
861 key "exampleorgkey" {
862         algorithm hmac-md5;
863         secret "sf87HJqjkqh8ac87a02lla==";
864 };
865 zone "example.org" {
866         type master;
867         allow-update {
868                 key "exampleorgkey";
869         };
870         file "%%ETCDIR%%/dynamic/example.org";
871 };
872 */
873
874 /* Example of a slave reverse zone
875 zone "1.168.192.in-addr.arpa" {
876         type slave;
877         file "%%ETCDIR%%/slave/1.168.192.in-addr.arpa";
878         masters {
879                 192.168.1.1;
880         };
881 };
882 */
883
884
885 [FILE:11623:files/named.in]
886 #!/bin/sh
887 #
888
889 # PROVIDE: named
890 # REQUIRE: %%NAMED_REQUIRE%%
891 # BEFORE: %%NAMED_BEFORE%%
892 # KEYWORD: shutdown
893
894 #
895 # Add the following lines to /etc/rc.conf to enable BIND:
896 # named_enable (bool):              Run named, the DNS server (or NO).
897 # named_program (str):              Path to named, if you want a different one.
898 # named_conf (str):                 Path to the configuration file
899 # named_flags (str):                Use this for flags OTHER than -u and -c
900 # named_uid (str):                  User to run named as
901 # named_chrootdir (str):            Chroot directory (or "" not to auto-chroot it)
902 #                                   Historically, was /var/named
903 # named_chroot_autoupdate (bool):   Automatically install/update chrooted
904 #                                   components of named.
905 # named_symlink_enable (bool):      Symlink the chrooted pid file
906 # named_wait (bool):                Wait for working name service before exiting
907 # named_wait_host (str):            Hostname to check if named_wait is enabled
908 # named_auto_forward (str):         Set up forwarders from /etc/resolv.conf
909 # named_auto_forward_only (str):    Do "forward only" instead of "forward first"
910 #
911
912 . /etc/rc.subr
913
914 name=named
915 desc="named BIND startup script"
916 rcvar=named_enable
917
918 load_rc_config ${name}
919
920 extra_commands=reload
921
922 start_precmd=named_prestart
923 start_postcmd=named_poststart
924 reload_cmd=named_reload
925 stop_cmd=named_stop
926 stop_postcmd=named_poststop
927
928 named_enable=${named_enable:-"NO"}
929 named_program=${named_program:-"%%PREFIX%%/sbin/named"}
930 named_conf=${named_conf:-"%%ETCDIR%%/named.conf"}
931 named_flags=${named_flags:-""}
932 named_uid=${named_uid:-"bind"}
933 named_chrootdir=${named_chrootdir:-""}
934 named_chroot_autoupdate=${named_chroot_autoupdate:-"YES"}
935 named_symlink_enable=${named_symlink_enable:-"YES"}
936 named_wait=${named_wait:-"NO"}
937 named_wait_host=${named_wait_host:-"localhost"}
938 named_auto_forward=${named_auto_forward:-"NO"}
939 named_auto_forward_only=${named_auto_forward_only:-"NO"}
940
941 # Not configuration variables but having them here keeps rclint happy
942 required_dirs="${named_chrootdir}"
943 _named_confdirroot="${named_conf%/*}"
944 _named_confdir="${named_chrootdir}${_named_confdirroot}"
945 _named_program_root="${named_program%/sbin/named}"
946 _openssl_engines="%%LOCALBASE%%/lib/engines"
947
948 # Needed if named.conf and rndc.conf are moved or if rndc.conf is used
949 rndc_conf=${rndc_conf:-"$_named_confdir/rndc.conf"}
950 rndc_key=${rndc_key:-"$_named_confdir/rndc.key"}
951
952 # If running in a chroot cage, ensure that the appropriate files
953 # exist inside the cage, as well as helper symlinks into the cage
954 # from outside.
955 #
956 # As this is called after the is_running and required_dir checks
957 # are made in run_rc_command(), we can safely assume ${named_chrootdir}
958 # exists and named isn't running at this point (unless forcestart
959 # is used).
960 #
961 chroot_autoupdate()
962 {
963         local file
964
965         # If it's the first time around, fiddle with things and move the
966         # current configuration to the chroot.
967         if [ -d ${_named_confdirroot} -a ! -d ${_named_confdir} ]; then
968                 warn "named chroot: Moving current configuration in the chroot!"
969                 install -d ${_named_confdir%/*}
970                 mv ${_named_confdirroot} ${_named_confdir}
971         fi
972
973         # Create (or update) the chroot directory structure
974         #
975         if [ -r %%PREFIX%%/etc/mtree/BIND.chroot.dist ]; then
976                 mtree -deU -f %%PREFIX%%/etc/mtree/BIND.chroot.dist \
977                     -p ${named_chrootdir}
978         else
979                 warn "%%PREFIX%%/etc/mtree/BIND.chroot.dist missing,"
980                 warn "${named_chrootdir} directory structure not updated"
981         fi
982         if [ -r %%PREFIX%%/etc/mtree/BIND.chroot.local.dist ]; then
983                 mkdir -p ${named_chrootdir}%%PREFIX%%
984                 mtree -deU -f %%PREFIX%%/etc/mtree/BIND.chroot.local.dist \
985                     -p ${named_chrootdir}%%PREFIX%%
986         else
987                 warn "%%PREFIX%%/etc/mtree/BIND.chroot.local.dist missing,"
988                 warn "${named_chrootdir}%%PREFIX%% directory structure not updated"
989         fi
990
991         # Create (or update) the configuration directory symlink
992         #
993         if [ ! -L "${_named_confdirroot}" ]; then
994                 if [ -d "${_named_confdirroot}" ]; then
995                         warn "named chroot: ${_named_confdirroot} is a directory!"
996                 elif [ -e "${_named_confdirroot}" ]; then
997                         warn "named chroot: ${_named_confdirroot} exists!"
998                 else
999                         ln -s ${_named_confdir} ${_named_confdirroot}
1000                 fi
1001         else
1002                 # Make sure it points to the right place.
1003                 ln -shf ${_named_confdir} ${_named_confdirroot}
1004         fi
1005
1006         # Mount a devfs in the chroot directory if needed
1007         #
1008         if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then
1009                 umount ${named_chrootdir}/dev 2>/dev/null
1010                 devfs_domount ${named_chrootdir}/dev devfsrules_hide_all
1011                 devfs -m ${named_chrootdir}/dev rule apply path null unhide
1012                 devfs -m ${named_chrootdir}/dev rule apply path random unhide
1013         else
1014                 if [ -c ${named_chrootdir}/dev/null -a \
1015                     -c ${named_chrootdir}/dev/random ]; then
1016                         info "named chroot: using pre-mounted devfs."
1017                 else
1018                         err 1 "named chroot: devfs cannot be mounted from " \
1019                                 "within a jail. Thus a chrooted named cannot " \
1020                                 "be run from within a jail.  Either mount the " \
1021                                 "devfs with null and random from the host, or " \
1022                                 "run named without chrooting it, set " \
1023                                 "named_chrootdir=\"\" in /etc/rc.conf."
1024                 fi
1025         fi
1026
1027         # If OpenSSL from ports, then the engines should be present in the
1028         # chroot, named loads them after chrooting.
1029         if [ -d ${_openssl_engines} ]; then
1030                 # FIXME when 8.4 is gone see if
1031                 # security.jail.param.allow.mount.nullfs can be used.
1032                 if [ `${SYSCTL_N} security.jail.jailed` -eq 0 -o `${SYSCTL_N} security.jail.mount_allowed` -eq 1 ]; then
1033                         mkdir -p ${named_chrootdir}${_openssl_engines}
1034                         mount -t nullfs ${_openssl_engines} ${named_chrootdir}${_openssl_engines}
1035                 else
1036                         warn "named chroot: cannot nullfs mount OpenSSL" \
1037                                 "engines into the chroot, will copy the shared" \
1038                                 "libraries instead."
1039                         mkdir -p ${named_chrootdir}${_openssl_engines}
1040                         cp -f ${_openssl_engines}/*.so ${named_chrootdir}${_openssl_engines}
1041                 fi
1042         fi
1043
1044         # Copy and/or update key files to the chroot /etc
1045         #
1046         for file in localtime protocols services; do
1047                 if [ -r /etc/${file} ] && \
1048                         ! cmp -s /etc/${file} "${named_chrootdir}/etc/${file}"; then
1049                         cp -p /etc/${file} "${named_chrootdir}/etc/${file}"
1050                 fi
1051         done
1052 }
1053
1054 # Make symlinks to the correct pid file
1055 #
1056 make_symlinks()
1057 {
1058         checkyesno named_symlink_enable &&
1059             ln -fs "${named_chrootdir}${pidfile}" ${pidfile}
1060 }
1061
1062 named_poststart()
1063 {
1064         make_symlinks
1065
1066         if checkyesno named_wait; then
1067                 until ${_named_program_root}/bin/host ${named_wait_host} >/dev/null 2>&1; do
1068                         echo "  Waiting for nameserver to resolve ${named_wait_host}"
1069                         sleep 1
1070                 done
1071         fi
1072 }
1073
1074 named_reload()
1075 {
1076         # This is a one line function, but ${named_program} is not defined early
1077         # enough to be there when the reload_cmd variable is defined up there.
1078         rndc reload
1079 }
1080
1081 find_pidfile()
1082 {
1083         if get_pidfile_from_conf pid-file ${named_conf}; then
1084                 pidfile="${_pidfile_from_conf}"
1085         else
1086                 pidfile="/var/run/named/pid"
1087         fi
1088 }
1089
1090 named_stop()
1091 {
1092         find_pidfile
1093
1094         # This duplicates an undesirably large amount of code from the stop
1095         # routine in rc.subr in order to use rndc to shut down the process,
1096         # and to give it a second chance in case rndc fails.
1097         rc_pid=$(check_pidfile ${pidfile} ${command})
1098         if [ -z "${rc_pid}" ]; then
1099                 [ -n "${rc_fast}" ] && return 0
1100                 _run_rc_notrunning
1101                 return 1
1102         fi
1103         echo 'Stopping named.'
1104         if rndc stop; then
1105                 wait_for_pids ${rc_pid}
1106         else
1107                 echo -n 'rndc failed, trying kill: '
1108                 kill -TERM ${rc_pid}
1109                 wait_for_pids ${rc_pid}
1110         fi
1111 }
1112
1113 named_poststop()
1114 {
1115         if [ -n "${named_chrootdir}" -a -c ${named_chrootdir}/dev/null ]; then
1116                 # if using OpenSSL from ports, unmount OpenSSL engines, if they
1117                 # were not mounted but only copied, do nothing.
1118                 if [ -d ${_openssl_engines} -a \( `${SYSCTL_N} security.jail.jailed` -eq 0 -o `${SYSCTL_N} security.jail.mount_allowed` -eq 1 \) ]; then
1119                   umount ${named_chrootdir}${_openssl_engines}
1120                 fi
1121                 # unmount /dev
1122                 if [ `${SYSCTL_N} security.jail.jailed` -eq 0 ]; then
1123                         umount ${named_chrootdir}/dev 2>/dev/null || true
1124                 else
1125                         warn "named chroot:" \
1126                             "cannot unmount devfs from inside jail!"
1127                 fi
1128         fi
1129 }
1130
1131 create_file()
1132 {
1133         if [ -e "$1" ]; then
1134                 unlink $1
1135         fi
1136         install -o root -g wheel -m 0644 /dev/null $1
1137 }
1138
1139 rndc()
1140 {
1141         if [ -z "${rndc_flags}" ]; then
1142                 if [ -s "${rndc_conf}" ] ; then
1143                         rndc_flags="-c ${rndc_conf}"
1144                 elif [ -s "${rndc_key}" ] ; then
1145                         rndc_flags="-k ${rndc_key}"
1146                 else
1147                         rndc_flags=""
1148                 fi
1149         fi
1150
1151         ${_named_program_root}/sbin/rndc ${rndc_flags} "$@"
1152 }
1153
1154 named_prestart()
1155 {
1156         find_pidfile
1157
1158         if [ -n "${named_pidfile}" ]; then
1159                 warn 'named_pidfile: now determined from the conf file'
1160         fi
1161
1162         piddir=`/usr/bin/dirname ${pidfile}`
1163         if [ ! -d ${piddir} ]; then
1164                 install -d -o ${named_uid} -g ${named_uid} ${piddir}
1165         fi
1166
1167         command_args="-u ${named_uid:=root} -c ${named_conf} ${command_args}"
1168
1169         local line nsip firstns
1170
1171         # Is the user using a sandbox?
1172         #
1173         if [ -n "${named_chrootdir}" ]; then
1174                 rc_flags="${rc_flags} -t ${named_chrootdir}"
1175                 checkyesno named_chroot_autoupdate && chroot_autoupdate
1176         else
1177                 named_symlink_enable=NO
1178         fi
1179
1180         # Create an rndc.key file for the user if none exists
1181         #
1182         confgen_command="${_named_program_root}/sbin/rndc-confgen -a -b256 -u ${named_uid} \
1183             -c ${_named_confdir}/rndc.key"
1184         if [ -s "${_named_confdir}/rndc.conf" ]; then
1185                 unset confgen_command
1186         fi
1187         if [ -s "${_named_confdir}/rndc.key" ]; then
1188                 case `stat -f%Su ${_named_confdir}/rndc.key` in
1189                 root|${named_uid}) ;;
1190                 *) ${confgen_command} ;;
1191                 esac
1192         else
1193                 ${confgen_command}
1194         fi
1195
1196         local checkconf
1197
1198         checkconf="${_named_program_root}/sbin/named-checkconf"
1199         if ! checkyesno named_chroot_autoupdate && [ -n "${named_chrootdir}" ]; then
1200                 checkconf="${checkconf} -t ${named_chrootdir}"
1201         fi
1202
1203         # Create a forwarder configuration based on /etc/resolv.conf
1204         if checkyesno named_auto_forward; then
1205                 if [ ! -s /etc/resolv.conf ]; then
1206                         warn "named_auto_forward enabled, but no /etc/resolv.conf"
1207
1208                         # Empty the file in case it is included in named.conf
1209                         [ -s "${_named_confdir}/auto_forward.conf" ] &&
1210                             create_file ${_named_confdir}/auto_forward.conf
1211
1212                         ${checkconf} ${named_conf} ||
1213                             err 3 'named-checkconf for ${named_conf} failed'
1214                         return
1215                 fi
1216
1217                 create_file /var/run/naf-resolv.conf
1218                 create_file /var/run/auto_forward.conf
1219
1220                 echo '  forwarders {' > /var/run/auto_forward.conf
1221
1222                 while read line; do
1223                         case "${line}" in
1224                         'nameserver '*|'nameserver      '*)
1225                                 nsip=${line##nameserver[         ]}
1226
1227                                 if [ -z "${firstns}" ]; then
1228                                         if [ ! "${nsip}" = '127.0.0.1' ]; then
1229                                                 echo 'nameserver 127.0.0.1'
1230                                                 echo "          ${nsip};" >> /var/run/auto_forward.conf
1231                                         fi
1232
1233                                         firstns=1
1234                                 else
1235                                         [ "${nsip}" = '127.0.0.1' ] && continue
1236                                         echo "          ${nsip};" >> /var/run/auto_forward.conf
1237                                 fi
1238                                 ;;
1239                         esac
1240
1241                         echo ${line}
1242                 done < /etc/resolv.conf > /var/run/naf-resolv.conf
1243
1244                 echo '  };' >> /var/run/auto_forward.conf
1245                 echo '' >> /var/run/auto_forward.conf
1246                 if checkyesno named_auto_forward_only; then
1247                         echo "  forward only;" >> /var/run/auto_forward.conf
1248                 else
1249                         echo "  forward first;" >> /var/run/auto_forward.conf
1250                 fi
1251
1252                 if cmp -s /etc/resolv.conf /var/run/naf-resolv.conf; then
1253                         unlink /var/run/naf-resolv.conf
1254                 else
1255                         [ -e /etc/resolv.conf ] && unlink /etc/resolv.conf
1256                         mv /var/run/naf-resolv.conf /etc/resolv.conf
1257                 fi
1258
1259                 if cmp -s ${_named_confdir}/auto_forward.conf \
1260                     /var/run/auto_forward.conf; then
1261                         unlink /var/run/auto_forward.conf
1262                 else
1263                         [ -e "${_named_confdir}/auto_forward.conf" ] &&
1264                             unlink ${_named_confdir}/auto_forward.conf
1265                         mv /var/run/auto_forward.conf \
1266                             ${_named_confdir}/auto_forward.conf
1267                 fi
1268         else
1269                 # Empty the file in case it is included in named.conf
1270                 [ -s "${_named_confdir}/auto_forward.conf" ] &&
1271                     create_file ${_named_confdir}/auto_forward.conf
1272         fi
1273
1274         ${checkconf} ${named_conf} || err 3 "named-checkconf for ${named_conf} failed"
1275 }
1276
1277 run_rc_command "$1"
1278
1279
1280 [FILE:3289:files/named.root]
1281 ;       This file holds the information on root name servers needed to
1282 ;       initialize cache of Internet domain name servers
1283 ;       (e.g. reference this file in the "cache  .  <file>"
1284 ;       configuration file of BIND domain name servers).
1285 ;
1286 ;       This file is made available by InterNIC 
1287 ;       under anonymous FTP as
1288 ;           file                /domain/named.cache
1289 ;           on server           FTP.INTERNIC.NET
1290 ;       -OR-                    RS.INTERNIC.NET
1291 ;
1292 ;       last update:    April 11, 2017
1293 ;       related version of root zone:   2017041101
1294 ;
1295 ; formerly NS.INTERNIC.NET
1296 ;
1297 .                        3600000      NS    A.ROOT-SERVERS.NET.
1298 A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
1299 A.ROOT-SERVERS.NET.      3600000      AAAA  2001:503:ba3e::2:30
1300 ;
1301 ; FORMERLY NS1.ISI.EDU
1302 ;
1303 .                        3600000      NS    B.ROOT-SERVERS.NET.
1304 B.ROOT-SERVERS.NET.      3600000      A     192.228.79.201
1305 B.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:84::b
1306 ;
1307 ; FORMERLY C.PSI.NET
1308 ;
1309 .                        3600000      NS    C.ROOT-SERVERS.NET.
1310 C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
1311 C.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:2::c
1312 ;
1313 ; FORMERLY TERP.UMD.EDU
1314 ;
1315 .                        3600000      NS    D.ROOT-SERVERS.NET.
1316 D.ROOT-SERVERS.NET.      3600000      A     199.7.91.13
1317 D.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:2d::d
1318 ;
1319 ; FORMERLY NS.NASA.GOV
1320 ;
1321 .                        3600000      NS    E.ROOT-SERVERS.NET.
1322 E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
1323 E.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:a8::e
1324 ;
1325 ; FORMERLY NS.ISC.ORG
1326 ;
1327 .                        3600000      NS    F.ROOT-SERVERS.NET.
1328 F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
1329 F.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:2f::f
1330 ;
1331 ; FORMERLY NS.NIC.DDN.MIL
1332 ;
1333 .                        3600000      NS    G.ROOT-SERVERS.NET.
1334 G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
1335 G.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:12::d0d
1336 ;
1337 ; FORMERLY AOS.ARL.ARMY.MIL
1338 ;
1339 .                        3600000      NS    H.ROOT-SERVERS.NET.
1340 H.ROOT-SERVERS.NET.      3600000      A     198.97.190.53
1341 H.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:1::53
1342 ;
1343 ; FORMERLY NIC.NORDU.NET
1344 ;
1345 .                        3600000      NS    I.ROOT-SERVERS.NET.
1346 I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17
1347 I.ROOT-SERVERS.NET.      3600000      AAAA  2001:7fe::53
1348 ;
1349 ; OPERATED BY VERISIGN, INC.
1350 ;
1351 .                        3600000      NS    J.ROOT-SERVERS.NET.
1352 J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30
1353 J.ROOT-SERVERS.NET.      3600000      AAAA  2001:503:c27::2:30
1354 ;
1355 ; OPERATED BY RIPE NCC
1356 ;
1357 .                        3600000      NS    K.ROOT-SERVERS.NET.
1358 K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129
1359 K.ROOT-SERVERS.NET.      3600000      AAAA  2001:7fd::1
1360 ;
1361 ; OPERATED BY ICANN
1362 ;
1363 .                        3600000      NS    L.ROOT-SERVERS.NET.
1364 L.ROOT-SERVERS.NET.      3600000      A     199.7.83.42
1365 L.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:9f::42
1366 ;
1367 ; OPERATED BY WIDE
1368 ;
1369 .                        3600000      NS    M.ROOT-SERVERS.NET.
1370 M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
1371 M.ROOT-SERVERS.NET.      3600000      AAAA  2001:dc3::35
1372 ; End of file
1373
1374
1375 [FILE:1637:files/pkg-message-server.in]
1376 **********************************************************************
1377 *            _  _____ _____ _____ _   _ _____ ___ ___  _   _         *
1378 *           / \|_   _|_   _| ____| \ | |_   _|_ _/ _ \| \ | |        *
1379 *          / _ \ | |   | | |  _| |  \| | | |  | | | | |  \| |        *
1380 *         / ___ \| |   | | | |___| |\  | | |  | | |_| | |\  |        *
1381 *        /_/   \_\_|   |_| |_____|_| \_| |_| |___\___/|_| \_|        *
1382 *                                                                    *
1383 *   BIND requires configuration of rndc, including a "secret" key.   *
1384 *    The easiest, and most secure way to configure rndc is to run    *
1385 *   'rndc-confgen -a' to generate the proper conf file, with a new   *
1386 *            random key, and appropriate file permissions.           *
1387 *                                                                    *
1388 *     The %%PREFIX%%/etc/rc.d/named script will do that for you.         *
1389 *                                                                    *
1390 *      If using syslog to log the BIND9 activity, and using a        *
1391 *     chroot'ed installation, you will need to tell syslog to        *
1392 *       install a log socket in the BIND9 chroot by running:         *
1393 *                                                                    *
1394 *            # sysrc altlog_proglist+=named                          *
1395 *                                                                    *
1396 *    And then restarting syslogd with: service syslogd restart       *
1397 *                                                                    *
1398 **********************************************************************
1399
1400
1401 [FILE:59:files/special.mk]
1402 BIND_ETCDIR?=   etc/namedb
1403 ETCDIR=         ${PREFIX}/${BIND_ETCDIR}
1404