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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 99.2beta8 (1.46)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>40. named -- Domain Name Server</TITLE>
<META NAME="description" CONTENT="40. named -- Domain Name Server">
<META NAME="keywords" CONTENT="rute">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v99.2beta8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="rute.css">
<LINK REL="next" HREF="node44.html">
<LINK REL="previous" HREF="node42.html">
<LINK REL="up" HREF="rute.html">
<LINK REL="next" HREF="node44.html">
</HEAD>
<BODY BGCOLOR=#FFFFFF >
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR><TD align=left bgcolor="#000000">
<FONT COLOR=white>
<A HREF="http://www.icon.co.za/~psheer/rute-purchase.html"><FONT COLOR=white>Purchase</FONT></A>
</FONT>
</TD><TD align=center bgcolor="#000000">
<FONT COLOR=white>
Copyright © 2002 Paul Sheer. <A HREF="copying.html"><FONT COLOR=white>Click here for copying permissions.</FONT></A>
</FONT>
</TD><TD align=right bgcolor="#000000">
<FONT COLOR=white>
<A HREF="http://www.icon.co.za/~psheer/rute-home.html"><FONT COLOR=white>Home</FONT></A>
</FONT>
</TD></TR>
<TR><TD colspan=2 align=left bgcolor="#ECEBF4">
<IMG SRC="va-btn-small-light-60.png">
</TD><TD align=right bgcolor="#ECEBF4">
<IMG SRC="sflogo2-steel-60.png">
</TD></TR>
</TABLE><BR>
<!--Navigation Panel-->
<A NAME="tex2html2766"
HREF="node44.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html2762"
HREF="rute.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html2756"
HREF="node42.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html2764"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2767"
HREF="node44.html">41. Point-to-Point Protocol </A>
<B> Up:</B> <A NAME="tex2html2763"
HREF="rute.html">rute</A>
<B> Previous:</B> <A NAME="tex2html2757"
HREF="node42.html">39. smbd </A>
  <B> <A NAME="tex2html2765"
HREF="node1.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL>
<LI><A NAME="tex2html2768"
HREF="#SECTION004310000000000000000">40.1 Documentation</A>
<LI><A NAME="tex2html2769"
HREF="#SECTION004320000000000000000">40.2 Configuring <TT>
<FONT COLOR="#0000ff">bind</FONT></TT></A>
<UL>
<LI><A NAME="tex2html2770"
HREF="#SECTION004321000000000000000">40.2.1 Example configuration</A>
<UL>
<LI><A NAME="tex2html2771"
HREF="#SECTION004321100000000000000"><IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Local client configuration:</I> <TT>
<FONT COLOR="#0000ff">/etc/resolv.conf</FONT></TT></A>
<LI><A NAME="tex2html2772"
HREF="#SECTION004321200000000000000"><IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Top-level config file:</I> <TT>
<FONT COLOR="#0000ff">/etc/named.conf</FONT></TT></A>
<LI><A NAME="tex2html2773"
HREF="#SECTION004321300000000000000"><IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Root name server list:</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.ca</FONT></TT></A>
<LI><A NAME="tex2html2774"
HREF="#SECTION004321400000000000000"><IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Local forward lookups:</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.localdomain</FONT></TT></A>
<LI><A NAME="tex2html2775"
HREF="#SECTION004321500000000000000"><IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Local reverse lookups:</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.127.0.0.1</FONT></TT></A>
<LI><A NAME="tex2html2776"
HREF="#SECTION004321600000000000000"><IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Authoritative domain file:</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.cranzgot.co.za</FONT></TT></A>
<LI><A NAME="tex2html2777"
HREF="#SECTION004321700000000000000"><IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>LAN reverse lookups:</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.192.168.2</FONT></TT></A>
<LI><A NAME="tex2html2778"
HREF="#SECTION004321800000000000000"><IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Authoritative reverse lookups (1):</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.196.28.144</FONT></TT></A>
<LI><A NAME="tex2html2779"
HREF="#SECTION004321900000000000000"><IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Authoritative reverse lookups (2):</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.160.123.181.44</FONT></TT></A>
</UL>
<LI><A NAME="tex2html2780"
HREF="#SECTION004322000000000000000">40.2.2 Starting the name server</A>
<LI><A NAME="tex2html2781"
HREF="#SECTION004323000000000000000">40.2.3 Configuration in detail</A>
<UL>
<LI><A NAME="tex2html2782"
HREF="#SECTION004323100000000000000">40.2.3.1 Top-level <TT>
<FONT COLOR="#0000ff">named.conf</FONT></TT></A>
<LI><A NAME="tex2html2783"
HREF="#SECTION004323200000000000000">40.2.3.2 Domain <TT>
<FONT COLOR="#0000ff">SOA</FONT></TT> records</A>
<LI><A NAME="tex2html2784"
HREF="#SECTION004323300000000000000">40.2.3.3 Dotted and non-dotted host names</A>
<LI><A NAME="tex2html2785"
HREF="#SECTION004323400000000000000">40.2.3.4 Empty host names</A>
<LI><A NAME="tex2html2786"
HREF="#SECTION004323500000000000000">40.2.3.5 <TT>
<FONT COLOR="#0000ff">NS</FONT></TT>, <TT>
<FONT COLOR="#0000ff">MX</FONT></TT>, <TT>
<FONT COLOR="#0000ff">PTR</FONT></TT>, <TT>
<FONT COLOR="#0000ff">A</FONT></TT>, and <TT>
<FONT COLOR="#0000ff">CNAME</FONT></TT> records</A>
<LI><A NAME="tex2html2787"
HREF="#SECTION004323600000000000000">40.2.3.6 Reverse lookups configuration</A>
</UL>
</UL>
<LI><A NAME="tex2html2788"
HREF="#SECTION004330000000000000000">40.3 Round-Robin Load-Sharing</A>
<LI><A NAME="tex2html2789"
HREF="#SECTION004340000000000000000">40.4 Configuring <TT>
<FONT COLOR="#0000ff">named</FONT></TT> for Dialup Use</A>
<UL>
<LI><A NAME="tex2html2790"
HREF="#SECTION004341000000000000000">40.4.1 Example caching name server</A>
<LI><A NAME="tex2html2791"
HREF="#SECTION004342000000000000000">40.4.2 Dynamic IP addresses</A>
</UL>
<LI><A NAME="tex2html2792"
HREF="#SECTION004350000000000000000">40.5 Secondary or Slave DNS Servers</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION004300000000000000000">
40. <TT>
<FONT COLOR="#0000ff">named</FONT></TT> -- Domain Name Server</A>
</H1>
<P>
<A NAME="chap:name"></A>
<P>
In Chapter <A HREF="node30.html#chap:dns">27</A> we dealt with the ``client'' side of DNS.
In this chapter we configure the name server that services such requests.
<P>
There seems to be a lot of hype that elevates the name server to
something mystical and illusive. In fact, setting up a name server
is a standard and trivial exercise. A name server daemon is also no
heavyweight service: The <TT>
<FONT COLOR="#0000ff">named</FONT></TT> executable is 500 KB and
consumes little CPU.
<P>
The package that the name server comes in is called
<TT>
<FONT COLOR="#0000ff">bind</FONT></TT>. This chapter assumes a <TT>
<FONT COLOR="#0000ff">bind</FONT></TT> of
approximately <TT>
<FONT COLOR="#0000ff">bind-8.2</FONT></TT> or later. <TT>
<FONT COLOR="#0000ff">bind</FONT></TT>
stands for <I>Berkeley Internet Name Domain</I>.
<P>
The difficulty with setting up a name server is that the
configuration files are impossible to construct from the
specification without some kind of typing error being made.
The solution is quite simple: <I>Never</I> create a
name server config file from scratch. <I>Always</I> copy
one from an existing working name server. Here we
give more example configuration files than explanation.
You can copy these examples to create your own name server.
<P>
Please note before running <TT>
<FONT COLOR="#0000ff">bind</FONT></TT> that it has security
vulnerabilities. Hence, it may be possible for someone to hack your
machine if you are running an old version. Many people are also skeptical
about even the latest versions of <TT>
<FONT COLOR="#0000ff">bind</FONT></TT> (9.1 at the time of
writing) even though no security holes had been announced for this version.
An alternative is <TT>
<FONT COLOR="#0000ff">djbdns</FONT></TT>, which
is purported to be the ultimate DNS server.
<P>
Before you even start working on name server configuration,
you should start a new terminal window with the
command (Debian alternative in parentheses):
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>tail -f /var/log/messages</code><br>
<code>( tail -f /var/log/syslog )</code><br>
</FONT></TD></TR></TABLE><P>
Keep this window throughout the entire setup and testing
procedure. From now on, when I refer to <I>message</I>s,
I am referring to a message in this window.
<P>
<H1><A NAME="SECTION004310000000000000000">
40.1 Documentation</A>
</H1>
<P>
The man pages for <TT>
<FONT COLOR="#0000ff">named</FONT></TT>
are <TT>
<FONT COLOR="#0000ff">hostname</FONT></TT>(7),
<TT>
<FONT COLOR="#0000ff">named-xfer</FONT></TT>(8),
<TT>
<FONT COLOR="#0000ff">named</FONT></TT>(8), and <TT>
<FONT COLOR="#0000ff">ndc</FONT></TT>(8). These
pages reference a document called the
``Name Server Operations Guide for BIND.'' What they actually mean is the
PostScript file <TT>
<FONT COLOR="#0000ff">/usr/[share/]doc/bind-<version>/bog/file.psf</FONT></TT>
(or <TT>
<FONT COLOR="#0000ff">/usr/share/doc/bind/bog.ps</FONT></TT>).
<P>
The problem with some of this documentation is that it is still
based on the old (now deprecated) <TT>
<FONT COLOR="#0000ff">named.boot</FONT></TT>
configuration file. There is a script
<TT>
<FONT COLOR="#0000ff">/usr/doc/bind-<version>/named-bootconf/named-bootconf</FONT></TT>
(or <TT>
<FONT COLOR="#0000ff">/usr/sbin/named-bootconf</FONT></TT>) that reads a <TT>
<FONT COLOR="#0000ff">named.boot</FONT></TT>
file from stdin and writes a <TT>
<FONT COLOR="#0000ff">named.conf</FONT></TT> file to stdout.
I found it useful to <TT>
<FONT COLOR="#0000ff">echo "old config line" |
named-bootconf</FONT></TT> to see what a new style equivalent would be.
<P>
The directory <TT>
<FONT COLOR="#0000ff">/usr/[share/]doc/bind[-<version>]/html/</FONT></TT><A NAME="page:binddocu"></A>contains the most important general information. It is
a complete reference to <TT>
<FONT COLOR="#0000ff">bind</FONT></TT> configuration.
Parallel directories also contain FAQ documents
and various theses on security. A file <TT>
<FONT COLOR="#0000ff">style.txt</FONT></TT>
contains the recommended layout of the configuration files
for consistent spacing and readability. Finally an <TT>
<FONT COLOR="#0000ff">rfc/</FONT></TT>
directory contains the relevant RFCs (see Section <A HREF="node16.html#sec:rfc">13.6</A>).
<P>
<H1><A NAME="SECTION004320000000000000000">
40.2 Configuring <TT>
<FONT COLOR="#0000ff">bind</FONT></TT></A>
</H1>
<P>
There is only one main configuration file for <TT>
<FONT COLOR="#0000ff">named</FONT></TT>:
<TT>
<FONT COLOR="#0000ff">/etc/named.conf</FONT></TT> (or <TT>
<FONT COLOR="#0000ff">/etc/bind/named.conf</FONT></TT> on Debian--here
we assume a <TT>
<FONT COLOR="#0000ff">/etc/named.conf</FONT></TT> file for simplicity).
The <TT>
<FONT COLOR="#0000ff">named</FONT></TT> service once used a file
<TT>
<FONT COLOR="#0000ff">/etc/named.boot</FONT></TT>, but this has been scrapped. If there
is a <TT>
<FONT COLOR="#0000ff">named.boot</FONT></TT> file in your <TT>
<FONT COLOR="#0000ff">/etc</FONT></TT> directory, then it
is not being used, except possibly by a very old version of
<TT>
<FONT COLOR="#0000ff">bind</FONT></TT>.
<P>
Here we will show example configurations necessary for typical
scenarios of a name server.
<P>
<H2><A NAME="SECTION004321000000000000000">
40.2.1 Example configuration</A>
</H2>
<P>
The <TT>
<FONT COLOR="#0000ff">named.conf</FONT></TT> file will have in it the line <TT>
<FONT COLOR="#0000ff">directory
"/var/named";</FONT></TT> (or <TT>
<FONT COLOR="#0000ff">directory "/etc/named";</FONT></TT> or <TT>
<FONT COLOR="#0000ff">directory "/var/cache/bind";</FONT></TT>).
This directory holds various files containing textual lists of the name to IP address
mappings that <TT>
<FONT COLOR="#0000ff">bind</FONT></TT> will serve.
The following example is a name server for a company that has been
given a range of IP addresses <TT>
<FONT COLOR="#0000ff">196.28.144.16/29</FONT></TT> (i.e., <TT>
<FONT COLOR="#0000ff">196.28.144.16</FONT></TT>-<TT>
<FONT COLOR="#0000ff">23</FONT></TT>),
as well as one single IP address (<TT>
<FONT COLOR="#0000ff">160.123.181.44</FONT></TT>). This
example also must support a range of internal IP addresses
(<TT>
<FONT COLOR="#0000ff">192.168.2.0</FONT></TT>-<TT>
<FONT COLOR="#0000ff">255</FONT></TT>) The trick is not to think about
how everything works. If you just copy and edit things in a
consistent fashion, carefully reading the comments, <TT>
<FONT COLOR="#0000ff">bind</FONT></TT> will
work fine. I will now list all necessary files.
<P>
<H3><A NAME="SECTION004321100000000000000">
<IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Local client configuration:</I> <TT>
<FONT COLOR="#0000ff">/etc/resolv.conf</FONT></TT></A>
</H3>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>domain localdomain</code><br>
<code>nameserver 127.0.0.1</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H3><A NAME="SECTION004321200000000000000">
<IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Top-level config file:</I> <TT>
<FONT COLOR="#0000ff">/etc/named.conf</FONT></TT></A>
</H3>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>15</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>20</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>25</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>30</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>35</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>40</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>45</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>50</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>55</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>/*</code><br>
<code> * The ``directory'' line tells named that any further file name's</code><br>
<code> * given are under the /var/named/ directory.</code><br>
<code> */</code><br>
<code>options {</code><br>
<code> directory "/var/named";</code><br>
<code> /*</code><br>
<code> * If there is a firewall between you and nameservers you want</code><br>
<code> * to talk to, you might need to uncomment the query-source</code><br>
<code> * directive below. Previous versions of BIND always asked</code><br>
<code> * questions using port 53, but BIND 8.1 uses an unprivileged</code><br>
<code> * port by default.</code><br>
<code> */</code><br>
<code> // query-source address * port 53;</code><br>
<code>};</code><br>
<code> </code><br>
<code>/* The list of root servers: */</code><br>
<code>zone "." {</code><br>
<code> type hint;</code><br>
<code> file "named.ca";</code><br>
<code>};</code><br>
<code> </code><br>
<code>/* Forward lookups of the localhost: */</code><br>
<code>zone "localdomain" {</code><br>
<code> type master;</code><br>
<code> file "named.localdomain";</code><br>
<code>};</code><br>
<code> </code><br>
<code>/* Reverse lookups of the localhost: */</code><br>
<code>zone "1.0.0.127.in-addr.arpa" {</code><br>
<code> type master;</code><br>
<code> file "named.127.0.0.1";</code><br>
<code>};</code><br>
<code> </code><br>
<code>/* Forward lookups of hosts in my domain: */</code><br>
<code>zone "cranzgot.co.za" {</code><br>
<code> type master;</code><br>
<code> file "named.cranzgot.co.za";</code><br>
<code>};</code><br>
<code> </code><br>
<code>/* Reverse lookups of local IP numbers: */</code><br>
<code>zone "2.168.192.in-addr.arpa" {</code><br>
<code> type master;</code><br>
<code> file "named.192.168.2";</code><br>
<code>};</code><br>
<code> </code><br>
<code>/* Reverse lookups of 196.28.144.* Internet IP numbers: */</code><br>
<code>zone "144.28.196.in-addr.arpa" {</code><br>
<code> type master;</code><br>
<code> file "named.196.28.144";</code><br>
<code>};</code><br>
<code> </code><br>
<code>/* Reverse lookup of 160.123.181.44 only: */</code><br>
<code>zone "44.181.123.160.in-addr.arpa" {</code><br>
<code> type master;</code><br>
<code> file "named.160.123.181.44";</code><br>
<code>};</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H3><A NAME="SECTION004321300000000000000">
<IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Root name server list:</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.ca</FONT></TT></A>
</H3>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>15</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>20</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>25</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>; Get the original of this file from ftp://ftp.rs.internic.net/domain/named.root</code><br>
<code>;</code><br>
<code>; formerly ns.internic.net</code><br>
<code>. 3600000 IN NS a.root-servers.net.</code><br>
<code>a.root-servers.net. 3600000 A 198.41.0.4</code><br>
<code>. 3600000 NS b.root-servers.net.</code><br>
<code>b.root-servers.net. 3600000 A 128.9.0.107</code><br>
<code>. 3600000 NS c.root-servers.net.</code><br>
<code>c.root-servers.net. 3600000 A 192.33.4.12</code><br>
<code>. 3600000 NS d.root-servers.net.</code><br>
<code>d.root-servers.net. 3600000 A 128.8.10.90</code><br>
<code>. 3600000 NS e.root-servers.net.</code><br>
<code>e.root-servers.net. 3600000 A 192.203.230.10</code><br>
<code>. 3600000 NS f.root-servers.net.</code><br>
<code>f.root-servers.net. 3600000 A 192.5.5.241</code><br>
<code>. 3600000 NS g.root-servers.net.</code><br>
<code>g.root-servers.net. 3600000 A 192.112.36.4</code><br>
<code>. 3600000 NS h.root-servers.net.</code><br>
<code>h.root-servers.net. 3600000 A 128.63.2.53</code><br>
<code>. 3600000 NS i.root-servers.net.</code><br>
<code>i.root-servers.net. 3600000 A 192.36.148.17</code><br>
<code>. 3600000 NS j.root-servers.net.</code><br>
<code>j.root-servers.net. 3600000 A 198.41.0.10</code><br>
<code>. 3600000 NS k.root-servers.net.</code><br>
<code>k.root-servers.net. 3600000 A 193.0.14.129 </code><br>
<code>. 3600000 NS l.root-servers.net.</code><br>
<code>l.root-servers.net. 3600000 A 198.32.64.12</code><br>
<code>. 3600000 NS m.root-servers.net.</code><br>
<code>m.root-servers.net. 3600000 A 202.12.27.33</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H3><A NAME="SECTION004321400000000000000">
<IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Local forward lookups:</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.localdomain</FONT></TT></A>
</H3>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>10</code></font><code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>$TTL 259200</code><br>
<code>@ IN SOA localhost.localdomain. dns-admin.localhost.localdomain. (</code><br>
<code> 2000012101 ; Serial number</code><br>
<code> 10800 ; Refresh every 3 hours</code><br>
<code> 3600 ; Retry every hour</code><br>
<code> 3600000 ; Expire after 42 days</code><br>
<code> 259200 ) ; Minimum Time to Live (TTL) of 3 days</code><br>
<code> </code><br>
<code> IN NS localhost.localdomain.</code><br>
<code> </code><br>
<code>localhost IN A 127.0.0.1</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H3><A NAME="SECTION004321500000000000000">
<IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Local reverse lookups:</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.127.0.0.1</FONT></TT></A>
</H3>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>10</code></font><code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>$TTL 259200</code><br>
<code>@ IN SOA localhost. dns-admin.localhost. (</code><br>
<code> 2000012101 ; Serial number</code><br>
<code> 10800 ; Refresh every 3 hours</code><br>
<code> 3600 ; Retry every hour</code><br>
<code> 3600000 ; Expire after 42 days</code><br>
<code> 259200 ) ; Minimum Time to Live (TTL) of 3 days</code><br>
<code> </code><br>
<code> IN NS localhost.</code><br>
<code> </code><br>
<code> IN PTR localhost.</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H3><A NAME="SECTION004321600000000000000">
<IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Authoritative domain file:</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.cranzgot.co.za</FONT></TT></A>
</H3>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>15</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>20</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>25</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>30</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>35</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>40</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>45</code></font><code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>$TTL 259200</code><br>
<code>@ IN SOA ns1.cranzgot.co.za. dns-admin.ns1.cranzgot.co.za. (</code><br>
<code> 2000012101 ; Serial number</code><br>
<code> 10800 ; Refresh every 3 hours</code><br>
<code> 3600 ; Retry every hour</code><br>
<code> 3600000 ; Expire after 42 days</code><br>
<code> 259200 ) ; Minimum Time to Live (TTL) of 3 days</code><br>
<code> </code><br>
<code> IN NS ns1.cranzgot.co.za.</code><br>
<code> IN NS ns2.cranzgot.co.za.</code><br>
<code> </code><br>
<code> IN A 160.123.181.44</code><br>
<code> IN MX 10 mail1.cranzgot.co.za.</code><br>
<code> IN MX 20 mail2.cranzgot.co.za.</code><br>
<code> </code><br>
<code>; We will use the first IP address for the name server itself:</code><br>
<code>ns1 IN A 196.28.144.16</code><br>
<code> </code><br>
<code>; our backup name server is faaar away:</code><br>
<code>ns2 IN A 146.143.21.88</code><br>
<code> </code><br>
<code>; FTP server:</code><br>
<code>ftp IN A 196.28.144.17</code><br>
<code> </code><br>
<code>; Aliases:</code><br>
<code>www IN CNAME cranzgot.co.za.</code><br>
<code>mail1 IN CNAME ns1.cranzgot.co.za.</code><br>
<code>mail2 IN CNAME ns2.cranzgot.co.za.</code><br>
<code>gopher IN CNAME ftp.cranzgot.co.za.</code><br>
<code>pop IN CNAME mail1.cranzgot.co.za.</code><br>
<code>proxy IN CNAME ftp.cranzgot.co.za.</code><br>
<code> </code><br>
<code>; Reserved for future web servers:</code><br>
<code>unused18 IN A 196.28.144.18</code><br>
<code>unused19 IN A 196.28.144.19</code><br>
<code>unused20 IN A 196.28.144.20</code><br>
<code>unused21 IN A 196.28.144.21</code><br>
<code>unused22 IN A 196.28.144.22</code><br>
<code>unused23 IN A 196.28.144.23</code><br>
<code> </code><br>
<code>; local LAN:</code><br>
<code>pc1 IN A 192.168.2.1</code><br>
<code>pc2 IN A 192.168.2.2</code><br>
<code>pc3 IN A 192.168.2.3</code><br>
<code>pc4 IN A 192.168.2.4</code><br>
<code>; and so on... to 192.168.2.255</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H3><A NAME="SECTION004321700000000000000">
<IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>LAN reverse lookups:</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.192.168.2</FONT></TT></A>
</H3>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>15</code></font><code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>$TTL 259200</code><br>
<code>@ IN SOA ns1.cranzgot.co.za. dns-admin.ns1.cranzgot.co.za. (</code><br>
<code> 2000012101 ; Serial number</code><br>
<code> 10800 ; Refresh every 3 hours</code><br>
<code> 3600 ; Retry every hour</code><br>
<code> 3600000 ; Expire after 42 days</code><br>
<code> 259200 ) ; Minimum Time to Live (TTL) of 3 days</code><br>
<code> </code><br>
<code> IN NS ns1.cranzgot.co.za.</code><br>
<code> </code><br>
<code>1 IN PTR pc1.cranzgot.co.za.</code><br>
<code>2 IN PTR pc2.cranzgot.co.za.</code><br>
<code>3 IN PTR pc3.cranzgot.co.za.</code><br>
<code>4 IN PTR pc4.cranzgot.co.za.</code><br>
<code>; and so on... to 255</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H3><A NAME="SECTION004321800000000000000">
<IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Authoritative reverse lookups (1):</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.196.28.144</FONT></TT></A>
</H3>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>15</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>20</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>25</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>30</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>35</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>40</code></font><code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>$TTL 259200</code><br>
<code>@ IN SOA ns1.cranzgot.co.za. dns-admin.ns1.cranzgot.co.za. (</code><br>
<code> 2000012101 ; Serial number</code><br>
<code> 10800 ; Refresh every 3 hours</code><br>
<code> 3600 ; Retry every hour</code><br>
<code> 3600000 ; Expire after 42 days</code><br>
<code> 259200 ) ; Minimum Time to Live (TTL) of 3 days</code><br>
<code> </code><br>
<code> IN NS dns.big-isp.net.</code><br>
<code> </code><br>
<code>0 IN NS dns.big-isp.net.</code><br>
<code>1 IN NS dns.big-isp.net.</code><br>
<code>2 IN NS dns.big-isp.net.</code><br>
<code>3 IN NS dns.big-isp.net.</code><br>
<code>4 IN NS dns.big-isp.net.</code><br>
<code>5 IN NS dns.big-isp.net.</code><br>
<code>6 IN NS dns.big-isp.net.</code><br>
<code>7 IN NS dns.big-isp.net.</code><br>
<code>8 IN NS dns.big-isp.net.</code><br>
<code>9 IN NS dns.big-isp.net.</code><br>
<code>10 IN NS dns.big-isp.net.</code><br>
<code>11 IN NS dns.big-isp.net.</code><br>
<code>12 IN NS dns.big-isp.net.</code><br>
<code>13 IN NS dns.big-isp.net.</code><br>
<code>14 IN NS dns.big-isp.net.</code><br>
<code>15 IN NS dns.big-isp.net.</code><br>
<code> </code><br>
<code>16 IN PTR ns1.cranzgot.co.za.</code><br>
<code>17 IN PTR ftp.cranzgot.co.za.</code><br>
<code>18 IN PTR unused18.cranzgot.co.za.</code><br>
<code>19 IN PTR unused19.cranzgot.co.za.</code><br>
<code>20 IN PTR unused20.cranzgot.co.za.</code><br>
<code>21 IN PTR unused21.cranzgot.co.za.</code><br>
<code>22 IN PTR unused22.cranzgot.co.za.</code><br>
<code>23 IN PTR unused23.cranzgot.co.za.</code><br>
<code> </code><br>
<code>24 IN NS dns.big-isp.net.</code><br>
<code>25 IN NS dns.big-isp.net.</code><br>
<code>26 IN NS dns.big-isp.net.</code><br>
<code>; and so on... up to 255</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H3><A NAME="SECTION004321900000000000000">
<IMG ALIGN=ABSMIDDLE BORDER=0 SRC="bullet.png"> <I>Authoritative reverse lookups (2):</I> <TT>
<FONT COLOR="#0000ff">/var/named/named.160.123.181.44</FONT></TT></A>
</H3>
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>$TTL 259200</code><br>
<code>@ IN SOA ns1.cranzgot.co.za. dns-admin.ns1.cranzgot.co.za. (</code><br>
<code> 2000012101 ; Serial number</code><br>
<code> 10800 ; Refresh every 3 hours</code><br>
<code> 3600 ; Retry every hour</code><br>
<code> 3600000 ; Expire after 42 days</code><br>
<code> 259200 ) ; Minimum Time to Live (TTL) of 3 days</code><br>
<code> </code><br>
<code> IN NS ns1.cranzgot.co.za.</code><br>
<code> IN NS ns2.cranzgot.co.za.</code><br>
<code> </code><br>
<code> IN PTR cranzgot.co.za.</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H2><A NAME="SECTION004322000000000000000">
40.2.2 Starting the name server</A>
</H2>
<P>
If you have created a configuration similar to that above, you
can then run the <TT>
<FONT COLOR="#0000ff">bind</FONT></TT> package initialization commands.
The actions available are (alternative commands in parentheses):
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>/etc/rc.d/init.d/named start</code><br>
<code>( /etc/init.d/named start )</code><br>
<code>( /etc/init.d/bind start )</code><br>
<code>/etc/rc.d/init.d/named stop</code><br>
<code>/etc/rc.d/init.d/named restart</code><br>
<code>/etc/rc.d/init.d/named status</code><br>
</FONT></TD></TR></TABLE><P>
<P>
You should get messages like:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>15</code></font><code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>Jul 8 15:45:23 ns1 named[17656]: starting. named 8.2.2-P5 Sat Aug 5 13:21:24 EDT 2000 ^I</code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: hint zone "" (IN) loaded (serial 0)</code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: master zone "localhost" (IN) loaded (serial 2000012101)</code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: master zone "1.0.0.127.in-addr.arpa" (IN) loaded (serial </code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: master zone "cranzgot.co.za" (IN) loaded (serial 20000121</code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: master zone "myisp.co.za" (IN) loaded (serial 2000012101)</code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: master zone "2.168.192.in-addr.arpa" (IN) loaded (serial </code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: master zone "144.28.196.in-addr.arpa" (IN) loaded (serial</code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: master zone "44.181.123.160.in-addr.arpa" (IN) loaded (se</code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: listening on [127.0.0.1].53 (lo)</code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: listening on [196.28.144.16].53 (eth0)</code><br>
<code>Jul 8 15:45:23 ns1 named[17656]: Forwarding source address is [0.0.0.0].1041</code><br>
<code>Jul 8 15:45:23 ns1 named: named startup succeeded</code><br>
<code>Jul 8 15:45:23 ns1 named[17657]: group = 25</code><br>
<code>Jul 8 15:45:23 ns1 named[17657]: user = named</code><br>
<code>Jul 8 15:45:23 ns1 named[17657]: Ready to answer queries.</code><br>
</FONT></TD></TR></TABLE><P>
<P>
If you have made typing errors, or named files incorrectly,
you will get appropriate error messages. <I>Novice
administrators are wont to edit <TT>
<FONT COLOR="#0000ff">named</FONT></TT> configuration files
and restart <TT>
<FONT COLOR="#0000ff">named</FONT></TT> without checking
<TT>
<FONT COLOR="#0000ff">/var/log/messages</FONT></TT> (or <TT>
<FONT COLOR="#0000ff">/var/log/syslog</FONT></TT>)
for errors. <I>NEVER</I> do this</I>.
<P>
<H2><A NAME="SECTION004323000000000000000">
40.2.3 Configuration in detail</A>
</H2>
<P>
If there are no apparent errors in your config files,
you can now more closely examine the contents of the files.
<P>
<H3><A NAME="SECTION004323100000000000000">
40.2.3.1 Top-level <TT>
<FONT COLOR="#0000ff">named.conf</FONT></TT></A>
</H3>
<P>
The top-level configuration file <TT>
<FONT COLOR="#0000ff">/etc/named.conf</FONT></TT>
has an obvious <B>C</B> style format. Comments are designated
by <TT>
<FONT COLOR="#0000ff">/* */</FONT></TT> or <TT>
<FONT COLOR="#0000ff">//</FONT></TT>.
<P>
The <TT>
<FONT COLOR="#0000ff">options</FONT></TT> section in our case specifies only one
parameter: the directory for locating any files. The file
<TT>
<FONT COLOR="#0000ff">options.html</FONT></TT> under the <TT>
<FONT COLOR="#0000ff">bind</FONT></TT> documentation directories
has a complete list of options. Some of these are esoteric,
but a few have common uses.
<P>
The lines <TT>
<FONT COLOR="#0000ff">zone "." {</FONT></TT>...<TT>
<FONT COLOR="#0000ff"> </FONT></TT>
will be present in all name server configurations. They tell
<TT>
<FONT COLOR="#0000ff">named</FONT></TT> that the whole Internet is governed by the
file <TT>
<FONT COLOR="#0000ff">named.ca</FONT></TT>. <TT>
<FONT COLOR="#0000ff">named.ca</FONT></TT> in turn contains the
list of root name servers.
<P>
The lines <TT>
<FONT COLOR="#0000ff">zone "localdomain" {</FONT></TT>...<TT>
<FONT COLOR="#0000ff"> </FONT></TT> are common.
They specify that forward lookups for <I>host</I><TT>
<FONT COLOR="#0000ff">.localdomain</FONT></TT>
are contained in the file <TT>
<FONT COLOR="#0000ff">/var/named/named.localdomain</FONT></TT>.
This file gives a correct result for any lookup for <TT>
<FONT COLOR="#0000ff">localhost</FONT></TT>.
Many applications query the name server for this name and
a fastidious configuration ought to return it correctly.
Note that such a lookup works together with <TT>
<FONT COLOR="#0000ff">resolv.conf</FONT></TT>--it
has a line <TT>
<FONT COLOR="#0000ff">search localdomain</FONT></TT> so that a query for
<TT>
<FONT COLOR="#0000ff">localhost</FONT></TT> gives the same result as a query for
<TT>
<FONT COLOR="#0000ff">localhost.localdomain</FONT></TT>.
<P>
The lines <TT>
<FONT COLOR="#0000ff">zone "1.0.0.127.in-addr.arpa" {</FONT></TT>...<TT>
<FONT COLOR="#0000ff"> </FONT></TT>
resolve reverse lookups for the IP address <TT>
<FONT COLOR="#0000ff">127.0.0.1</FONT></TT> (stored
in the file <TT>
<FONT COLOR="#0000ff">named.127.0.0.1</FONT></TT>). Note that <TT>
<FONT COLOR="#0000ff">1.0.0.127</FONT></TT> is
<TT>
<FONT COLOR="#0000ff">127.0.0.1</FONT></TT> written backwards. In fact, reverse lookups
are just forward lookups under the domain <TT>
<FONT COLOR="#0000ff">.in-addr.arpa</FONT></TT>.
Many applications reverse lookup any received connection to check
its authenticity, even from <TT>
<FONT COLOR="#0000ff">localhost</FONT></TT>, so you may want
to have these lines present to prevent such applications failing
or blocking.
<P>
The rest of the file is the configuration specific to our domain.
<P>
The lines <TT>
<FONT COLOR="#0000ff">zone "cranzgot.co.za" {</FONT></TT>...<TT>
<FONT COLOR="#0000ff"> </FONT></TT> say that information for
forward lookups is located in the file
<TT>
<FONT COLOR="#0000ff">named.cranzgot.co.za</FONT></TT>.
<P>
The lines <TT>
<FONT COLOR="#0000ff">zone "1.168.192.in-addr.arpa" {</FONT></TT>...<TT>
<FONT COLOR="#0000ff"> </FONT></TT> say that
information for reverse lookups on the IP address range
<TT>
<FONT COLOR="#0000ff">192.168.1.0</FONT></TT>-<TT>
<FONT COLOR="#0000ff">255</FONT></TT> is located in the file
<TT>
<FONT COLOR="#0000ff">named.192.168.1</FONT></TT>.
<P>
The lines <TT>
<FONT COLOR="#0000ff">zone "44.182.124.160.in-addr.arpa" {</FONT></TT>...<TT>
<FONT COLOR="#0000ff"> </FONT></TT> says that
information for reverse lookups on the IP address
<TT>
<FONT COLOR="#0000ff">160.124.182.44</FONT></TT> is located in the file
<TT>
<FONT COLOR="#0000ff">named.160.124.182.44</FONT></TT>.
<P>
<H3><A NAME="SECTION004323200000000000000">
40.2.3.2 Domain <TT>
<FONT COLOR="#0000ff">SOA</FONT></TT> records</A>
</H3>
<P>
Each of the other <TT>
<FONT COLOR="#0000ff">named.</FONT></TT> files has a similar format. They begin with
<TT>
<FONT COLOR="#0000ff">$TTL</FONT></TT> line and then an <TT>
<FONT COLOR="#0000ff">@ IN SOA</FONT></TT>. <TT>
<FONT COLOR="#0000ff">TTL</FONT></TT> stands for
<I>Time To Live</I>, the default expiration time for all subsequent entries.
This line not only prevents a <TT>
<FONT COLOR="#0000ff">No default TTL set</FONT></TT>... warning message,
but really tells the rest of the Internet how long to cache an entry. If
you plan on moving your site soon or often, set this to a smaller
value.
<TT>
<FONT COLOR="#0000ff">SOA</FONT></TT> stands for <I>Start of Authority</I>. The host name on the second
line specifies the authority for that domain, and the adjacent
<TT>
<FONT COLOR="#0000ff"><user>.<hostname></FONT></TT> specifies the email<A NAME="page:dnsemail"></A> address
of the responsible person.
<P>
The next few lines contain timeout specifications for cached
data and data propagation across the net. These are reasonable
defaults, but if you would like to tune these values, consult
the relevant documentation listed on page <A HREF="node43.html#page:binddocu"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]" SRC="crossref.png"></A>.
The values are all in seconds.
<P>
The <I>serial number</I> for the file (i.e., <TT>
<FONT COLOR="#0000ff">2000012101</FONT></TT>) is
used to tell when a change has been made and hence that new
data should be propagated to other servers. When updating the
file in any way, you must increment this serial number.
The format is conventionally <I>YYYYMMDDxx</I>--exactly ten digits.
<I>xx</I> begins with, say, <TT>
<FONT COLOR="#0000ff">01</FONT></TT> and is incremented with each change
made during a day.
<P>
<I>It is absolutely essential that the serial number be
updated whenever a file is edited. If not, the changes will not be
reflected through the rest of the Internet.</I>
<P>
<H3><A NAME="SECTION004323300000000000000">
40.2.3.3 Dotted and non-dotted host names</A>
</H3>
<P>
If a host name ends in a <TT>
<FONT COLOR="#0000ff">.</FONT></TT> then the dot signifies
a fully qualified host name. If it does not end in a <TT>
<FONT COLOR="#0000ff">.</FONT></TT>
then the absence of a dot signifies that the domain should be
appended to the host name. This feature is purely to make files
more elegant.
<P>
For instance, the line
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>ftp IN A 196.28.144.17</code><br>
</FONT></TD></TR></TABLE><P>
could just as well be written
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>ftp.cranzgot.co.za. IN A 196.28.144.17</code><br>
</FONT></TD></TR></TABLE><P>
<I>Always be careful to properly end qualified host names with a dot,
since failing to do so causes <TT>
<FONT COLOR="#0000ff">named</FONT></TT> to append a further
domain.</I>
<P>
<H3><A NAME="SECTION004323400000000000000">
40.2.3.4 Empty host names</A>
</H3>
<P>
If a host name is omitted from the start of the line, then the
domain is substituted. The purpose of this notation is also for
elegance. For example,
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code> IN NS ns1.cranzgot.co.za.</code><br>
</FONT></TD></TR></TABLE><P>
is the same as
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>cranzgot.co.za. IN NS ns1.cranzgot.co.za.</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H3><A NAME="SECTION004323500000000000000">
40.2.3.5 <TT>
<FONT COLOR="#0000ff">NS</FONT></TT>, <TT>
<FONT COLOR="#0000ff">MX</FONT></TT>, <TT>
<FONT COLOR="#0000ff">PTR</FONT></TT>, <TT>
<FONT COLOR="#0000ff">A</FONT></TT>, and <TT>
<FONT COLOR="#0000ff">CNAME</FONT></TT> records</A>
</H3>
<P>
Each DNS record appears on a single line, associating some
host name / domain or IP address with some other host name or IP
address.
Hence, it is easy to construct a file that makes the Internet
think anything you want it to about your organization.
<P>
The most basic types of record are the <TT>
<FONT COLOR="#0000ff">A</FONT></TT> and <TT>
<FONT COLOR="#0000ff">PTR</FONT></TT>
records. They simply associate a host name with an IP number,
or an IP number with a host name, respectively. You should not
have more than one host associated to a particular IP number.
<P>
The <TT>
<FONT COLOR="#0000ff">CNAME</FONT></TT> record says that a host is just an alias
to another host. So have
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>ns1 IN A 196.28.144.1</code><br>
<code>mail1 IN CNAME ns1.cranzgot.co.za.</code><br>
</FONT></TD></TR></TABLE><P>
rather than
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>ns1 IN A 196.28.144.1</code><br>
<code>mail1 IN A 196.28.144.1</code><br>
</FONT></TD></TR></TABLE><P>
<P>
Finally, <TT>
<FONT COLOR="#0000ff">NS</FONT></TT> and <TT>
<FONT COLOR="#0000ff">MX</FONT></TT> records
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code><domain> IN NS <nameserver></code><br>
<code><domain> IN MX <mailserver></code><br>
</FONT></TD></TR></TABLE><P>
just state that domain <TT>
<FONT COLOR="#0000ff"><domain></FONT></TT> has a name server or mail server
<TT>
<FONT COLOR="#0000ff"><nameserver></FONT></TT> or <TT>
<FONT COLOR="#0000ff"><mailserver></FONT></TT>, respectively. MTAs can now
locate your mail server as being responsible for email addresses of the
form <I>user</I><TT>
<FONT COLOR="#0000ff">@cranzgot.co.za</FONT></TT>.
<P>
<H3><A NAME="SECTION004323600000000000000">
40.2.3.6 Reverse lookups configuration</A>
</H3>
<P>
The file <TT>
<FONT COLOR="#0000ff">/var/named/named.196.28.144</FONT></TT> contains reverse
lookup data on all 255 IP addresses under <TT>
<FONT COLOR="#0000ff">196.28.144.</FONT></TT>.
It is, however, our ISP (called <TT>
<FONT COLOR="#0000ff">big-isp.net</FONT></TT>) that is responsible
for this address range, possibly having bought all 65536 addresses under
<TT>
<FONT COLOR="#0000ff">196.28.</FONT></TT>. The Internet is going to query <TT>
<FONT COLOR="#0000ff">big-isp.net</FONT></TT> when
trying to do a reverse lookup for <TT>
<FONT COLOR="#0000ff">196.28.144.</FONT></TT><I>?</I>.
The problem here is that there
are many companies comprising the <TT>
<FONT COLOR="#0000ff">196.28.144.</FONT></TT><I>?</I>
range, each with their own name server, so no single name server
can be authoritative for the whole domain <TT>
<FONT COLOR="#0000ff">144.28.196.in-addr.arpa</FONT></TT>.
This is the reason for lines in <TT>
<FONT COLOR="#0000ff">/var/named/named.196.28.144</FONT></TT> like
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>5 IN NS dns.big-isp.net.</code><br>
</FONT></TD></TR></TABLE><P>
IP address <TT>
<FONT COLOR="#0000ff">196.28.144.5</FONT></TT>
is not our responsibility, and hence we refer any such query to a more
authoritative name server. On the ISP side, the name server <TT>
<FONT COLOR="#0000ff">dns.big-isp.net</FONT></TT>
must have a file <TT>
<FONT COLOR="#0000ff">/var/named/named.196.28.144</FONT></TT> that contains something
like:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red size="-1">
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>15</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>20</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>25</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>30</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>35</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>40</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-2"><code>45</code></font><code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue size="-1">
<code>$TTL 259200</code><br>
<code>@ IN SOA dns.dns.big-isp.net. dns-admin.dns.big-isp.net. (</code><br>
<code> 2000012101 ; Serial number</code><br>
<code> 10800 ; Refresh every 3 hours</code><br>
<code> 3600 ; Retry every hour</code><br>
<code> 3600000 ; Expire after 42 days</code><br>
<code> 259200 ) ; Minimum Time to Live (TTL) of 3 days</code><br>
<code> </code><br>
<code> IN NS dns.big-isp.net.</code><br>
<code> </code><br>
<code>0 IN NS ns1.dali.co.za.</code><br>
<code>1 IN NS ns1.dali.co.za.</code><br>
<code>2 IN NS ns1.dali.co.za.</code><br>
<code>3 IN NS ns1.dali.co.za.</code><br>
<code>4 IN NS ns1.dali.co.za.</code><br>
<code>5 IN NS ns1.dali.co.za.</code><br>
<code>6 IN NS ns1.dali.co.za.</code><br>
<code>7 IN NS ns1.dali.co.za.</code><br>
<code> </code><br>
<code>8 IN NS ns1.picasso.co.za.</code><br>
<code>9 IN NS ns1.picasso.co.za.</code><br>
<code>10 IN NS ns1.picasso.co.za.</code><br>
<code>11 IN NS ns1.picasso.co.za.</code><br>
<code>12 IN NS ns1.picasso.co.za.</code><br>
<code>13 IN NS ns1.picasso.co.za.</code><br>
<code>14 IN NS ns1.picasso.co.za.</code><br>
<code>15 IN NS ns1.picasso.co.za.</code><br>
<code> </code><br>
<code>16 IN NS ns1.cranzgot.co.za.</code><br>
<code>17 IN NS ns1.cranzgot.co.za.</code><br>
<code>18 IN NS ns1.cranzgot.co.za.</code><br>
<code>19 IN NS ns1.cranzgot.co.za.</code><br>
<code>20 IN NS ns1.cranzgot.co.za.</code><br>
<code>21 IN NS ns1.cranzgot.co.za.</code><br>
<code>22 IN NS ns1.cranzgot.co.za.</code><br>
<code>23 IN NS ns1.cranzgot.co.za.</code><br>
<code> </code><br>
<code>24 IN NS ns1.matisse.co.za.</code><br>
<code>25 IN NS ns1.matisse.co.za.</code><br>
<code>26 IN NS ns1.matisse.co.za.</code><br>
<code>27 IN NS ns1.matisse.co.za.</code><br>
<code>28 IN NS ns1.matisse.co.za.</code><br>
<code>29 IN NS ns1.matisse.co.za.</code><br>
<code>30 IN NS ns1.matisse.co.za.</code><br>
<code>31 IN NS ns1.matisse.co.za.</code><br>
<code>; and so on... up to 255</code><br>
</FONT></TD></TR></TABLE><P>
<P>
Here, Matisse, Dali, and Picasso are other companies that have
bought small IP address blocks from <TT>
<FONT COLOR="#0000ff">big-isp</FONT></TT>. Each of
these lines will redirect queries to the appropriate name server.
<P>
<H1><A NAME="SECTION004330000000000000000">
40.3 Round-Robin Load-Sharing</A>
</H1>
<P>
<A NAME="sec:roundrobdns"></A>
If you have more than one <TT>
<FONT COLOR="#0000ff">A</FONT></TT> record for a particular machine,
then <TT>
<FONT COLOR="#0000ff">named</FONT></TT> will return multiple IP addresses upon a lookup.
Load sharing between several web servers is now possible--the
record ordering is randomized with each new lookup and your
web browser will only choose the first listed IP address.
For instance, <TT>
<FONT COLOR="#0000ff">host cnn.com</FONT></TT> returns several IP addresses.
Their zone file configuration might look like
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>cnn.com. IN A 207.25.71.5</code><br>
<code>cnn.com. IN A 207.25.71.6</code><br>
<code><font color="navy"><B>.</B></font></code><br>
<code><font color="navy"><B>.</B></font></code><br>
<code><font color="navy"><B>.</B></font></code><br>
<code>cnn.com. IN A 207.25.71.29</code><br>
<code>cnn.com. IN A 207.25.71.30</code><br>
</FONT></TD></TR></TABLE><P>
<P>
<H1><A NAME="SECTION004340000000000000000">
40.4 Configuring <TT>
<FONT COLOR="#0000ff">named</FONT></TT> for Dialup Use</A>
</H1>
<P>
If you have a dialup connection, the name server should be
configured as what is called a <I>caching-only</I> name server.
Of course, there is no such thing as a caching-<I>only</I>
name server--the term just means that the <TT>
<FONT COLOR="#0000ff">name.</FONT></TT> files have
only a few essential records in them. The point of a caching
server is to prevent spurious DNS lookups that may eat modem
bandwidth or cause a dial-on-demand server to initiate a
dialout. It also prevents applications blocking, waiting for a
DNS lookup. (Typical examples are <TT>
<FONT COLOR="#0000ff">sendmail</FONT></TT>, which
blocks for a couple of minutes when a machine is turned on
without the network plugged in; and
<TT>
<FONT COLOR="#0000ff">netscape</FONT></TT> 4, which tries to look up the IP address of
<TT>
<FONT COLOR="#0000ff">news.<localdomain></FONT></TT>.)
<P>
<H2><A NAME="SECTION004341000000000000000">
40.4.1 Example caching name server</A>
</H2>
<P>
For a caching name server, the <TT>
<FONT COLOR="#0000ff">/etc/name.conf</FONT></TT> file
should look as follows. Replace
<TT>
<FONT COLOR="#0000ff"><nameserver></FONT></TT> with the IP address of the name server
your ISP has given you. Your local machine name is assumed to
be <TT>
<FONT COLOR="#0000ff">cericon.priv.ate</FONT></TT>. (The following listings are minus
superfluous comments and newlines for brevity):
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>options {</code><br>
<code> forwarders {</code><br>
<code> <nameserver>;</code><br>
<code> };</code><br>
<code> directory "/var/named";</code><br>
<code>};</code><br>
<code> </code><br>
<code>zone "." { type hint; file "named.ca"; };</code><br>
<code>zone "localdomain" { type master; file "named.localdomain"; };</code><br>
<code>zone "1.0.0.127.in-addr.arpa" { type master; file "named.127.0.0.1";};</code><br>
<code>zone "priv.ate" { type master; file "named.priv.ate"; };</code><br>
<code>zone "168.192.in-addr.arpa" { type master; file "named.192.168"; };</code><br>
</FONT></TD></TR></TABLE><P>
<P>
The <TT>
<FONT COLOR="#0000ff">/var/named/named.priv.ate</FONT></TT> file should look like:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>$TTL 259200</code><br>
<code>@ IN SOA cericon.priv.ate. root.cericon.priv.ate. </code><br>
<code> ( 2000012101 10800 3600 3600000 259200 )</code><br>
<code> IN NS cericon.priv.ate.</code><br>
<code>cericon IN A 192.168.1.1</code><br>
<code>news IN A 192.168.1.2</code><br>
</FONT></TD></TR></TABLE><P>
<P>
The <TT>
<FONT COLOR="#0000ff">/var/named/named.192.168</FONT></TT> file should look like:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>$TTL 259200</code><br>
<code>@ IN SOA localhost. root.localhost.</code><br>
<code> ( 2000012101 10800 3600 3600000 259200 )</code><br>
<code> IN NS localhost.</code><br>
<code>1.1 IN PTR cericon.priv.ate.</code><br>
</FONT></TD></TR></TABLE><P>
<P>
The remaining files are the same as before.
In addition to the above, your host name has
to be configured as in Chapter <A HREF="node30.html#chap:dns">27</A>.
<P>
<H2><A NAME="SECTION004342000000000000000">
40.4.2 Dynamic IP addresses</A>
</H2>
<P>
The one contingency of dialup machines is that IP addresses are
often dynamically assigned, so your <TT>
<FONT COLOR="#0000ff">192.168.</FONT></TT> addresses
aren't going to apply. Probably one way to get around this is to
dial in a few times to get a feel for what IP addresses you are
likely to get. Assuming you know that your ISP always gives you
<TT>
<FONT COLOR="#0000ff">196.26.</FONT></TT><I>x</I><TT>
<FONT COLOR="#0000ff">.</FONT></TT><I>x</I>, you can have a reverse
lookup file <TT>
<FONT COLOR="#0000ff">named.196.26</FONT></TT> with nothing in it. This will
just cause reverse lookups to fail instead of blocking.
<P>
Such a ``hack'' is probably unnecessary. It is best to
identify the particular application that is causing a spurious
dialout or causing a block, and then apply your creativity to the
particular case.
<P>
<H1><A NAME="SECTION004350000000000000000">
40.5 Secondary or Slave DNS Servers</A>
</H1>
<P>
<TT>
<FONT COLOR="#0000ff">named</FONT></TT> can operate as a backup server to another
server, also called a <I>slave</I> or <I>secondary</I> server.
<P>
Like the caching-<I>only</I> server there, is no such thing
as a <I>secondary</I> server. It's just the same <TT>
<FONT COLOR="#0000ff">named</FONT></TT>
running with reduced capacity.
<P>
Let's say we would like <TT>
<FONT COLOR="#0000ff">ns2.cranzgot.co.za</FONT></TT> to be a secondary
to <TT>
<FONT COLOR="#0000ff">ns1.cranzgot.co.za</FONT></TT>. The <TT>
<FONT COLOR="#0000ff">named.conf</FONT></TT> file would
look as follows:
<P><TABLE nowrap="1" width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD valign="top" class="source" width="2%"><FONT color=red>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>5</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>10</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>15</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>20</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>25</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>30</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>35</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>40</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>45</code></font><code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<code> </code><br>
<font size="-1"><code>50</code></font><code> </code><br>
</FONT></TD><TD valign="top" class="source" bgcolor="#FFE0C0"><FONT color=blue>
<code>options {</code><br>
<code> directory "/var/named";</code><br>
<code>};</code><br>
<code> </code><br>
<code>zone "." {</code><br>
<code> type hint;</code><br>
<code> file "named.ca";</code><br>
<code>};</code><br>
<code> </code><br>
<code>zone "localdomain" {</code><br>
<code> type master;</code><br>
<code> file "named.localdomain";</code><br>
<code>};</code><br>
<code> </code><br>
<code>zone "1.0.0.127.in-addr.arpa" {</code><br>
<code> type master;</code><br>
<code> file "named.127.0.0.1";</code><br>
<code>};</code><br>
<code> </code><br>
<code>zone "cranzgot.co.za" {</code><br>
<code> type slave;</code><br>
<code> file "named.cranzgot.co.za";</code><br>
<code> masters {</code><br>
<code> 196.28.144.16;</code><br>
<code> };</code><br>
<code>};</code><br>
<code> </code><br>
<code>zone "2.168.192.in-addr.arpa" {</code><br>
<code> type slave;</code><br>
<code> file "named.192.168.2";</code><br>
<code> masters {</code><br>
<code> 196.28.144.16;</code><br>
<code> };</code><br>
<code>};</code><br>
<code> </code><br>
<code>zone "144.28.196.in-addr.arpa" {</code><br>
<code> type slave;</code><br>
<code> file "named.196.28.144";</code><br>
<code> masters {</code><br>
<code> 196.28.144.16;</code><br>
<code> };</code><br>
<code>};</code><br>
<code> </code><br>
<code>zone "44.181.123.160.in-addr.arpa" {</code><br>
<code> type slave;</code><br>
<code> file "named.160.123.181.44";</code><br>
<code> masters {</code><br>
<code> 196.28.144.16;</code><br>
<code> };</code><br>
<code>};</code><br>
</FONT></TD></TR></TABLE><P>
<P>
When an entry has a ``<TT>
<FONT COLOR="#0000ff">master</FONT></TT>'' in it, you must supply
the appropriate file.
When an entry has a ``<TT>
<FONT COLOR="#0000ff">slave</FONT></TT>'' in it, <TT>
<FONT COLOR="#0000ff">named</FONT></TT> will
automatically download the file from <TT>
<FONT COLOR="#0000ff">196.28.144.16</FONT></TT> (i.e.,
<TT>
<FONT COLOR="#0000ff">ns1.cranzgot.co.za</FONT></TT>) the first time a lookup is required
from that domain.
<P>
<I>And that's DNS!</I>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2766"
HREF="node44.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html2762"
HREF="rute.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html2756"
HREF="node42.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html2764"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2767"
HREF="node44.html">41. Point-to-Point Protocol </A>
<B> Up:</B> <A NAME="tex2html2763"
HREF="rute.html">rute</A>
<B> Previous:</B> <A NAME="tex2html2757"
HREF="node42.html">39. smbd </A>
  <B> <A NAME="tex2html2765"
HREF="node1.html">Contents</A></B>
<!--End of Navigation Panel-->
</BODY>
</HTML>
|