reference.rst 313 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478
.. 
   Copyright (C) Internet Systems Consortium, Inc. ("ISC")
   
   This Source Code Form is subject to the terms of the Mozilla Public
   License, v. 2.0. If a copy of the MPL was not distributed with this
   file, You can obtain one at http://mozilla.org/MPL/2.0/.
   
   See the COPYRIGHT file distributed with this work for additional
   information regarding copyright ownership.

.. Reference:

BIND 9 Configuration Reference
==============================

BIND 9 configuration is broadly similar to BIND 8; however, there are a
few new areas of configuration, such as views. BIND 8 configuration
files should work with few alterations in BIND 9, although more complex
configurations should be reviewed to check if they can be more
efficiently implemented using the new features found in BIND 9.

BIND 4 configuration files can be converted to the new format using the
shell script ``contrib/named-bootconf/named-bootconf.sh``.

.. _configuration_file_elements:

Configuration File Elements
---------------------------

Following is a list of elements used throughout the BIND configuration
file documentation:

.. glossary::

    ``acl_name``
        The name of an ``address_match_list`` as defined by the ``acl`` statement.

    ``address_match_list``
        A list of one or more ``ip_addr``, ``ip_prefix``, ``key_id``, or ``acl_name`` elements, see :ref:`address_match_lists`.

    ``masters_list``
        A named list of one or more ``ip_addr`` with optional ``key_id`` and/or ``ip_port``. A ``masters_list`` may include other ``masters_lists``.

    ``domain_name``
        A quoted string which will be used as a DNS name, for example "``my.test.domain``".

    ``namelist``
        A list of one or more ``domain_name`` elements.

    ``dotted_decimal``
        One to four integers valued 0 through 255 separated by dots ('.'), such as ``123``, ``45.67`` or ``89.123.45.67``.

    ``ip4_addr``
        An IPv4 address with exactly four elements in ``dotted_decimal`` notation.

    ``ip6_addr``
        An IPv6 address, such as ``2001:db8::1234` IPv6 scoped addresses that have ambiguity on their scope zones must be disambiguated by an appropriate zone ID with the percent character ('%') as delimiter. It is strongly recommended to use string zone names rather than numeric identifiers, in order to be robust against system configuration changes.  However, since there is no standard mapping for such names and identifier values, currently only interface names as link identifiers are supported, assuming one-to-one mapping between interfaces and links. For example, a link-local address ``fe80::1`` on the link attached to the interface ``ne0`` can be specified as ``fe80::1%ne0``. Note that on most systems link-local addresses always have the ambiguity, and need to be disambiguated.

    ``ip_addr``
        An ``ip4_addr`` or ``ip6_addr``.

    ``ip_dscp``
        A ``number`` between 0 and 63, used to select a differentiated services code point (DSCP) value for use with outgoing traffic on operating systems that support DSCP.

    ``ip_port``
        An IP port ``number``. The ``number`` is limited to 0 through 65535, with values below 1024 typically restricted to use by processes running as root. In some cases, an asterisk (``*``) character can be used as a placeholder to select a random high-numbered port.

    ``ip_prefix``
        An IP network specified as an ``ip_addr``, followed by a slash ('/') and then the number of bits in the netmask. Trailing zeros in an``ip_addr`` may omitted. For example, ``127/8`` is the network ``127.0.0.0`` with network ``1.2.3.0`` with netmask ``255.255.255.240``.
        When specifying a prefix involving a IPv6 scoped address the scope may be omitted. In that case the prefix will match packets from any scope.

    ``key_id``
        A ``domain_name`` representing the name of a shared key, to be used for transaction security.

    ``key_list``
        A list of one or more ``key_id``\ s, separated by semicolons and ending with a semicolon.

    ``number``
        A non-negative 32-bit integer (i.e., a number between 0 and 4294967295, inclusive). Its acceptable value might be further limited by the context in which it is used.

    ``fixedpoint``
        A non-negative real number that can be specified to the nearest one hundredth. Up to five digits can be specified before a decimal point, and up to two digits after, so the maximum value is 99999.99. Acceptable values might be further limited by the context in which it is used.

    ``path_name``
        A quoted string which will be used as a pathname, such as ``zones/master/my.test.domain``.

    ``port_list``
        A list of an ``ip_port`` or a port range. A port range is specified in the form of ``range`` followed by two ``ip_port``\ s, ``port_low`` and ``port_high``, which represents port numbers from ``port_low`` through ``port_high``, inclusive. ``port_low`` must not be larger than ``port_high``. For example, ``range 1024 65535`` represents ports from 1024 through 65535. In either case an asterisk ('\*') character is not allowed as a valid ``ip_port``.

    ``size_spec``
        A 64-bit unsigned integer, or the keywords ``unlimited`` or ``default``. Integers may take values 0 <= value <= 18446744073709551615, though certain parameters (such as ``max-journal-size``) may use a more limited range within these extremes. In most cases, setting a value to 0 does not literally mean zero; it means "undefined" or "as big as possible", depending on the context. See the explanations of particular parameters that use ``size_spec`` for details on how they interpret its use. Numeric values can optionally be followed by a scaling factor: ``K`` or ``k`` for kilobytes, ``M`` or ``m`` for megabytes, and ``G`` or ``g`` for gigabytes, which scale by 1024, 1024*1024, and 1024*1024*1024 respectively.
        ``unlimited`` generally means "as big as possible", and is usually the best way to safely set a very large number.
        ``default`` uses the limit that was in force when the server was started.

    ``size_or_percent``
            ``size_spec`` or integer value followed by'%' to represent percents. The behavior is exactly the same as ``size_spec``, but ``size_or_percent`` allows also to specify a positive integer value followed by '%' sign to represent percents.

    ``yes_or_no``
        Either ``yes`` or ``no``. The words ``true`` numbers ``1`` and ``0``. The words ``true`` and ``false`` are also accepted, as are the numbers ``1`` and ``0``.

    ``dialup_option``
        One of ``yes``, ``no``, ``notify``, ``notify-passive``, ``refresh`` or  ``passive``. When used in a zone, ``notify-passive``, ``refresh``, and ``passive`` are restricted to slave and stub zones.

.. _address_match_lists:

Address Match Lists
~~~~~~~~~~~~~~~~~~~

Syntax
^^^^^^

::

   address_match_list = address_match_list_element ; ...

   address_match_list_element = [ ! ] ( ip_address | ip_prefix |
        key key_id | acl_name | { address_match_list } )

Definition and Usage
^^^^^^^^^^^^^^^^^^^^

Address match lists are primarily used to determine access control for
various server operations. They are also used in the ``listen-on`` and
``sortlist`` statements. The elements which constitute an address match
list can be any of the following:

-  an IP address (IPv4 or IPv6)

-  an IP prefix (in '/' notation)

-  a key ID, as defined by the ``key`` statement

-  the name of an address match list defined with the ``acl`` statement

-  a nested address match list enclosed in braces

Elements can be negated with a leading exclamation mark (``!``), and the
match list names "any", "none", "localhost", and "localnets" are
predefined. More information on those names can be found in the
description of the acl statement.

The addition of the key clause made the name of this syntactic element
something of a misnomer, since security keys can be used to validate
access without regard to a host or network address. Nonetheless, the
term "address match list" is still used throughout the documentation.

When a given IP address or prefix is compared to an address match list,
the comparison takes place in approximately O(1) time. However, key
comparisons require that the list of keys be traversed until a matching
key is found, and therefore may be somewhat slower.

The interpretation of a match depends on whether the list is being used
for access control, defining ``listen-on`` ports, or in a ``sortlist``,
and whether the element was negated.

When used as an access control list, a non-negated match allows access
and a negated match denies access. If there is no match, access is
denied. The clauses ``allow-notify``, ``allow-recursion``,
``allow-recursion-on``, ``allow-query``, ``allow-query-on``,
``allow-query-cache``, ``allow-query-cache-on``, ``allow-transfer``,
``allow-update``, ``allow-update-forwarding``, ``blackhole``, and
``keep-response-order`` all use address match lists. Similarly, the
``listen-on`` option will cause the server to refuse queries on any of
the machine's addresses which do not match the list.

Order of insertion is significant. If more than one element in an ACL is
found to match a given IP address or prefix, preference will be given to
the one that came *first* in the ACL definition. Because of this
first-match behavior, an element that defines a subset of another
element in the list should come before the broader element, regardless
of whether either is negated. For example, in ``1.2.3/24; ! 1.2.3.13;``
the 1.2.3.13 element is completely useless because the algorithm will
match any lookup for 1.2.3.13 to the 1.2.3/24 element. Using
``! 1.2.3.13; 1.2.3/24`` fixes that problem by having 1.2.3.13 blocked
by the negation, but all other 1.2.3.\* hosts fall through.

.. _comment_syntax:

Comment Syntax
~~~~~~~~~~~~~~

The BIND 9 comment syntax allows for comments to appear anywhere that
whitespace may appear in a BIND configuration file. To appeal to
programmers of all kinds, they can be written in the C, C++, or
shell/perl style.

Syntax
^^^^^^

::

   /* This is a BIND comment as in C */

::

   // This is a BIND comment as in C++

::

   # This is a BIND comment as in common UNIX shells
   # and perl

Definition and Usage
^^^^^^^^^^^^^^^^^^^^

Comments may appear anywhere that whitespace may appear in a BIND
configuration file.

C-style comments start with the two characters /\* (slash, star) and end
with \*/ (star, slash). Because they are completely delimited with these
characters, they can be used to comment only a portion of a line or to
span multiple lines.

C-style comments cannot be nested. For example, the following is not
valid because the entire comment ends with the first \*/:

::

   /* This is the start of a comment.
      This is still part of the comment.
   /* This is an incorrect attempt at nesting a comment. */
      This is no longer in any comment. */

C++-style comments start with the two characters // (slash, slash) and
continue to the end of the physical line. They cannot be continued
across multiple physical lines; to have one logical comment span
multiple lines, each line must use the // pair. For example:

::

   // This is the start of a comment.  The next line
   // is a new comment, even though it is logically
   // part of the previous comment.

Shell-style (or perl-style, if you prefer) comments start with the
character ``#`` (number sign) and continue to the end of the physical
line, as in C++ comments. For example:

::

   # This is the start of a comment.  The next line
   # is a new comment, even though it is logically
   # part of the previous comment.

..

.. warning::

   You cannot use the semicolon (``;``) character to start a comment such
   as you would in a zone file. The semicolon indicates the end of a
   configuration statement.

.. _Configuration_File_Grammar:

Configuration File Grammar
--------------------------

A BIND 9 configuration consists of statements and comments. Statements
end with a semicolon. Statements and comments are the only elements that
can appear without enclosing braces. Many statements contain a block of
sub-statements, which are also terminated with a semicolon.

The following statements are supported:

    ``acl``
        defines a named IP address matching list, for access control and other uses.

    ``controls``
        declares control channels to be used by the ``rndc`` utility.

    ``dnssec-policy``
        describes a DNSSEC key and signing policy for zones. See :ref:`dnssec-policy Grammar <dnssec_policy_grammar>` for details.

    ``include``
        includes a file.

    ``key``
        specifies key information for use in authentication and authorization using TSIG.

    ``logging``
        specifies what the server logs, and where the log messages are sent.

    ``masters``
        defines a named masters list for inclusion in stub and slave zones' ``masters`` or ``also-notify`` lists.

    ``options``
        controls global server configuration options and sets defaults for other statements.

    ``server``
        sets certain configuration options on a per-server basis.

    ``statistics-channels``
        declares communication channels to get access to ``named`` statistics.

    ``trust-anchors``
        defines DNSSEC trust anchors: if used with the ``initial-key`` or ``initial-ds`` keyword, trust anchors are kept up to date using :rfc:`5011` trust anchor maintenance, and if used with ``static-key`` or ``static-ds``, keys are permanent.

    ``managed-keys``
        is identical to ``trust-anchors``; this option is deprecated in favor of ``trust-anchors`` with the ``initial-key`` keyword, and may be removed in a future release. for backward compatibility.

    ``trusted-keys``
        defines permanent trusted DNSSEC keys; this option is deprecated in favor of ``trust-anchors`` with the ``static-key`` keyword, and may be removed in a future release.                                  |
    ``view``
        defines a view.

    ``zone``
        defines a zone.

The ``logging`` and ``options`` statements may only occur once per
configuration.

.. _acl_grammar:

``acl`` Statement Grammar
~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: ../misc/acl.grammar.rst

.. _acl:

``acl`` Statement Definition and Usage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``acl`` statement assigns a symbolic name to an address match list.
It gets its name from a primary use of address match lists: Access
Control Lists (ACLs).

The following ACLs are built-in:

    ``any``
        Matches all hosts.

    ``none``
        Matches no hosts.

    ``localhost``
        Matches the IPv4 and IPv6 addresses of all network interfaces on the system. When addresses are added or removed, the ``localhost`` ACL element is updated to reflect the changes.

    ``localnets``
        Matches any host on an IPv4 or IPv6 network for which the system has an interface. When addresses are added or removed, the ``localnets`` ACL element is updated to reflect the changes. Some systems do not provide a way to determine the prefix lengths of local IPv6  addresses. In such a case, ``localnets`` only matches the local IPv6 addresses, just like ``localhost``.

.. _controls_grammar:

``controls`` Statement Grammar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: ../misc/controls.grammar.rst

.. _controls_statement_definition_and_usage:

``controls`` Statement Definition and Usage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``controls`` statement declares control channels to be used by
system administrators to control the operation of the name server. These
control channels are used by the ``rndc`` utility to send commands to
and retrieve non-DNS results from a name server.

An ``inet`` control channel is a TCP socket listening at the specified
``ip_port`` on the specified ``ip_addr``, which can be an IPv4 or IPv6
address. An ``ip_addr`` of ``*`` (asterisk) is interpreted as the IPv4
wildcard address; connections will be accepted on any of the system's
IPv4 addresses. To listen on the IPv6 wildcard address, use an
``ip_addr`` of ``::``. If you will only use ``rndc`` on the local host,
using the loopback address (``127.0.0.1`` or ``::1``) is recommended for
maximum security.

If no port is specified, port 953 is used. The asterisk "``*``" cannot
be used for ``ip_port``.

The ability to issue commands over the control channel is restricted by
the ``allow`` and ``keys`` clauses. Connections to the control channel
are permitted based on the ``address_match_list``. This is for simple IP
address based filtering only; any ``key_id`` elements of the
``address_match_list`` are ignored.

A ``unix`` control channel is a UNIX domain socket listening at the
specified path in the file system. Access to the socket is specified by
the ``perm``, ``owner`` and ``group`` clauses. Note on some platforms
(SunOS and Solaris) the permissions (``perm``) are applied to the parent
directory as the permissions on the socket itself are ignored.

The primary authorization mechanism of the command channel is the
``key_list``, which contains a list of ``key_id``\ s. Each ``key_id`` in
the ``key_list`` is authorized to execute commands over the control
channel. See :ref:`admin_tools`) for information about
configuring keys in ``rndc``.

If the ``read-only`` clause is enabled, the control channel is limited
to the following set of read-only commands: ``nta -dump``, ``null``,
``status``, ``showzone``, ``testgen``, and ``zonestatus``. By default,
``read-only`` is not enabled and the control channel allows read-write
access.

If no ``controls`` statement is present, ``named`` will set up a default
control channel listening on the loopback address 127.0.0.1 and its IPv6
counterpart ::1. In this case, and also when the ``controls`` statement
is present but does not have a ``keys`` clause, ``named`` will attempt
to load the command channel key from the file ``rndc.key`` in ``/etc``
(or whatever ``sysconfdir`` was specified as when BIND was built). To
create a ``rndc.key`` file, run ``rndc-confgen -a``.

The ``rndc.key`` feature was created to ease the transition of systems
from BIND 8, which did not have digital signatures on its command
channel messages and thus did not have a ``keys`` clause. It makes it
possible to use an existing BIND 8 configuration file in BIND 9
unchanged, and still have ``rndc`` work the same way ``ndc`` worked in
BIND 8, simply by executing the command ``rndc-confgen -a`` after BIND 9
is installed.

Since the ``rndc.key`` feature is only intended to allow the
backward-compatible usage of BIND 8 configuration files, this feature
does not have a high degree of configurability. You cannot easily change
the key name or the size of the secret, so you should make a
``rndc.conf`` with your own key if you wish to change those things. The
``rndc.key`` file also has its permissions set such that only the owner
of the file (the user that ``named`` is running as) can access it. If
you desire greater flexibility in allowing other users to access
``rndc`` commands, then you need to create a ``rndc.conf`` file and make
it group readable by a group that contains the users who should have
access.

To disable the command channel, use an empty ``controls`` statement:
``controls { };``.

.. _include_grammar:

``include`` Statement Grammar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

   include filename;

.. _include_statement:

``include`` Statement Definition and Usage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``include`` statement inserts the specified file (or files if a valid glob
expression is detected) at the point where the ``include`` statement is
encountered. The ``include`` statement facilitates the administration of
configuration files by permitting the reading or writing of some things but not
others. For example, the statement could include private keys that are readable
only by the name server.

.. _key_grammar:

``key`` Statement Grammar
~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: ../misc/key.grammar.rst

.. _key_statement:

``key`` Statement Definition and Usage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``key`` statement defines a shared secret key for use with TSIG (see
:ref:`tsig`) or the command channel (see :ref:`controls_statement_definition_and_usage`).

The ``key`` statement can occur at the top level of the configuration
file or inside a ``view`` statement. Keys defined in top-level ``key``
statements can be used in all views. Keys intended for use in a
``controls`` statement (see :ref:`controls_statement_definition_and_usage`)
must be defined at the top level.

The key_id, also known as the key name, is a domain name uniquely
identifying the key. It can be used in a ``server`` statement to cause
requests sent to that server to be signed with this key, or in address
match lists to verify that incoming requests have been signed with a key
matching this name, algorithm, and secret.

The algorithm_id is a string that specifies a security/authentication
algorithm. The ``named`` server supports ``hmac-md5``, ``hmac-sha1``,
``hmac-sha224``, ``hmac-sha256``, ``hmac-sha384`` and ``hmac-sha512``
TSIG authentication. Truncated hashes are supported by appending the
minimum number of required bits preceded by a dash, e.g.
``hmac-sha1-80``. The secret_string is the secret to be used by the
algorithm, and is treated as a Base64 encoded string.

.. _logging_grammar:

``logging`` Statement Grammar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: ../misc/logging.grammar.rst

.. _logging_statement:

``logging`` Statement Definition and Usage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``logging`` statement configures a wide variety of logging options
for the name server. Its ``channel`` phrase associates output methods,
format options and severity levels with a name that can then be used
with the ``category`` phrase to select how various classes of messages
are logged.

Only one ``logging`` statement is used to define as many channels and
categories as are wanted. If there is no ``logging`` statement, the
logging configuration will be:

::

   logging {
        category default { default_syslog; default_debug; };
        category unmatched { null; };
   };

If ``named`` is started with the ``-L`` option, it logs to the specified
file at startup, instead of using syslog. In this case the logging
configuration will be:

::

   logging {
        category default { default_logfile; default_debug; };
        category unmatched { null; };
   };

The logging configuration is only established when the entire
configuration file has been parsed. When the server is starting up, all
logging messages regarding syntax errors in the configuration file go to
the default channels, or to standard error if the ``-g`` option was
specified.

.. _channel:

The ``channel`` Phrase
^^^^^^^^^^^^^^^^^^^^^^

All log output goes to one or more *channels*; you can make as many of
them as you want.

Every channel definition must include a destination clause that says
whether messages selected for the channel go to a file, to a particular
syslog facility, to the standard error stream, or are discarded. It can
optionally also limit the message severity level that will be accepted
by the channel (the default is ``info``), and whether to include a
``named``-generated time stamp, the category name and/or severity level
(the default is not to include any).

The ``null`` destination clause causes all messages sent to the channel
to be discarded; in that case, other options for the channel are
meaningless.

The ``file`` destination clause directs the channel to a disk file. It
can include additional arguments to specify how large the file is
allowed to become before it is rolled to a backup file (``size``), how
many backup versions of the file will be saved each time this happens
(``versions``), and the format to use for naming backup versions
(``suffix``).

The ``size`` option is used to limit log file growth. If the file ever
exceeds the specified size, then ``named`` will stop writing to the file
unless it has a ``versions`` option associated with it. If backup
versions are kept, the files are rolled as described below. If there is
no ``versions`` option, no more data will be written to the log until
some out-of-band mechanism removes or truncates the log to less than the
maximum size. The default behavior is not to limit the size of the file.

File rolling only occurs when the file exceeds the size specified with
the ``size`` option. No backup versions are kept by default; any
existing log file is simply appended. The ``versions`` option specifies
how many backup versions of the file should be kept. If set to
``unlimited``, there is no limit.

The ``suffix`` option can be set to either ``increment`` or
``timestamp``. If set to ``timestamp``, then when a log file is rolled,
it is saved with the current timestamp as a file suffix. If set to
``increment``, then backup files are saved with incrementing numbers as
suffixes; older files are renamed when rolling. For example, if
``versions`` is set to 3 and ``suffix`` to ``increment``, then when
``filename.log`` reaches the size specified by ``size``,
``filename.log.1`` is renamed to ``filename.log.2``, ``filename.log.0``
is renamed to ``filename.log.1``, and ``filename.log`` is renamed to
``filename.log.0``, whereupon a new ``filename.log`` is opened.

Example usage of the ``size``, ``versions``, and ``suffix`` options:

::

   channel an_example_channel {
       file "example.log" versions 3 size 20m suffix increment;
       print-time yes;
       print-category yes;
   };

The ``syslog`` destination clause directs the channel to the system log.
Its argument is a syslog facility as described in the ``syslog`` man
page. Known facilities are ``kern``, ``user``, ``mail``, ``daemon``,
``auth``, ``syslog``, ``lpr``, ``news``, ``uucp``, ``cron``,
``authpriv``, ``ftp``, ``local0``, ``local1``, ``local2``, ``local3``,
``local4``, ``local5``, ``local6`` and ``local7``, however not all
facilities are supported on all operating systems. How ``syslog`` will
handle messages sent to this facility is described in the
``syslog.conf`` man page. If you have a system which uses a very old
version of ``syslog`` that only uses two arguments to the ``openlog()``
function, then this clause is silently ignored.

On Windows machines syslog messages are directed to the EventViewer.

The ``severity`` clause works like ``syslog``'s "priorities", except
that they can also be used if you are writing straight to a file rather
than using ``syslog``. Messages which are not at least of the severity
level given will not be selected for the channel; messages of higher
severity levels will be accepted.

If you are using ``syslog``, then the ``syslog.conf`` priorities will
also determine what eventually passes through. For example, defining a
channel facility and severity as ``daemon`` and ``debug`` but only
logging ``daemon.warning`` via ``syslog.conf`` will cause messages of
severity ``info`` and ``notice`` to be dropped. If the situation were
reversed, with ``named`` writing messages of only ``warning`` or higher,
then ``syslogd`` would print all messages it received from the channel.

The ``stderr`` destination clause directs the channel to the server's
standard error stream. This is intended for use when the server is
running as a foreground process, for example when debugging a
configuration.

The server can supply extensive debugging information when it is in
debugging mode. If the server's global debug level is greater than zero,
then debugging mode will be active. The global debug level is set either
by starting the ``named`` server with the ``-d`` flag followed by a
positive integer, or by running ``rndc trace``. The global debug level
can be set to zero, and debugging mode turned off, by running ``rndc
notrace``. All debugging messages in the server have a debug level, and
higher debug levels give more detailed output. Channels that specify a
specific debug severity, for example:

::

   channel specific_debug_level {
       file "foo";
       severity debug 3;
   };

will get debugging output of level 3 or less any time the server is in
debugging mode, regardless of the global debugging level. Channels with
``dynamic`` severity use the server's global debug level to determine
what messages to print.

``print-time`` can be set to ``yes``, ``no``, or a time format
specifier, which may be one of ``local``, ``iso8601`` or
``iso8601-utc``. If set to ``no``, then the date and time will not be
logged. If set to ``yes`` or ``local``, the date and time are logged in
a human readable format, using the local time zone. If set to
``iso8601`` the local time is logged in ISO8601 format. If set to
``iso8601-utc``, then the date and time are logged in ISO8601 format,
with time zone set to UTC. The default is ``no``.

``print-time`` may be specified for a ``syslog`` channel, but it is
usually pointless since ``syslog`` also logs the date and time.

If ``print-category`` is requested, then the category of the message
will be logged as well. Finally, if ``print-severity`` is on, then the
severity level of the message will be logged. The ``print-`` options may
be used in any combination, and will always be printed in the following
order: time, category, severity. Here is an example where all three
``print-`` options are on:

``28-Feb-2000 15:05:32.863 general: notice: running``

If ``buffered`` has been turned on the output to files will not be
flushed after each log entry. By default all log messages are flushed.

There are four predefined channels that are used for ``named``'s default
logging as follows. If ``named`` is started with the ``-L`` then a fifth
channel ``default_logfile`` is added. How they are used is described in
:ref:`the_category_phrase`.

::

   channel default_syslog {
       // send to syslog's daemon facility
       syslog daemon;
       // only send priority info and higher
       severity info;
   };

   channel default_debug {
       // write to named.run in the working directory
       // Note: stderr is used instead of "named.run" if
       // the server is started with the '-g' option.
       file "named.run";
       // log at the server's current debug level
       severity dynamic;
   };

   channel default_stderr {
       // writes to stderr
       stderr;
       // only send priority info and higher
       severity info;
   };

   channel null {
      // toss anything sent to this channel
      null;
   };

   channel default_logfile {
       // this channel is only present if named is
       // started with the -L option, whose argument
       // provides the file name
       file "...";
       // log at the server's current debug level
       severity dynamic;
   };

The ``default_debug`` channel has the special property that it only
produces output when the server's debug level is nonzero. It normally
writes to a file called ``named.run`` in the server's working directory.

For security reasons, when the ``-u`` command line option is used, the
``named.run`` file is created only after ``named`` has changed to the
new UID, and any debug output generated while ``named`` is starting up
and still running as root is discarded. If you need to capture this
output, you must run the server with the ``-L`` option to specify a
default logfile, or the ``-g`` option to log to standard error which you
can redirect to a file.

Once a channel is defined, it cannot be redefined. Thus you cannot alter
the built-in channels directly, but you can modify the default logging
by pointing categories at channels you have defined.

.. _the_category_phrase:

The ``category`` Phrase
^^^^^^^^^^^^^^^^^^^^^^^

There are many categories, so you can send the logs you want to see
wherever you want, without seeing logs you don't want. If you don't
specify a list of channels for a category, then log messages in that
category will be sent to the ``default`` category instead. If you don't
specify a default category, the following "default default" is used:

::

   category default { default_syslog; default_debug; };

If you start ``named`` with the ``-L`` option then the default category
is:

::

   category default { default_logfile; default_debug; };

As an example, let's say you want to log security events to a file, but
you also want keep the default logging behavior. You'd specify the
following:

::

   channel my_security_channel {
       file "my_security_file";
       severity info;
   };
   category security {
       my_security_channel;
       default_syslog;
       default_debug;
   };

To discard all messages in a category, specify the ``null`` channel:

::

   category xfer-out { null; };
   category notify { null; };

Following are the available categories and brief descriptions of the
types of log information they contain. More categories may be added in
future BIND releases.

.. include:: logging-categories.rst

.. _query_errors:

The ``query-errors`` Category
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``query-errors`` category is used to indicate why and how specific queries
resulted in responses which indicate an error.  Normally, these messages will be
logged at ``debug`` logging levels; note, however, that if query logging is
active, some will be logged at ``info``. The logging levels are described below:

At ``debug`` levels of 1 or higher, - or at ``info``, when query logging is
active - each response with the rcode of SERVFAIL is logged as follows:

``client 127.0.0.1#61502: query failed (SERVFAIL) for www.example.com/IN/AAAA at query.c:3880``

This means an error resulting in SERVFAIL was detected at line 3880 of source
file ``query.c``.  Log messages of this level will particularly help identify
the cause of SERVFAIL for an authoritative server.

At ``debug`` level 2 or higher, detailed context information about recursive
resolutions that resulted in SERVFAIL will be logged.  The log message will look
like this:

::

   fetch completed at resolver.c:2970 for www.example.com/A
   in 10.000183: timed out/success [domain:example.com,
   referral:2,restart:7,qrysent:8,timeout:5,lame:0,quota:0,neterr:0,
   badresp:1,adberr:0,findfail:0,valfail:0]

The first part before the colon shows that a recursive resolution for
AAAA records of www.example.com completed in 10.000183 seconds and the
final result that led to the SERVFAIL was determined at line 2970 of
source file ``resolver.c``.

The following part shows the detected final result and the latest result of
DNSSEC validation.  The latter is always "success" when no validation attempt
was made.  In this example, this query probably resulted in SERVFAIL because all
name servers are down or unreachable, leading to a timeout in 10 seconds.
DNSSEC validation was probably not attempted.

The last part, enclosed in square brackets, shows statistics collected for this
particular resolution attempt.  The ``domain`` field shows the deepest zone that
the resolver reached; it is the zone where the error was finally detected.  The
meaning of the other fields is summarized in the following list.

``referral``
    The number of referrals the resolver received throughout the resolution process. In the above example.com there are two.

``restart``
    The number of cycles that the resolver tried remote servers at the ``domain`` zone. In each cycle the resolver sends one query (possibly resending it, depending on the response) to each known name server of the ``domain`` zone.

``qrysent``
      The number of queries the resolver sent at the ``domain`` zone.

``timeout``
    The number of timeouts since the resolver received since the last response.

``lame``
    The number of lame servers the resolver detected at the ``domain`` zone. A server is detected to be lame either by an invalid response or as a result of lookup in BIND9's address database (ADB), where lame servers are cached.

``quota``
    The number of times the resolver was unable to send a query because it had exceeded the permissible fetch quota for a server.

``neterr``
    The number of erroneous results that the resolver encountered in sending queries at the ``domain`` zone. One common case is the remote server is unreachable and the resolver receives an ICMP unreachable error message.                         |

``badresp``
    The number of unexpected responses (other than``lame``) to queries sent by the resolver at the``domain`` zone.

``adberr``
    Failures in finding remote server addresses of the``domain`` zone in the ADB. One common case of this is that the remote server's name does not have any address records.

``findfail``
    Failures of resolving remote server addresses. This is a total number of failures throughout the eesolution process.

``valfail``
    Failures of DNSSEC validation. Validation failures are counted throughout the resolution process (not limited to the ``domain`` zone), but should only happen in ``domain``.

At ``debug`` level 3 or higher, the same messages as those at
``debug`` level 1 will be logged for other errors than
SERVFAIL. Note that negative responses such as NXDOMAIN are not errors, and are
not logged at this debug level.

At ``debug`` level 4 or higher, the detailed context information logged at
``debug`` level 2 will be logged for other errors than SERVFAIL and for negative
resonses such as NXDOMAIN.

.. _masters_grammar:

``masters`` Statement Grammar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: ../misc/masters.grammar.rst

.. _masters_statement:

``masters`` Statement Definition and Usage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``masters`` lists allow for a common set of masters to be easily used by
multiple stub and slave zones in their ``masters`` or ``also-notify``
lists.

.. _options_grammar:

``options`` Statement Grammar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is the grammar of the ``options`` statement in the ``named.conf``
file:

.. include:: ../misc/options.grammar.rst

.. _options:

``options`` Statement Definition and Usage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``options`` statement sets up global options to be used by BIND.
This statement may appear only once in a configuration file. If there is
no ``options`` statement, an options block with each option set to its
default will be used.

``attach-cache``
   Allows multiple views to share a single cache database. Each view has
   its own cache database by default, but if multiple views have the
   same operational policy for name resolution and caching, those views
   can share a single cache to save memory and possibly improve
   resolution efficiency by using this option.

   The ``attach-cache`` option may also be specified in ``view``
   statements, in which case it overrides the global ``attach-cache``
   option.

   The cache_name specifies the cache to be shared. When the ``named``
   server configures views which are supposed to share a cache, it
   creates a cache with the specified name for the first view of these
   sharing views. The rest of the views will simply refer to the already
   created cache.

   One common configuration to share a cache would be to allow all views
   to share a single cache. This can be done by specifying the
   ``attach-cache`` as a global option with an arbitrary name.

   Another possible operation is to allow a subset of all views to share
   a cache while the others to retain their own caches. For example, if
   there are three views A, B, and C, and only A and B should share a
   cache, specify the ``attach-cache`` option as a view A (or B)'s
   option, referring to the other view name:

   ::

        view "A" {
          // this view has its own cache
          ...
        };
        view "B" {
          // this view refers to A's cache
          attach-cache "A";
        };
        view "C" {
          // this view has its own cache
          ...
        };

   Views that share a cache must have the same policy on configurable
   parameters that may affect caching. The current implementation
   requires the following configurable options be consistent among these
   views: ``check-names``, ``dnssec-accept-expired``,
   ``dnssec-validation``, ``max-cache-ttl``, ``max-ncache-ttl``,
   ``max-stale-ttl``, ``max-cache-size``, and ``min-cache-ttl``,
   ``min-ncache-ttl``, ``zero-no-soa-ttl``.

   Note that there may be other parameters that may cause confusion if
   they are inconsistent for different views that share a single cache.
   For example, if these views define different sets of forwarders that
   can return different answers for the same question, sharing the
   answer does not make sense or could even be harmful. It is
   administrator's responsibility to ensure configuration differences in
   different views do not cause disruption with a shared cache.

``directory``
   The working directory of the server. Any non-absolute pathnames in
   the configuration file will be taken as relative to this directory.
   The default location for most server output files (e.g.
   ``named.run``) is this directory. If a directory is not specified,
   the working directory defaults to \`\ ``.``', the directory from
   which the server was started. The directory specified should be an
   absolute path, and *must* be writable by the effective user ID of the
   ``named`` process.

``dnstap``
   ``dnstap`` is a fast, flexible method for capturing and logging DNS
   traffic. Developed by Robert Edmonds at Farsight Security, Inc., and
   supported by multiple DNS implementations, ``dnstap`` uses
   ``libfstrm`` (a lightweight high-speed framing library, see
   https://github.com/farsightsec/fstrm) to send event payloads which
   are encoded using Protocol Buffers (``libprotobuf-c``, a mechanism
   for serializing structured data developed by Google, Inc.; see
   https://developers.google.com/protocol-buffers/).

   To enable ``dnstap`` at compile time, the ``fstrm`` and
   ``protobuf-c`` libraries must be available, and BIND must be
   configured with ``--enable-dnstap``.

   The ``dnstap`` option is a bracketed list of message types to be
   logged. These may be set differently for each view. Supported types
   are ``client``, ``auth``, ``resolver``, ``forwarder``, and
   ``update``. Specifying type ``all`` will cause all ``dnstap``
   messages to be logged, regardless of type.

   Each type may take an additional argument to indicate whether to log
   ``query`` messages or ``response`` messages; if not specified, both
   queries and responses are logged.

   Example: To log all authoritative queries and responses, recursive
   client responses, and upstream queries sent by the resolver, use:

   ::

      dnstap {
        auth;
        client response;
        resolver query;
      };

   Logged ``dnstap`` messages can be parsed using the ``dnstap-read``
   utility (see :ref:`man_dnstap-read` for details).

   For more information on ``dnstap``, see http://dnstap.info.

   The fstrm library has a number of tunables that are exposed in
   ``named.conf``, and can be modified if necessary to improve
   performance or prevent loss of data. These are:

   -  ``fstrm-set-buffer-hint``: The threshold number of bytes to
      accumulate in the output buffer before forcing a buffer flush. The
      minimum is 1024, the maximum is 65536, and the default is 8192.

   -  ``fstrm-set-flush-timeout``: The number of seconds to allow
      unflushed data to remain in the output buffer. The minimum is 1
      second, the maximum is 600 seconds (10 minutes), and the default
      is 1 second.

   -  ``fstrm-set-output-notify-threshold``: The number of outstanding
      queue entries to allow on an input queue before waking the I/O
      thread. The minimum is 1 and the default is 32.

   -  ``fstrm-set-output-queue-model``: Controls the queuing semantics
      to use for queue objects. The default is ``mpsc`` (multiple
      producer, single consumer); the other option is ``spsc`` (single
      producer, single consumer).

   -  ``fstrm-set-input-queue-size``: The number of queue entries to
      allocate for each input queue. This value must be a power of 2.
      The minimum is 2, the maximum is 16384, and the default is 512.

   -  ``fstrm-set-output-queue-size``: The number of queue entries to
      allocate for each output queue. The minimum is 2, the maximum is
      system-dependent and based on ``IOV_MAX``, and the default is 64.

   -  ``fstrm-set-reopen-interval``: The number of seconds to wait
      between attempts to reopen a closed output stream. The minimum is
      1 second, the maximum is 600 seconds (10 minutes), and the default
      is 5 seconds. For convenience, TTL-style time unit suffixes may be
      used to specify the value.

   Note that all of the above minimum, maximum, and default values are
   set by the ``libfstrm`` library, and may be subject to change in
   future versions of the library. See the ``libfstrm`` documentation
   for more information.

``dnstap-output``
   Configures the path to which the ``dnstap`` frame stream will be sent
   if ``dnstap`` is enabled at compile time and active.

   The first argument is either ``file`` or ``unix``, indicating whether
   the destination is a file or a UNIX domain socket. The second
   argument is the path of the file or socket. (Note: when using a
   socket, ``dnstap`` messages will only be sent if another process such
   as ``fstrm_capture`` (provided with ``libfstrm``) is listening on the
   socket.)

   If the first argument is ``file``, then up to three additional
   options can be added: ``size`` indicates the size to which a
   ``dnstap`` log file can grow before being rolled to a new file;
   ``versions`` specifies the number of rolled log files to retain; and
   ``suffix`` indicates whether to retain rolled log files with an
   incrementing counter as the suffix (``increment``) or with the
   current timestamp (``timestamp``). These are similar to the ``size``,
   ``versions``, and ``suffix`` options in a ``logging`` channel. The
   default is to allow ``dnstap`` log files to grow to any size without
   rolling.

   ``dnstap-output`` can only be set globally in ``options``. Currently,
   it can only be set once while ``named`` is running; once set, it
   cannot be changed by ``rndc reload`` or ``rndc reconfig``.

``dnstap-identity``
   Specifies an ``identity`` string to send in ``dnstap`` messages. If
   set to ``hostname``, which is the default, the server's hostname will
   be sent. If set to ``none``, no identity string will be sent.

``dnstap-version``
   Specifies a ``version`` string to send in ``dnstap`` messages. The
   default is the version number of the BIND release. If set to
   ``none``, no version string will be sent.

``geoip-directory``
   When ``named`` is compiled using the MaxMind GeoIP2 geolocation API, this
   specifies the directory containing GeoIP database files.  By default, the
   option is set based on the prefix used to build the ``libmaxminddb`` module:
   for example, if the library is installed in ``/usr/local/lib``, then the
   default ``geoip-directory`` will be ``/usr/local/share/GeoIP``. On Windows,
   the default is the ``named`` working directory.  See :ref:`acl`
   for details about ``geoip`` ACLs.

``key-directory``
   When performing dynamic update of secure zones, the directory where
   the public and private DNSSEC key files should be found, if different
   than the current working directory. (Note that this option has no
   effect on the paths for files containing non-DNSSEC keys such as
   ``bind.keys``, ``rndc.key`` or ``session.key``.)

``lmdb-mapsize``
   When ``named`` is built with liblmdb, this option sets a maximum size
   for the memory map of the new-zone database (NZD) in LMDB database
   format. This database is used to store configuration information for
   zones added using ``rndc addzone``. Note that this is not the NZD
   database file size, but the largest size that the database may grow
   to.

   Because the database file is memory mapped, its size is limited by
   the address space of the named process. The default of 32 megabytes
   was chosen to be usable with 32-bit ``named`` builds. The largest
   permitted value is 1 terabyte. Given typical zone configurations
   without elaborate ACLs, a 32 MB NZD file ought to be able to hold
   configurations of about 100,000 zones.

``managed-keys-directory``
   Specifies the directory in which to store the files that track managed DNSSEC
   keys (i.e., those configured using the ``initial-key`` or ``initial-ds``
   keywords in a ``trust-anchors`` statement). By default, this is the working
   directory. The directory *must* be writable by the effective user ID of the
   ``named`` process.

   If ``named`` is not configured to use views, then managed keys for
   the server will be tracked in a single file called
   ``managed-keys.bind``. Otherwise, managed keys will be tracked in
   separate files, one file per view; each file name will be the view
   name (or, if it contains characters that are incompatible with use as
   a file name, the SHA256 hash of the view name), followed by the
   extension ``.mkeys``.

   (Note: in previous releases, file names for views always used the
   SHA256 hash of the view name. To ensure compatibility after upgrade,
   if a file using the old name format is found to exist, it will be
   used instead of the new format.)

``max-ixfr-ratio``
   Sets the size threshold (expressed as a percentage of the size of the full
   zone) beyond which ``named`` will choose to use an AXFR response rather than
   IXFR when answering zone transfer requests.  See
   :ref:`incremental_zone_transfers`.

``new-zones-directory``
   Specifies the directory in which to store the configuration
   parameters for zones added via ``rndc addzone``. By default, this is
   the working directory. If set to a relative path, it will be relative
   to the working directory. The directory *must* be writable by the
   effective user ID of the ``named`` process.

``qname-minimization``
   This option controls QNAME minimization behaviour in the BIND
   resolver. When set to ``strict``, BIND will follow the QNAME
   minimization algorithm to the letter, as specified in :rfc:`7816`.
   Setting this option to ``relaxed`` will cause BIND to fall back to
   normal (non-minimized) query mode when it receives either NXDOMAIN or
   other unexpected responses (e.g. SERVFAIL, improper zone cut,
   REFUSED) to a minimized query. ``disabled`` disables QNAME
   minimization completely. The current default is ``relaxed``, but it
   might be changed to ``strict`` in a future release.

``tkey-gssapi-keytab``
   The KRB5 keytab file to use for GSS-TSIG updates. If this option is
   set and tkey-gssapi-credential is not set, then updates will be
   allowed with any key matching a principal in the specified keytab.

``tkey-gssapi-credential``
   The security credential with which the server should authenticate
   keys requested by the GSS-TSIG protocol. Currently only Kerberos 5
   authentication is available and the credential is a Kerberos
   principal which the server can acquire through the default system key
   file, normally ``/etc/krb5.keytab``. The location keytab file can be
   overridden using the tkey-gssapi-keytab option. Normally this
   principal is of the form "``DNS/``\ ``server.domain``". To use
   GSS-TSIG, ``tkey-domain`` must also be set if a specific keytab is
   not set with tkey-gssapi-keytab.

``tkey-domain``
   The domain appended to the names of all shared keys generated with
   ``TKEY``. When a client requests a ``TKEY`` exchange, it may or may
   not specify the desired name for the key. If present, the name of the
   shared key will be ``client specified part`` + ``tkey-domain``.
   Otherwise, the name of the shared key will be ``random hex digits``
   + ``tkey-domain``. In most cases, the ``domainname``
   should be the server's domain name, or an otherwise non-existent
   subdomain like "_tkey.``domainname``". If you are using GSS-TSIG,
   this variable must be defined, unless you specify a specific keytab
   using tkey-gssapi-keytab.

``tkey-dhkey``
   The Diffie-Hellman key used by the server to generate shared keys
   with clients using the Diffie-Hellman mode of ``TKEY``. The server
   must be able to load the public and private keys from files in the
   working directory. In most cases, the ``key_name`` should be the
   server's host name.

``cache-file``
   This is for testing only. Do not use.

``dump-file``
   The pathname of the file the server dumps the database to when
   instructed to do so with ``rndc dumpdb``. If not specified, the
   default is ``named_dump.db``.

``memstatistics-file``
   The pathname of the file the server writes memory usage statistics to
   on exit. If not specified, the default is ``named.memstats``.

``lock-file``
   The pathname of a file on which ``named`` will attempt to acquire a
   file lock when starting up for the first time; if unsuccessful, the
   server will will terminate, under the assumption that another server
   is already running. If not specified, the default is
   ``none``.

   Specifying ``lock-file none`` disables the use of a lock file.
   ``lock-file`` is ignored if ``named`` was run using the ``-X``
   option, which overrides it. Changes to ``lock-file`` are ignored if
   ``named`` is being reloaded or reconfigured; it is only effective
   when the server is first started up.

``pid-file``
   The pathname of the file the server writes its process ID in. If not
   specified, the default is ``/var/run/named/named.pid``. The PID file
   is used by programs that want to send signals to the running name
   server. Specifying ``pid-file none`` disables the use of a PID file —
   no file will be written and any existing one will be removed. Note
   that ``none`` is a keyword, not a filename, and therefore is not
   enclosed in double quotes.

``recursing-file``
   The pathname of the file the server dumps the queries that are
   currently recursing when instructed to do so with ``rndc recursing``.
   If not specified, the default is ``named.recursing``.

``statistics-file``
   The pathname of the file the server appends statistics to when
   instructed to do so using ``rndc stats``. If not specified, the
   default is ``named.stats`` in the server's current directory. The
   format of the file is described in :ref:`statsfile`.

``bindkeys-file``
   The pathname of a file to override the built-in trusted keys provided
   by ``named``. See the discussion of ``dnssec-validation`` for
   details. If not specified, the default is ``/etc/bind.keys``.

``secroots-file``
   The pathname of the file the server dumps security roots to when
   instructed to do so with ``rndc secroots``. If not specified, the
   default is ``named.secroots``.

``session-keyfile``
   The pathname of the file into which to write a TSIG session key
   generated by ``named`` for use by ``nsupdate -l``. If not specified,
   the default is ``/var/run/named/session.key``. (See :ref:`dynamic_update_policies`,
   and in particular the discussion of the ``update-policy`` statement's
   ``local`` option for more information about this feature.)

``session-keyname``
   The key name to use for the TSIG session key. If not specified, the
   default is "local-ddns".

``session-keyalg``
   The algorithm to use for the TSIG session key. Valid values are
   hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384, hmac-sha512 and
   hmac-md5. If not specified, the default is hmac-sha256.

``port``
   The UDP/TCP port number the server uses for receiving and sending DNS
   protocol traffic. The default is 53. This option is mainly intended
   for server testing; a server using a port other than 53 will not be
   able to communicate with the global DNS.

``dscp``
   The global Differentiated Services Code Point (DSCP) value to
   classify outgoing DNS traffic on operating systems that support DSCP.
   Valid values are 0 through 63. It is not configured by default.

``random-device``
   Specifies a source of entropy to be used by the server. This is a
   device or file from which to read entropy. If it is a file,
   operations requiring entropy will fail when the file has been
   exhausted.

   Entropy is needed for cryptographic operations such as TKEY
   transactions, dynamic update of signed zones, and generation of TSIG
   session keys. It is also used for seeding and stirring the
   pseudo-random number generator, which is used for less critical
   functions requiring randomness such as generation of DNS message
   transaction ID's.

   If ``random-device`` is not specified, or if it is set to ``none``,
   entropy will be read from the random number generation function
   supplied by the cryptographic library with which BIND was linked
   (i.e. OpenSSL or a PKCS#11 provider).

   The ``random-device`` option takes effect during the initial
   configuration load at server startup time and is ignored on
   subsequent reloads.

``preferred-glue``
   If specified, the listed type (A or AAAA) will be emitted before
   other glue in the additional section of a query response. The default
   is to prefer A records when responding to queries that arrived via
   IPv4 and AAAA when responding to queries that arrived via IPv6.

.. _root-delegation-only:

``root-delegation-only``
   Turn on enforcement of delegation-only in TLDs (top level domains)
   and root zones with an optional exclude list.

   DS queries are expected to be made to and be answered by delegation
   only zones. Such queries and responses are treated as an exception to
   delegation-only processing and are not converted to NXDOMAIN
   responses provided a CNAME is not discovered at the query name.

   If a delegation only zone server also serves a child zone it is not
   always possible to determine whether an answer comes from the
   delegation only zone or the child zone. SOA NS and DNSKEY records are
   apex only records and a matching response that contains these records
   or DS is treated as coming from a child zone. RRSIG records are also
   examined to see if they are signed by a child zone or not. The
   authority section is also examined to see if there is evidence that
   the answer is from the child zone. Answers that are determined to be
   from a child zone are not converted to NXDOMAIN responses. Despite
   all these checks there is still a possibility of false negatives when
   a child zone is being served.

   Similarly false positives can arise from empty nodes (no records at
   the name) in the delegation only zone when the query type is not ANY.

   Note some TLDs are not delegation only (e.g. "DE", "LV", "US" and
   "MUSEUM"). This list is not exhaustive.

   ::

      options {
          root-delegation-only exclude { "de"; "lv"; "us"; "museum"; };
      };

``disable-algorithms``
   Disable the specified DNSSEC algorithms at and below the specified
   name. Multiple ``disable-algorithms`` statements are allowed. Only
   the best match ``disable-algorithms`` clause will be used to
   determine which algorithms are used.

   If all supported algorithms are disabled, the zones covered by the
   ``disable-algorithms`` will be treated as insecure.

   Configured trust anchors in ``trusted-anchors`` (or ``managed-keys`` or
   ``trusted-keys``) that match a disabled algorithm will be ignored and treated
   as if they were not configured at all.

``disable-ds-digests``
   Disable the specified DS digest types at and below the specified
   name. Multiple ``disable-ds-digests`` statements are allowed. Only
   the best match ``disable-ds-digests`` clause will be used to
   determine which digest types are used.

   If all supported digest types are disabled, the zones covered by the
   ``disable-ds-digests`` will be treated as insecure.

``dnssec-must-be-secure``
   Specify hierarchies which must be or may not be secure (signed and
   validated). If ``yes``, then ``named`` will only accept answers if
   they are secure. If ``no``, then normal DNSSEC validation applies
   allowing for insecure answers to be accepted. The specified domain
   must be defined as a trust anchor, for instance in a ``trust-anchors``
   statement, or ``dnssec-validation auto`` must be active.

``dns64``
   This directive instructs ``named`` to return mapped IPv4 addresses to
   AAAA queries when there are no AAAA records. It is intended to be
   used in conjunction with a NAT64. Each ``dns64`` defines one DNS64
   prefix. Multiple DNS64 prefixes can be defined.

   Compatible IPv6 prefixes have lengths of 32, 40, 48, 56, 64 and 96 as per
   :rfc:`6052`. Bits 64..71 inclusive must be zero with the most significate bit
   of the prefix in position 0.

   Additionally a reverse IP6.ARPA zone will be created for the prefix
   to provide a mapping from the IP6.ARPA names to the corresponding
   IN-ADDR.ARPA names using synthesized CNAMEs. ``dns64-server`` and
   ``dns64-contact`` can be used to specify the name of the server and
   contact for the zones. These are settable at the view / options
   level. These are not settable on a per-prefix basis.

   Each ``dns64`` supports an optional ``clients`` ACL that determines
   which clients are affected by this directive. If not defined, it
   defaults to ``any;``.

   Each ``dns64`` supports an optional ``mapped`` ACL that selects which
   IPv4 addresses are to be mapped in the corresponding A RRset. If not
   defined it defaults to ``any;``.

   Normally, DNS64 won't apply to a domain name that owns one or more
   AAAA records; these records will simply be returned. The optional
   ``exclude`` ACL allows specification of a list of IPv6 addresses that
   will be ignored if they appear in a domain name's AAAA records, and
   DNS64 will be applied to any A records the domain name owns. If not
   defined, ``exclude`` defaults to ::ffff:0.0.0.0/96.

   A optional ``suffix`` can also be defined to set the bits trailing
   the mapped IPv4 address bits. By default these bits are set to
   ``::``. The bits matching the prefix and mapped IPv4 address must be
   zero.

   If ``recursive-only`` is set to ``yes`` the DNS64 synthesis will only
   happen for recursive queries. The default is ``no``.

   If ``break-dnssec`` is set to ``yes`` the DNS64 synthesis will happen
   even if the result, if validated, would cause a DNSSEC validation
   failure. If this option is set to ``no`` (the default), the DO is set
   on the incoming query, and there are RRSIGs on the applicable
   records, then synthesis will not happen.

   ::

          acl rfc1918 { 10/8; 192.168/16; 172.16/12; };

          dns64 64:FF9B::/96 {
              clients { any; };
              mapped { !rfc1918; any; };
              exclude { 64:FF9B::/96; ::ffff:0000:0000/96; };
              suffix ::;
          };

``dnssec-loadkeys-interval``
   When a zone is configured with ``auto-dnssec maintain;`` its key
   repository must be checked periodically to see if any new keys have
   been added or any existing keys' timing metadata has been updated
   (see :ref:`man_dnssec-keygen` and :ref:`man_dnssec-settime`).
   The ``dnssec-loadkeys-interval`` option
   sets the frequency of automatic repository checks, in minutes.  The
   default is ``60`` (1 hour), the minimum is ``1`` (1 minute), and
   the maximum is ``1440`` (24 hours); any higher value is silently
   reduced.

``dnssec-policy``
   Specifies which key and signing policy (KASP) should be used for this zone.
   This is a string referring to a ``dnssec-policy`` statement.  There are two
   built-in policies: ``default`` allows you to use the default policy, and
   ``none`` means not to use any DNSSEC policy, keeping the zone unsigned.  The
   default is ``none``.  See :ref:`dnssec-policy Grammar
   <dnssec_policy_grammar>` for more details.

``dnssec-update-mode``
   If this option is set to its default value of ``maintain`` in a zone
   of type ``master`` which is DNSSEC-signed and configured to allow
   dynamic updates (see :ref:`dynamic_update_policies`), and if ``named`` has access
   to the private signing key(s) for the zone, then ``named`` will
   automatically sign all new or changed records and maintain signatures
   for the zone by regenerating RRSIG records whenever they approach
   their expiration date.

   If the option is changed to ``no-resign``, then ``named`` will sign
   all new or changed records, but scheduled maintenance of signatures
   is disabled.

   With either of these settings, ``named`` will reject updates to a
   DNSSEC-signed zone when the signing keys are inactive or unavailable
   to ``named``. (A planned third option, ``external``, will disable all
   automatic signing and allow DNSSEC data to be submitted into a zone
   via dynamic update; this is not yet implemented.)

``nta-lifetime``
   Species the default lifetime, in seconds, that will be used for
   negative trust anchors added via ``rndc nta``.

   A negative trust anchor selectively disables DNSSEC validation for
   zones that are known to be failing because of misconfiguration rather
   than an attack. When data to be validated is at or below an active
   NTA (and above any other configured trust anchors), ``named`` will
   abort the DNSSEC validation process and treat the data as insecure
   rather than bogus. This continues until the NTA's lifetime is
   elapsed. NTAs persist across ``named`` restarts.

   For convenience, TTL-style time unit suffixes can be used to specify the NTA
   lifetime in seconds, minutes or hours. It also accepts ISO 8601 duration
   formats.

   ``nta-lifetime`` defaults to one hour. It cannot exceed one week.

``nta-recheck``
   Species how often to check whether negative trust anchors added via
   ``rndc nta`` are still necessary.

   A negative trust anchor is normally used when a domain has stopped
   validating due to operator error; it temporarily disables DNSSEC
   validation for that domain. In the interest of ensuring that DNSSEC
   validation is turned back on as soon as possible, ``named`` will
   periodically send a query to the domain, ignoring negative trust
   anchors, to find out whether it can now be validated. If so, the
   negative trust anchor is allowed to expire early.

   Validity checks can be disabled for an individual NTA by using
   ``rndc nta -f``, or for all NTAs by setting ``nta-recheck`` to zero.

   For convenience, TTL-style time unit suffixes can be used to specify the NTA
   recheck interval in seconds, minutes or hours. It also accepts ISO 8601
   duration formats.

   The default is five minutes. It cannot be longer than ``nta-lifetime`` (which
   cannot be longer than a week).

``max-zone-ttl``
   Specifies a maximum permissible TTL value in seconds. For
   convenience, TTL-style time unit suffixes may be used to specify the
   maximum value. When loading a zone file using a ``masterfile-format``
   of ``text`` or ``raw``, any record encountered with a TTL higher than
   ``max-zone-ttl`` will cause the zone to be rejected.

   This is useful in DNSSEC-signed zones because when rolling to a new
   DNSKEY, the old key needs to remain available until RRSIG records
   have expired from caches. The ``max-zone-ttl`` option guarantees that
   the largest TTL in the zone will be no higher than the set value.

   (NOTE: Because ``map``-format files load directly into memory, this
   option cannot be used with them.)

   The default value is ``unlimited``. A ``max-zone-ttl`` of zero is
   treated as ``unlimited``.

``stale-answer-ttl``
   Specifies the TTL to be returned on stale answers. The default is 1
   second. The minimum allowed is also 1 second; a value of 0 will be
   updated silently to 1 second.

   For stale answers to be returned, they must be enabled, either in the
   configuration file using ``stale-answer-enable`` or via
   ``rndc serve-stale on``.

``serial-update-method``
   Zones configured for dynamic DNS may use this option to set the
   update method that will be used for the zone serial number in the SOA
   record.

   With the default setting of ``serial-update-method increment;``, the
   SOA serial number will be incremented by one each time the zone is
   updated.

   When set to ``serial-update-method unixtime;``, the SOA serial number
   will be set to the number of seconds since the UNIX epoch, unless the
   serial number is already greater than or equal to that value, in
   which case it is simply incremented by one.

   When set to ``serial-update-method date;``, the new SOA serial number
   will be the current date in the form "YYYYMMDD", followed by two
   zeroes, unless the existing serial number is already greater than or
   equal to that value, in which case it is incremented by one.

``zone-statistics``
   If ``full``, the server will collect statistical data on all zones
   (unless specifically turned off on a per-zone basis by specifying
   ``zone-statistics terse`` or ``zone-statistics none`` in the ``zone``
   statement). The default is ``terse``, providing minimal statistics on
   zones (including name and current serial number, but not query type
   counters).

   These statistics may be accessed via the ``statistics-channel`` or
   using ``rndc stats``, which will dump them to the file listed in the
   ``statistics-file``. See also :ref:`statsfile`.

   For backward compatibility with earlier versions of BIND 9, the
   ``zone-statistics`` option can also accept ``yes`` or ``no``; ``yes``
   has the same meaning as ``full``. As of BIND 9.10, ``no`` has the
   same meaning as ``none``; previously, it was the same as ``terse``.

.. _boolean_options:

Boolean Options
^^^^^^^^^^^^^^^

``automatic-interface-scan``

   If ``yes`` and and supported by the operating system, automatically rescan
   network interfaces when the interface addresses are added or removed.  The
   default is ``yes``.  This configuration option does not affect time based
   ``interface-interval`` option, and it is recommended to set the time based
   ``interface-interval`` to 0 when the operator confirms that automatic
   interface scanning is supported by the operating system.

   The ``automatic-interface-scan`` implementation uses routing sockets for the
   network interface discovery, and therefore the operating system has to
   support the routing sockets for this feature to work.

``allow-new-zones``
   If ``yes``, then zones can be added at runtime via ``rndc addzone``.
   The default is ``no``.

   Newly added zones' configuration parameters are stored so that they
   can persist after the server is restarted. The configuration
   information is saved in a file called ``viewname.nzf`` (or, if
   ``named`` is compiled with liblmdb, in an LMDB database file called
   ``viewname.nzd``). viewname is the name of the view, unless the view
   name contains characters that are incompatible with use as a file
   name, in which case a cryptographic hash of the view name is used
   instead.

   Zones added at runtime will have their configuration stored either in
   a new-zone file (NZF) or a new-zone database (NZD) depending on
   whether ``named`` was linked with liblmdb at compile time. See
   :ref:`man_rndc` for further details about ``rndc addzone``.

``auth-nxdomain``
   If ``yes``, then the ``AA`` bit is always set on NXDOMAIN responses,
   even if the server is not actually authoritative. The default is
   ``no``. If you are using very old DNS software, you may need to set
   it to ``yes``.

``deallocate-on-exit``
   This option was used in BIND 8 to enable checking for memory leaks on
   exit. BIND 9 ignores the option and always performs the checks.

``memstatistics``
   Write memory statistics to the file specified by
   ``memstatistics-file`` at exit. The default is ``no`` unless '-m
   record' is specified on the command line in which case it is ``yes``.

``dialup``
   If ``yes``, then the server treats all zones as if they are doing
   zone transfers across a dial-on-demand dialup link, which can be
   brought up by traffic originating from this server. This has
   different effects according to zone type and concentrates the zone
   maintenance so that it all happens in a short interval, once every
   ``heartbeat-interval`` and hopefully during the one call. It also