named.conf.sample 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /*
  2. Sample named.conf BIND DNS server 'named' configuration file
  3. for the Red Hat BIND distribution.
  4. See the BIND Administrator's Reference Manual (ARM) for details, in:
  5. file:///usr/share/doc/bind-{version}/arm/Bv9ARM.html
  6. Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
  7. its manual.
  8. */
  9. options
  10. {
  11. // Put files that named is allowed to write in the data/ directory:
  12. directory "/var/named"; // "Working" directory
  13. dump-file "data/cache_dump.db";
  14. statistics-file "data/named_stats.txt";
  15. memstatistics-file "data/named_mem_stats.txt";
  16. /*
  17. Specify listenning interfaces. You can use list of addresses (';' is
  18. delimiter) or keywords "any"/"none"
  19. */
  20. //listen-on port 53 { any; };
  21. listen-on port 53 { 127.0.0.1; };
  22. //listen-on-v6 port 53 { any; };
  23. listen-on-v6 port 53 { ::1; };
  24. /*
  25. Access restrictions
  26. There are two important options:
  27. allow-query { argument; };
  28. - allow queries for authoritative data
  29. allow-query-cache { argument; };
  30. - allow queries for non-authoritative data (mostly cached data)
  31. You can use address, network address or keywords "any"/"localhost"/"none" as argument
  32. Examples:
  33. allow-query { localhost; 10.0.0.1; 192.168.1.0/8; };
  34. allow-query-cache { ::1; fe80::5c63:a8ff:fe2f:4526; 10.0.0.1; };
  35. */
  36. allow-query { localhost; };
  37. allow-query-cache { localhost; };
  38. // Enable/disable recursion - recursion yes/no;
  39. recursion yes;
  40. /* DNSSEC related options. See information about keys ("Trusted keys", bellow) */
  41. /* Enable serving of DNSSEC related data - enable on both authoritative
  42. and recursive servers DNSSEC aware servers */
  43. dnssec-enable yes;
  44. /* Enable DNSSEC validation on recursive servers */
  45. dnssec-validation yes;
  46. /* Enable DLV by default, use built-in ISC DLV key. */
  47. dnssec-lookaside auto;
  48. };
  49. logging
  50. {
  51. /* If you want to enable debugging, eg. using the 'rndc trace' command,
  52. * named will try to write the 'named.run' file in the $directory (/var/named).
  53. * By default, SELinux policy does not allow named to modify the /var/named directory,
  54. * so put the default debug log file in data/ :
  55. */
  56. channel default_debug {
  57. file "data/named.run";
  58. severity dynamic;
  59. };
  60. };
  61. /*
  62. Views let a name server answer a DNS query differently depending on who is asking.
  63. By default, if named.conf contains no "view" clauses, all zones are in the
  64. "default" view, which matches all clients.
  65. Views are processed sequentially. The first match is used so the last view should
  66. match "any" - it's fallback and the most restricted view.
  67. If named.conf contains any "view" clause, then all zones MUST be in a view.
  68. */
  69. view "localhost_resolver"
  70. {
  71. /* This view sets up named to be a localhost resolver ( caching only nameserver ).
  72. * If all you want is a caching-only nameserver, then you need only define this view:
  73. */
  74. match-clients { localhost; };
  75. recursion yes;
  76. # all views must contain the root hints zone:
  77. zone "." IN {
  78. type hint;
  79. file "/var/named/named.ca";
  80. };
  81. /* these are zones that contain definitions for all the localhost
  82. * names and addresses, as recommended in RFC1912 - these names should
  83. * not leak to the other nameservers:
  84. */
  85. include "/etc/named.rfc1912.zones";
  86. };
  87. view "internal"
  88. {
  89. /* This view will contain zones you want to serve only to "internal" clients
  90. that connect via your directly attached LAN interfaces - "localnets" .
  91. */
  92. match-clients { localnets; };
  93. recursion yes;
  94. zone "." IN {
  95. type hint;
  96. file "/var/named/named.ca";
  97. };
  98. /* these are zones that contain definitions for all the localhost
  99. * names and addresses, as recommended in RFC1912 - these names should
  100. * not leak to the other nameservers:
  101. */
  102. include "/etc/named.rfc1912.zones";
  103. // These are your "authoritative" internal zones, and would probably
  104. // also be included in the "localhost_resolver" view above :
  105. /*
  106. NOTE for dynamic DNS zones and secondary zones:
  107. DO NOT USE SAME FILES IN MULTIPLE VIEWS!
  108. If you are using views and DDNS/secondary zones it is strongly
  109. recommended to read FAQ on ISC site (www.isc.org), section
  110. "Configuration and Setup Questions", questions
  111. "How do I share a dynamic zone between multiple views?" and
  112. "How can I make a server a slave for both an internal and an external
  113. view at the same time?"
  114. */
  115. zone "my.internal.zone" {
  116. type master;
  117. file "my.internal.zone.db";
  118. };
  119. zone "my.slave.internal.zone" {
  120. type slave;
  121. file "slaves/my.slave.internal.zone.db";
  122. masters { /* put master nameserver IPs here */ 127.0.0.1; } ;
  123. // put slave zones in the slaves/ directory so named can update them
  124. };
  125. zone "my.ddns.internal.zone" {
  126. type master;
  127. allow-update { key ddns_key; };
  128. file "dynamic/my.ddns.internal.zone.db";
  129. // put dynamically updateable zones in the slaves/ directory so named can update them
  130. };
  131. };
  132. key ddns_key
  133. {
  134. algorithm hmac-md5;
  135. secret "use /usr/sbin/dnssec-keygen to generate TSIG keys";
  136. };
  137. view "external"
  138. {
  139. /* This view will contain zones you want to serve only to "external" clients
  140. * that have addresses that are not match any above view:
  141. */
  142. match-clients { any; };
  143. zone "." IN {
  144. type hint;
  145. file "/var/named/named.ca";
  146. };
  147. recursion no;
  148. // you'd probably want to deny recursion to external clients, so you don't
  149. // end up providing free DNS service to all takers
  150. // These are your "authoritative" external zones, and would probably
  151. // contain entries for just your web and mail servers:
  152. zone "my.external.zone" {
  153. type master;
  154. file "my.external.zone.db";
  155. };
  156. };
  157. /* Trusted keys
  158. This statement contains DNSSEC keys. If you want DNSSEC aware resolver you
  159. have to configure at least one trusted key.
  160. Note that no key written below is valid. Especially root key because root zone
  161. is not signed yet.
  162. */
  163. /*
  164. trusted-keys {
  165. // Root Key
  166. "." 257 3 3 "BNY4wrWM1nCfJ+CXd0rVXyYmobt7sEEfK3clRbGaTwSJxrGkxJWoZu6I7PzJu/
  167. E9gx4UC1zGAHlXKdE4zYIpRhaBKnvcC2U9mZhkdUpd1Vso/HAdjNe8LmMlnzY3
  168. zy2Xy4klWOADTPzSv9eamj8V18PHGjBLaVtYvk/ln5ZApjYghf+6fElrmLkdaz
  169. MQ2OCnACR817DF4BBa7UR/beDHyp5iWTXWSi6XmoJLbG9Scqc7l70KDqlvXR3M
  170. /lUUVRbkeg1IPJSidmK3ZyCllh4XSKbje/45SKucHgnwU5jefMtq66gKodQj+M
  171. iA21AfUVe7u99WzTLzY3qlxDhxYQQ20FQ97S+LKUTpQcq27R7AT3/V5hRQxScI
  172. Nqwcz4jYqZD2fQdgxbcDTClU0CRBdiieyLMNzXG3";
  173. // Key for forward zone
  174. example.com. 257 3 5 "AwEAAaxPMcR2x0HbQV4WeZB6oEDX+r0QM65KbhTjrW1ZaARmPhEZZe
  175. 3Y9ifgEuq7vZ/zGZUdEGNWy+JZzus0lUptwgjGwhUS1558Hb4JKUbb
  176. OTcM8pwXlj0EiX3oDFVmjHO444gLkBO UKUf/mC7HvfwYH/Be22GnC
  177. lrinKJp1Og4ywzO9WglMk7jbfW33gUKvirTHr25GL7STQUzBb5Usxt
  178. 8lgnyTUHs1t3JwCY5hKZ6CqFxmAVZP20igTixin/1LcrgX/KMEGd/b
  179. iuvF4qJCyduieHukuY3H4XMAcR+xia2 nIUPvm/oyWR8BW/hWdzOvn
  180. SCThlHf3xiYleDbt/o1OTQ09A0=";
  181. // Key for reverse zone.
  182. 2.0.192.IN-ADDRPA.NET. 257 3 5 "AQOnS4xn/IgOUpBPJ3bogzwcxOdNax071L18QqZnQQQA
  183. VVr+iLhGTnNGp3HoWQLUIzKrJVZ3zggy3WwNT6kZo6c0
  184. tszYqbtvchmgQC8CzKojM/W16i6MG/ea fGU3siaOdS0
  185. yOI6BgPsw+YZdzlYMaIJGf4M4dyoKIhzdZyQ2bYQrjyQ
  186. 4LB0lC7aOnsMyYKHHYeRv PxjIQXmdqgOJGq+vsevG06
  187. zW+1xgYJh9rCIfnm1GX/KMgxLPG2vXTD/RnLX+D3T3UL
  188. 7HJYHJhAZD5L59VvjSPsZJHeDCUyWYrvPZesZDIRvhDD
  189. 52SKvbheeTJUm6EhkzytNN2SN96QRk8j/iI8ib";
  190. };
  191. */