From d3c2301de426238be7a1398365565a55f9df0fac Mon Sep 17 00:00:00 2001 From: Apress Date: Sun, 16 Oct 2016 03:32:29 +0100 Subject: [PATCH] First commit --- 9781430230489.jpg | Bin 0 -> 9686 bytes LICENSE.txt | 27 +++++ README.md | 15 +++ code/chapter01/F0101ZF.txt | 28 +++++ code/chapter02/F0201ZF.txt | 33 ++++++ code/chapter02/F0202ZS.txt | 8 ++ code/chapter02/F0203ZS.txt | 12 +++ code/chapter02/F0204ZS.txt | 12 +++ code/chapter02/F0205ZS.txt | 6 ++ code/chapter02/F0206ZS.txt | 6 ++ code/chapter02/F0207ZS.txt | 5 + code/chapter02/F0208ZS.txt | 6 ++ code/chapter02/F0209ZS.txt | 4 + code/chapter02/F0210ZS.txt | 4 + code/chapter02/F0211ZS.txt | 5 + code/chapter02/F0212ZS.txt | 4 + code/chapter02/F0213ZS.txt | 4 + code/chapter02/F0214ZS.txt | 5 + code/chapter03/F0301ZS.txt | 25 +++++ code/chapter03/F0302ZS.txt | 6 ++ code/chapter03/F0303ZS.txt | 3 + code/chapter03/F0304ZS.txt | 2 + code/chapter03/F0305ZS.txt | 3 + code/chapter03/F0306ZS.txt | 2 + code/chapter03/F0307ZS.txt | 2 + code/chapter03/F0308ZS.txt | 2 + code/chapter03/F0309ZS.txt | 7 ++ code/chapter03/F0310ZS.txt | 7 ++ code/chapter04/F0401NS.txt | 6 ++ code/chapter04/F0402NS.txt | 8 ++ code/chapter04/F0403NS.txt | 15 +++ code/chapter04/F0404NS.txt | 11 ++ code/chapter04/F0405NS.txt | 10 ++ code/chapter04/F0406ZF.txt | 18 ++++ code/chapter04/F0407ZF.txt | 30 ++++++ code/chapter04/F0408NS.txt | 7 ++ code/chapter05/F0501ZF.txt | 29 ++++++ code/chapter05/F0502ZF.txt | 35 +++++++ code/chapter05/F0503ZS.txt | 2 + code/chapter05/F0504ZF.txt | 23 ++++ code/chapter05/F0505ZF.txt | 19 ++++ code/chapter05/F0506ZF.txt | 19 ++++ code/chapter06/F0601NF.txt | 47 +++++++++ code/chapter07/F0701ZS.txt | 19 ++++ code/chapter07/F0702NS.txt | 6 ++ code/chapter07/F0703ZF.txt | 12 +++ code/chapter07/F0704ZF.txt | 11 ++ code/chapter07/F0705ZF.txt | 12 +++ code/chapter07/F0706NS.txt | 6 ++ code/chapter07/F0707ZF.txt | 11 ++ code/chapter07/F0708NS.txt | 7 ++ code/chapter07/F0709ZF.txt | 11 ++ code/chapter07/F0710NS.txt | 10 ++ code/chapter07/F0711NS.txt | 15 +++ code/chapter07/F0712ZF.txt | 30 ++++++ code/chapter07/F0713NS.txt | 30 ++++++ code/chapter07/F0714NF.txt | 67 ++++++++++++ code/chapter07/F0715NS.txt | 12 +++ code/chapter07/F0716NF.txt | 76 ++++++++++++++ code/chapter07/F0717NF.txt | 54 ++++++++++ code/chapter07/F0718NF.txt | 51 +++++++++ code/chapter07/F0719NS.txt | 7 ++ code/chapter07/F0720NF.txt | 63 +++++++++++ code/chapter07/F0721ZF.txt | 29 ++++++ code/chapter07/F0722NF.txt | 61 +++++++++++ code/chapter07/F0723NF.txt | 94 +++++++++++++++++ code/chapter07/F0724NF.txt | 65 ++++++++++++ code/chapter07/F0725NS.txt | 8 ++ code/chapter08/F0801NS.txt | 13 +++ code/chapter08/F0802ZF.txt | 37 +++++++ code/chapter08/F0803NS.txt | 6 ++ code/chapter08/F0804ZF.txt | 29 ++++++ code/chapter08/F0805NS.txt | 6 ++ code/chapter08/F0806ZF.txt | 36 +++++++ code/chapter08/F0807ZS.txt | 8 ++ code/chapter08/F0808ZS.txt | 6 ++ code/chapter08/F0809ZS.txt | 32 ++++++ code/chapter08/F0810ZS.txt | 21 ++++ code/chapter08/F0811NS.txt | 6 ++ code/chapter08/F0812ZS.txt | 9 ++ code/chapter08/F0813ZS.txt | 7 ++ code/chapter08/F0814ZS.txt | 7 ++ code/chapter08/F0815ZS.txt | 8 ++ code/chapter08/F0816ZS.txt | 9 ++ code/chapter08/F0817NS.txt | 6 ++ code/chapter08/F0818ZS.txt | 6 ++ code/chapter08/F0819ZS.txt | 15 +++ code/chapter08/F0820ZS.txt | 7 ++ code/chapter08/F0821ZS.txt | 8 ++ code/chapter08/F0822ZS.txt | 18 ++++ code/chapter08/F0823ZS.txt | 13 +++ code/chapter08/F0824ZS.txt | 13 +++ code/chapter08/F0825ZS.txt | 20 ++++ code/chapter08/F0826ZS.txt | 12 +++ code/chapter08/F0827ZS.txt | 12 +++ code/chapter08/F0828ZS.txt | 17 +++ code/chapter08/F0829ZS.txt | 15 +++ code/chapter08/F0830ZS.txt | 14 +++ code/chapter08/F0831ZS.txt | 26 +++++ code/chapter08/F0832AS.txt | 9 ++ code/chapter08/F0833AS.txt | 9 ++ code/chapter08/F0834AS.txt | 11 ++ code/chapter08/F0835ZS.txt | 8 ++ code/chapter08/F0836ZS.txt | 7 ++ code/chapter08/F0837ZF.txt | 4 + code/chapter08/F0838NS.txt | 8 ++ code/chapter08/F0839NS.htm | 34 ++++++ code/chapter08/F0840NS.htm | 9 ++ code/chapter08/F0841ZS.htm | 23 ++++ code/chapter08/F0842NS.htm | 8 ++ code/chapter09/F0901DS.txt | 8 ++ code/chapter09/F0902DS.txt | 8 ++ code/chapter09/F0903DS.txt | 9 ++ code/chapter09/F0904DF.txt | 28 +++++ code/chapter09/F0905DF.txt | 49 +++++++++ code/chapter09/F0906DF.txt | 50 +++++++++ code/chapter09/F0907NS.txt | 13 +++ code/chapter10/F1001NS.txt | 11 ++ code/chapter10/F1002NS.txt | 4 + code/chapter10/F1003NS.txt | 5 + code/chapter10/F1004NS.txt | 22 ++++ code/chapter10/F1005SF.txt | 45 ++++++++ code/chapter10/F1006NS.txt | 9 ++ code/chapter10/F1007RS.txt | 13 +++ code/chapter10/F1008NF.txt | 53 ++++++++++ code/chapter10/F1009NS.txt | 24 +++++ code/chapter10/F1010NS.txt | 34 ++++++ code/chapter10/F1011NS.txt | 4 + code/chapter10/F1012NS.txt | 44 ++++++++ code/chapter10/F1013NS.txt | 17 +++ code/chapter10/F1014NS.txt | 34 ++++++ code/chapter10/F1015NS.txt | 48 +++++++++ code/chapter10/F1016NS.txt | 4 + code/chapter10/F1017ZS.txt | 7 ++ code/chapter10/F1018NS.txt | 35 +++++++ code/chapter10/F1019ZS.txt | 11 ++ code/chapter10/F1020ZS.txt | 14 +++ code/chapter11/F1101ZF.txt | 50 +++++++++ code/chapter11/F1102ZF.txt | 153 +++++++++++++++++++++++++++ code/chapter11/F1103ZF.txt | 25 +++++ code/chapter11/F1104ZF.txt | 27 +++++ code/chapter11/F1105ZE.txt | 95 +++++++++++++++++ code/chapter11/F1106NS.txt | 38 +++++++ code/chapter11/F1107NS.txt | 38 +++++++ code/chapter11/F1108ZS.txt | 3 + code/chapter11/F1109NS.txt | 35 +++++++ code/chapter11/F1110ZF.txt | 18 ++++ code/chapter11/F1111ZF.txt | 28 +++++ code/chapter11/F1112ZS.txt | 15 +++ code/chapter11/F1113ZF.txt | 29 ++++++ code/chapter11/F1114ZS.txt | 16 +++ code/chapter11/F1115ZF.txt | 29 ++++++ code/chapter11/F1116ZS.txt | 18 ++++ code/chapter11/F1117ZS.txt | 4 + code/chapter11/F1118NS.txt | 4 + code/chapter12/F1201NS.txt | 9 ++ code/chapter12/F1202NS.txt | 14 +++ code/chapter12/F1203NS.txt | 27 +++++ code/chapter12/F1204NS.txt | 39 +++++++ code/chapter12/F1205NS.txt | 3 + code/chapter12/F1206NS.txt | 3 + code/chapter12/F1207NS.txt | 10 ++ code/chapter12/F1208NS.txt | 40 +++++++ code/chapter12/F1209NS.txt | 23 ++++ code/chapter12/F1210NS.txt | 5 + code/chapter12/F1211NS.txt | 3 + code/chapter12/F1212NS.txt | 13 +++ code/chapter12/F1213NS.txt | 21 ++++ code/chapter12/F1214NS.txt | 24 +++++ code/chapter12/F1215NS.txt | 13 +++ code/chapter12/F1216ZS.txt | 8 ++ code/chapter12/F1217NS.txt | 9 ++ code/chapter12/F1218NS.txt | 17 +++ code/chapter12/F1219NS.txt | 23 ++++ code/chapter12/F1220NS.txt | 16 +++ code/chapter12/F1221NS.txt | 17 +++ code/chapter12/F1222NS.txt | 44 ++++++++ code/chapter12/F1223NS.txt | 16 +++ code/chapter12/F1224NS.txt | 12 +++ code/chapter12/F1225NS.txt | 22 ++++ code/chapter12/F1226NS.txt | 19 ++++ code/chapter12/F1227NS.txt | 23 ++++ code/chapter12/F1228NS.txt | 9 ++ code/chapter12/F1229NS.txt | 12 +++ code/chapter12/F1230NS.txt | 13 +++ code/chapter12/F1231NS.txt | 12 +++ code/chapter12/F1232NS.txt | 24 +++++ code/chapter12/F1233ZS.txt | 16 +++ code/chapter12/F1234NS.txt | 21 ++++ code/chapter12/F1235NS.txt | 13 +++ code/chapter12/F1236NS.txt | 6 ++ code/chapter13/F1301ZS.txt | 16 +++ code/chapter13/F1302ZS.txt | 11 ++ code/chapter13/F1303ZS.txt | 7 ++ code/chapter13/F1304ZS.txt | 5 + code/chapter13/F1305ZS.txt | 8 ++ code/chapter13/F1306ZS.txt | 5 + code/chapter13/F1307ZS.txt | 8 ++ code/chapter13/F1308ZS.txt | 6 ++ code/chapter13/F1309ZS.txt | 8 ++ code/chapter13/F1310ZS.txt | 23 ++++ code/chapter13/F1311ZS.txt | 8 ++ code/chapter13/F1312ZS.txt | 15 +++ code/chapter13/F1313ZS.txt | 10 ++ code/chapter13/F1314ZS.txt | 7 ++ code/chapter13/F1315ZS.txt | 15 +++ code/chapter13/F1316ZS.txt | 9 ++ code/chapter13/F1317ZS.txt | 8 ++ code/chapter13/F1318ZS.txt | 9 ++ code/chapter13/F1319ZS.txt | 12 +++ code/chapter13/F1320ZS.txt | 7 ++ code/chapter13/F1321ZS.txt | 7 ++ code/chapter13/F1322ZS.txt | 7 ++ code/chapter13/F1323ZS.txt | 5 + code/chapter13/F1324ZS.txt | 8 ++ code/chapter13/F1325ZS.txt | 6 ++ code/chapter13/F1326ZS.txt | 12 +++ code/chapter13/F1327ZS.txt | 15 +++ code/chapter13/F1328ZS.txt | 20 ++++ code/chapter13/F1329ZS.txt | 18 ++++ code/chapter13/F1330ZS.txt | 18 ++++ code/chapter13/F1331ZS.txt | 21 ++++ code/chapter13/F1332ZS.txt | 16 +++ code/chapter13/F1333ZS.txt | 31 ++++++ code/chapter13/F1334ZS.txt | 29 ++++++ code/chapter13/F1335ZS.txt | 13 +++ code/chapter13/F1336ZS.txt | 19 ++++ code/chapter13/F1337ZS.txt | 14 +++ code/chapter13/F1338ZS.txt | 32 ++++++ code/chapter13/F1339ZS.txt | 17 +++ code/chapter13/F1340ZS.txt | 12 +++ code/chapter13/F1341ZS.txt | 13 +++ code/chapter13/F1342ZS.txt | 22 ++++ code/chapter13/F1343ZS.txt | 22 ++++ code/chapter13/F1344ZS.txt | 16 +++ code/chapter13/F1345ZS.txt | 16 +++ code/chapter13/F1346ZS.txt | 10 ++ code/chapter13/F1347ZS.txt | 12 +++ code/chapter13/F1348ZS.txt | 12 +++ code/chapter13/F1349ZS.txt | 15 +++ code/chapter13/F1350ZS.txt | 18 ++++ code/chapter13/F1351ZS.txt | 8 ++ code/chapter13/F1352ZS.txt | 9 ++ code/chapter13/F1353ZS.txt | 14 +++ code/chapter13/F1354ZS.txt | 8 ++ code/chapter13/F1355ZS.txt | 8 ++ code/chapter13/F1356ZS.txt | 8 ++ code/chapter14/F1401CF.txt | 208 +++++++++++++++++++++++++++++++++++++ code/chapter14/F1402HF.txt | 5 + code/chapter14/F1403CS.txt | 40 +++++++ code/chapter15/F1501NS.txt | 10 ++ code/readme-windows.txt | 61 +++++++++++ code/readme.txt | 59 +++++++++++ contributing.md | 14 +++ 254 files changed, 4813 insertions(+) create mode 100644 9781430230489.jpg create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 code/chapter01/F0101ZF.txt create mode 100644 code/chapter02/F0201ZF.txt create mode 100644 code/chapter02/F0202ZS.txt create mode 100644 code/chapter02/F0203ZS.txt create mode 100644 code/chapter02/F0204ZS.txt create mode 100644 code/chapter02/F0205ZS.txt create mode 100644 code/chapter02/F0206ZS.txt create mode 100644 code/chapter02/F0207ZS.txt create mode 100644 code/chapter02/F0208ZS.txt create mode 100644 code/chapter02/F0209ZS.txt create mode 100644 code/chapter02/F0210ZS.txt create mode 100644 code/chapter02/F0211ZS.txt create mode 100644 code/chapter02/F0212ZS.txt create mode 100644 code/chapter02/F0213ZS.txt create mode 100644 code/chapter02/F0214ZS.txt create mode 100644 code/chapter03/F0301ZS.txt create mode 100644 code/chapter03/F0302ZS.txt create mode 100644 code/chapter03/F0303ZS.txt create mode 100644 code/chapter03/F0304ZS.txt create mode 100644 code/chapter03/F0305ZS.txt create mode 100644 code/chapter03/F0306ZS.txt create mode 100644 code/chapter03/F0307ZS.txt create mode 100644 code/chapter03/F0308ZS.txt create mode 100644 code/chapter03/F0309ZS.txt create mode 100644 code/chapter03/F0310ZS.txt create mode 100644 code/chapter04/F0401NS.txt create mode 100644 code/chapter04/F0402NS.txt create mode 100644 code/chapter04/F0403NS.txt create mode 100644 code/chapter04/F0404NS.txt create mode 100644 code/chapter04/F0405NS.txt create mode 100644 code/chapter04/F0406ZF.txt create mode 100644 code/chapter04/F0407ZF.txt create mode 100644 code/chapter04/F0408NS.txt create mode 100644 code/chapter05/F0501ZF.txt create mode 100644 code/chapter05/F0502ZF.txt create mode 100644 code/chapter05/F0503ZS.txt create mode 100644 code/chapter05/F0504ZF.txt create mode 100644 code/chapter05/F0505ZF.txt create mode 100644 code/chapter05/F0506ZF.txt create mode 100644 code/chapter06/F0601NF.txt create mode 100644 code/chapter07/F0701ZS.txt create mode 100644 code/chapter07/F0702NS.txt create mode 100644 code/chapter07/F0703ZF.txt create mode 100644 code/chapter07/F0704ZF.txt create mode 100644 code/chapter07/F0705ZF.txt create mode 100644 code/chapter07/F0706NS.txt create mode 100644 code/chapter07/F0707ZF.txt create mode 100644 code/chapter07/F0708NS.txt create mode 100644 code/chapter07/F0709ZF.txt create mode 100644 code/chapter07/F0710NS.txt create mode 100644 code/chapter07/F0711NS.txt create mode 100644 code/chapter07/F0712ZF.txt create mode 100644 code/chapter07/F0713NS.txt create mode 100644 code/chapter07/F0714NF.txt create mode 100644 code/chapter07/F0715NS.txt create mode 100644 code/chapter07/F0716NF.txt create mode 100644 code/chapter07/F0717NF.txt create mode 100644 code/chapter07/F0718NF.txt create mode 100644 code/chapter07/F0719NS.txt create mode 100644 code/chapter07/F0720NF.txt create mode 100644 code/chapter07/F0721ZF.txt create mode 100644 code/chapter07/F0722NF.txt create mode 100644 code/chapter07/F0723NF.txt create mode 100644 code/chapter07/F0724NF.txt create mode 100644 code/chapter07/F0725NS.txt create mode 100644 code/chapter08/F0801NS.txt create mode 100644 code/chapter08/F0802ZF.txt create mode 100644 code/chapter08/F0803NS.txt create mode 100644 code/chapter08/F0804ZF.txt create mode 100644 code/chapter08/F0805NS.txt create mode 100644 code/chapter08/F0806ZF.txt create mode 100644 code/chapter08/F0807ZS.txt create mode 100644 code/chapter08/F0808ZS.txt create mode 100644 code/chapter08/F0809ZS.txt create mode 100644 code/chapter08/F0810ZS.txt create mode 100644 code/chapter08/F0811NS.txt create mode 100644 code/chapter08/F0812ZS.txt create mode 100644 code/chapter08/F0813ZS.txt create mode 100644 code/chapter08/F0814ZS.txt create mode 100644 code/chapter08/F0815ZS.txt create mode 100644 code/chapter08/F0816ZS.txt create mode 100644 code/chapter08/F0817NS.txt create mode 100644 code/chapter08/F0818ZS.txt create mode 100644 code/chapter08/F0819ZS.txt create mode 100644 code/chapter08/F0820ZS.txt create mode 100644 code/chapter08/F0821ZS.txt create mode 100644 code/chapter08/F0822ZS.txt create mode 100644 code/chapter08/F0823ZS.txt create mode 100644 code/chapter08/F0824ZS.txt create mode 100644 code/chapter08/F0825ZS.txt create mode 100644 code/chapter08/F0826ZS.txt create mode 100644 code/chapter08/F0827ZS.txt create mode 100644 code/chapter08/F0828ZS.txt create mode 100644 code/chapter08/F0829ZS.txt create mode 100644 code/chapter08/F0830ZS.txt create mode 100644 code/chapter08/F0831ZS.txt create mode 100644 code/chapter08/F0832AS.txt create mode 100644 code/chapter08/F0833AS.txt create mode 100644 code/chapter08/F0834AS.txt create mode 100644 code/chapter08/F0835ZS.txt create mode 100644 code/chapter08/F0836ZS.txt create mode 100644 code/chapter08/F0837ZF.txt create mode 100644 code/chapter08/F0838NS.txt create mode 100644 code/chapter08/F0839NS.htm create mode 100644 code/chapter08/F0840NS.htm create mode 100644 code/chapter08/F0841ZS.htm create mode 100644 code/chapter08/F0842NS.htm create mode 100644 code/chapter09/F0901DS.txt create mode 100644 code/chapter09/F0902DS.txt create mode 100644 code/chapter09/F0903DS.txt create mode 100644 code/chapter09/F0904DF.txt create mode 100644 code/chapter09/F0905DF.txt create mode 100644 code/chapter09/F0906DF.txt create mode 100644 code/chapter09/F0907NS.txt create mode 100644 code/chapter10/F1001NS.txt create mode 100644 code/chapter10/F1002NS.txt create mode 100644 code/chapter10/F1003NS.txt create mode 100644 code/chapter10/F1004NS.txt create mode 100644 code/chapter10/F1005SF.txt create mode 100644 code/chapter10/F1006NS.txt create mode 100644 code/chapter10/F1007RS.txt create mode 100644 code/chapter10/F1008NF.txt create mode 100644 code/chapter10/F1009NS.txt create mode 100644 code/chapter10/F1010NS.txt create mode 100644 code/chapter10/F1011NS.txt create mode 100644 code/chapter10/F1012NS.txt create mode 100644 code/chapter10/F1013NS.txt create mode 100644 code/chapter10/F1014NS.txt create mode 100644 code/chapter10/F1015NS.txt create mode 100644 code/chapter10/F1016NS.txt create mode 100644 code/chapter10/F1017ZS.txt create mode 100644 code/chapter10/F1018NS.txt create mode 100644 code/chapter10/F1019ZS.txt create mode 100644 code/chapter10/F1020ZS.txt create mode 100644 code/chapter11/F1101ZF.txt create mode 100644 code/chapter11/F1102ZF.txt create mode 100644 code/chapter11/F1103ZF.txt create mode 100644 code/chapter11/F1104ZF.txt create mode 100644 code/chapter11/F1105ZE.txt create mode 100644 code/chapter11/F1106NS.txt create mode 100644 code/chapter11/F1107NS.txt create mode 100644 code/chapter11/F1108ZS.txt create mode 100644 code/chapter11/F1109NS.txt create mode 100644 code/chapter11/F1110ZF.txt create mode 100644 code/chapter11/F1111ZF.txt create mode 100644 code/chapter11/F1112ZS.txt create mode 100644 code/chapter11/F1113ZF.txt create mode 100644 code/chapter11/F1114ZS.txt create mode 100644 code/chapter11/F1115ZF.txt create mode 100644 code/chapter11/F1116ZS.txt create mode 100644 code/chapter11/F1117ZS.txt create mode 100644 code/chapter11/F1118NS.txt create mode 100644 code/chapter12/F1201NS.txt create mode 100644 code/chapter12/F1202NS.txt create mode 100644 code/chapter12/F1203NS.txt create mode 100644 code/chapter12/F1204NS.txt create mode 100644 code/chapter12/F1205NS.txt create mode 100644 code/chapter12/F1206NS.txt create mode 100644 code/chapter12/F1207NS.txt create mode 100644 code/chapter12/F1208NS.txt create mode 100644 code/chapter12/F1209NS.txt create mode 100644 code/chapter12/F1210NS.txt create mode 100644 code/chapter12/F1211NS.txt create mode 100644 code/chapter12/F1212NS.txt create mode 100644 code/chapter12/F1213NS.txt create mode 100644 code/chapter12/F1214NS.txt create mode 100644 code/chapter12/F1215NS.txt create mode 100644 code/chapter12/F1216ZS.txt create mode 100644 code/chapter12/F1217NS.txt create mode 100644 code/chapter12/F1218NS.txt create mode 100644 code/chapter12/F1219NS.txt create mode 100644 code/chapter12/F1220NS.txt create mode 100644 code/chapter12/F1221NS.txt create mode 100644 code/chapter12/F1222NS.txt create mode 100644 code/chapter12/F1223NS.txt create mode 100644 code/chapter12/F1224NS.txt create mode 100644 code/chapter12/F1225NS.txt create mode 100644 code/chapter12/F1226NS.txt create mode 100644 code/chapter12/F1227NS.txt create mode 100644 code/chapter12/F1228NS.txt create mode 100644 code/chapter12/F1229NS.txt create mode 100644 code/chapter12/F1230NS.txt create mode 100644 code/chapter12/F1231NS.txt create mode 100644 code/chapter12/F1232NS.txt create mode 100644 code/chapter12/F1233ZS.txt create mode 100644 code/chapter12/F1234NS.txt create mode 100644 code/chapter12/F1235NS.txt create mode 100644 code/chapter12/F1236NS.txt create mode 100644 code/chapter13/F1301ZS.txt create mode 100644 code/chapter13/F1302ZS.txt create mode 100644 code/chapter13/F1303ZS.txt create mode 100644 code/chapter13/F1304ZS.txt create mode 100644 code/chapter13/F1305ZS.txt create mode 100644 code/chapter13/F1306ZS.txt create mode 100644 code/chapter13/F1307ZS.txt create mode 100644 code/chapter13/F1308ZS.txt create mode 100644 code/chapter13/F1309ZS.txt create mode 100644 code/chapter13/F1310ZS.txt create mode 100644 code/chapter13/F1311ZS.txt create mode 100644 code/chapter13/F1312ZS.txt create mode 100644 code/chapter13/F1313ZS.txt create mode 100644 code/chapter13/F1314ZS.txt create mode 100644 code/chapter13/F1315ZS.txt create mode 100644 code/chapter13/F1316ZS.txt create mode 100644 code/chapter13/F1317ZS.txt create mode 100644 code/chapter13/F1318ZS.txt create mode 100644 code/chapter13/F1319ZS.txt create mode 100644 code/chapter13/F1320ZS.txt create mode 100644 code/chapter13/F1321ZS.txt create mode 100644 code/chapter13/F1322ZS.txt create mode 100644 code/chapter13/F1323ZS.txt create mode 100644 code/chapter13/F1324ZS.txt create mode 100644 code/chapter13/F1325ZS.txt create mode 100644 code/chapter13/F1326ZS.txt create mode 100644 code/chapter13/F1327ZS.txt create mode 100644 code/chapter13/F1328ZS.txt create mode 100644 code/chapter13/F1329ZS.txt create mode 100644 code/chapter13/F1330ZS.txt create mode 100644 code/chapter13/F1331ZS.txt create mode 100644 code/chapter13/F1332ZS.txt create mode 100644 code/chapter13/F1333ZS.txt create mode 100644 code/chapter13/F1334ZS.txt create mode 100644 code/chapter13/F1335ZS.txt create mode 100644 code/chapter13/F1336ZS.txt create mode 100644 code/chapter13/F1337ZS.txt create mode 100644 code/chapter13/F1338ZS.txt create mode 100644 code/chapter13/F1339ZS.txt create mode 100644 code/chapter13/F1340ZS.txt create mode 100644 code/chapter13/F1341ZS.txt create mode 100644 code/chapter13/F1342ZS.txt create mode 100644 code/chapter13/F1343ZS.txt create mode 100644 code/chapter13/F1344ZS.txt create mode 100644 code/chapter13/F1345ZS.txt create mode 100644 code/chapter13/F1346ZS.txt create mode 100644 code/chapter13/F1347ZS.txt create mode 100644 code/chapter13/F1348ZS.txt create mode 100644 code/chapter13/F1349ZS.txt create mode 100644 code/chapter13/F1350ZS.txt create mode 100644 code/chapter13/F1351ZS.txt create mode 100644 code/chapter13/F1352ZS.txt create mode 100644 code/chapter13/F1353ZS.txt create mode 100644 code/chapter13/F1354ZS.txt create mode 100644 code/chapter13/F1355ZS.txt create mode 100644 code/chapter13/F1356ZS.txt create mode 100644 code/chapter14/F1401CF.txt create mode 100644 code/chapter14/F1402HF.txt create mode 100644 code/chapter14/F1403CS.txt create mode 100644 code/chapter15/F1501NS.txt create mode 100644 code/readme-windows.txt create mode 100644 code/readme.txt create mode 100644 contributing.md diff --git a/9781430230489.jpg b/9781430230489.jpg new file mode 100644 index 0000000000000000000000000000000000000000..890e2271a27db4fc6320b09634b81ce96cd9e064 GIT binary patch literal 9686 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" +; configuration file of BIND domain name servers). +; +; This file is made available by InterNIC +; under anonymous FTP as +; file /domain/named.cache +; on server FTP.INTERNIC.NET +; -OR- RS.INTERNIC.NET +; +; last update: Jun 17, 2010 +; related version of root zone: 2010061700 +; +; formerly NS.INTERNIC.NET +; +. 3600000 IN NS A.ROOT-SERVERS.NET. +A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 +A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30 \ No newline at end of file diff --git a/code/chapter07/F0702NS.txt b/code/chapter07/F0702NS.txt new file mode 100644 index 0000000..d001e96 --- /dev/null +++ b/code/chapter07/F0702NS.txt @@ -0,0 +1,6 @@ +// BIND named.conf fragment +zone "localhost" in{ + type master; + file "master.localhost"; + allow-update {none;}; // optional +}; diff --git a/code/chapter07/F0703ZF.txt b/code/chapter07/F0703ZF.txt new file mode 100644 index 0000000..320d852 --- /dev/null +++ b/code/chapter07/F0703ZF.txt @@ -0,0 +1,12 @@ +$TTL 86400 ; 24 hours could have been written as 24h or 1d +$ORIGIN localhost. +@ 1D IN SOA @ hostmaster ( + 2004022401 ; serial + 12h ; refresh + 15m ; retry + 1w ; expiry + 3h ; minimum + ) +@ 1D IN NS @ ; localhost is the name server + 1D IN A 127.0.0.1 ; always returns the loop-back address + diff --git a/code/chapter07/F0704ZF.txt b/code/chapter07/F0704ZF.txt new file mode 100644 index 0000000..d101f1e --- /dev/null +++ b/code/chapter07/F0704ZF.txt @@ -0,0 +1,11 @@ +$TTL 1d ; +$ORIGIN localhost. +localhost. IN SOA localhost. hostmaster.localhost. ( + 2002022401 ; serial + 3H ; refresh + 15M ; retry + 1w ; expire + 3h ; nx + ) +localhost. IN NS localhost. ; localhost is the name server +localhost. IN A 127.0.0.1 ; the loop-back address diff --git a/code/chapter07/F0705ZF.txt b/code/chapter07/F0705ZF.txt new file mode 100644 index 0000000..13c45a0 --- /dev/null +++ b/code/chapter07/F0705ZF.txt @@ -0,0 +1,12 @@ +$TTL 86400 ; 24 hours could have been written as 24h or 1d +$ORIGIN localhost. +@ 1D IN SOA @ hostmaster ( + 2004022401 ; serial + 12h ; refresh + 15m ; retry + 1w ; expiry + 3h ; nx + ) +@ 1D IN NS @ ; localhost is the name server + 1D IN A 127.0.0.1 ; IPv4 loop-back address + 1D IN AAAA ::1 ; IPv6 loop-back address diff --git a/code/chapter07/F0706NS.txt b/code/chapter07/F0706NS.txt new file mode 100644 index 0000000..9e0d385 --- /dev/null +++ b/code/chapter07/F0706NS.txt @@ -0,0 +1,6 @@ +// BIND named.conf fragment +zone "0.0.127.IN-ADDR.ARPA" in{ + type master; + file "localhost.rev"; + allow-update{none;}; // optional +}; diff --git a/code/chapter07/F0707ZF.txt b/code/chapter07/F0707ZF.txt new file mode 100644 index 0000000..8169c6c --- /dev/null +++ b/code/chapter07/F0707ZF.txt @@ -0,0 +1,11 @@ +$TTL 86400 ; 24 hours +; could use $ORIGIN 0.0.127.IN-ADDR.ARPA. +@ IN SOA localhost. hostmaster.localhost. ( + 1997022700 ; Serial + 3h ; Refresh + 15 ; Retry + 1w ; Expire + 3h ) ; nx + IN NS localhost. +1 IN PTR localhost. + diff --git a/code/chapter07/F0708NS.txt b/code/chapter07/F0708NS.txt new file mode 100644 index 0000000..5468416 --- /dev/null +++ b/code/chapter07/F0708NS.txt @@ -0,0 +1,7 @@ +// named.conf fragment +.... +zone "0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA" in{ + type master; + file "localhost-ipv6.rev"; + allow-update {"none";}; +}; diff --git a/code/chapter07/F0709ZF.txt b/code/chapter07/F0709ZF.txt new file mode 100644 index 0000000..d4e8a4c --- /dev/null +++ b/code/chapter07/F0709ZF.txt @@ -0,0 +1,11 @@ +$TTL 86400 ; 24 hours +$ORIGIN 0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA. +@ IN SOA localhost. hostmaster.localhost. ( + 1997022700 ; Serial + 3h ; Refresh + 15 ; Retry + 1w ; Expire + 3h ) ; nx + IN NS localhost. +1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN PTR localhost. + diff --git a/code/chapter07/F0710NS.txt b/code/chapter07/F0710NS.txt new file mode 100644 index 0000000..e4c9014 --- /dev/null +++ b/code/chapter07/F0710NS.txt @@ -0,0 +1,10 @@ +// zone starts a new clause +zone "example.com" { + // all clause statements are contained within braces + // type, file and masters are statements and terminate with a semicolon + type slave; + file "slave.example.com"; + masters {10.0.0.1;}; + // the zone clause is terminated with a closing brace +}; + diff --git a/code/chapter07/F0711NS.txt b/code/chapter07/F0711NS.txt new file mode 100644 index 0000000..f9cea6f --- /dev/null +++ b/code/chapter07/F0711NS.txt @@ -0,0 +1,15 @@ +// dense single line layout style +zone "example.com" {type slave; file "sec.example.com"; masters {10.0.0.1;};}; +// multiple line layout style +zone "example.com" { + type slave; + file "slave.example.com"; + masters {10.0.0.1;}; +}; +// a slightly confusing hybrid layout style +zone "example.com" { + type slave; + file "slave.example.com"; + masters {10.0.0.1;}; }; + + diff --git a/code/chapter07/F0712ZF.txt b/code/chapter07/F0712ZF.txt new file mode 100644 index 0000000..d7cb2e5 --- /dev/null +++ b/code/chapter07/F0712ZF.txt @@ -0,0 +1,30 @@ +; simple zone file for example.com +$TTL 2d ; default TTL for zone +$ORIGIN example.com. ; base domain-name +; Start of Authority RR defining the key characteristics of the zone (domain) +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 20101215 ; se = serial number + 12h ; ref = refresh + 15m ; ret = refresh retry + 3w ; ex = expiry + 2h ; nx = nxdomain ttl + ) +; name server RR for the domain + IN NS ns1.example.com. +; the second name server is +; external to this zone (domain). + IN NS ns2.example.net. +; mail server RRs for the zone (domain) + 3w IN MX 10 mail.example.com. +; the second mail servers is external to the zone (domain) + IN MX 20 mail.example.net. +; domain hosts includes NS and MX records defined above +; plus any others required +ns1 IN A 192.168.254.2 +mail IN A 192.168.254.4 +joe IN A 192.168.254.6 +www IN A 192.168.254.7 +; aliases ftp (ftp server) to an external domain +ftp IN CNAME ftp.example.net. + + diff --git a/code/chapter07/F0713NS.txt b/code/chapter07/F0713NS.txt new file mode 100644 index 0000000..364eaa5 --- /dev/null +++ b/code/chapter07/F0713NS.txt @@ -0,0 +1,30 @@ +// Master & Caching Name Server for Example, INC. +// Recommended that you always maintain a change log in this file as shown here +// CHANGELOG: +// 1. 9 july 2005 INITIALS or NAME +// a. did something +// a. 23 july 2005 INITIALS or NAME +// a. did something again +// b. another change +// options clause defining the server-wide properties +options { + // all relative paths use this directory as a base + directory "/var/named"; + // version statement for security to avoid hacking known weaknesses + // if the real version number is published + version "not currently available"; +}; +// logging clause +// log to /var/log/named/example.log all events from info UP in severity (no debug) +// uses 3 files in rotation swaps files when size reaches 250K +// failure messages up to this point are in syslog e.g. /var/log/messages +// +logging { + channel example_log{ + file "/var/log/named/example.log" versions 3 size 250k; + severity info; + }; + category default{ + example_log; + }; +}; diff --git a/code/chapter07/F0714NF.txt b/code/chapter07/F0714NF.txt new file mode 100644 index 0000000..a6a6a09 --- /dev/null +++ b/code/chapter07/F0714NF.txt @@ -0,0 +1,67 @@ +// Master & Caching Name Server for EXAMPLE.COM. +// Recommended that you always maintain a change log in this file as shown here +// CHANGELOG: +// 1. 9 july 2005 INITIALS or NAME +// a. did something +// a. 23 july 2005 INITIALS or NAME +// a. did something again +// b. another change +// options clause defining the server-wide properties +options { + // all relative paths use this directory as a base + directory "/var/named"; + // version statement for security to avoid hacking known weaknesses + // if the real version number is published + version "not currently available"; + // configuration unique options statements + // optional - disables zone transfers except for the slave + // in the example.net domain + allow-transfer {192.168.1.2;}; + // optional - BIND default behavior is recursion + recursion yes; + allow-recursion {10.0/16;}; // prevents Open resolver behavior +}; +// logging clause +// log to /var/log/named/example.log all events from info UP in severity (no debug) +// uses 3 files in rotation swaps files when size reaches 250K +// failure messages up to this point are in syslog e.g. /var/log/messages +// +logging { + channel example_log{ + file "/var/log/named/example.log" versions 3 size 250k; + severity info; + }; + category default{ + example_log; + }; +}; +// root.servers - required zone for recursive queries +zone "." { + type hint; + file "root.servers"; +}; +// zone clause - master for example.com +zone "example.com" in{ + type master; + file "master/master.example.com"; + allow-update {none;}; +}; +// required local host domain +zone "localhost" in{ + type master; + file "master.localhost"; + allow-update {none;}; +}; +// localhost reverse map +zone "0.0.127IN-ADDR.ARPA" in{ + type master; + file "localhost.rev"; + allow-update {none;}; +}; +// reverse map for local addresses at example.com +// uses 192.168.254.0 for illustration +zone "254.168.192.IN-ADDR.ARPA" in{ + type master; + file "192.168.254.rev"; + allow-update {none;}; +}; diff --git a/code/chapter07/F0715NS.txt b/code/chapter07/F0715NS.txt new file mode 100644 index 0000000..3e533b9 --- /dev/null +++ b/code/chapter07/F0715NS.txt @@ -0,0 +1,12 @@ +.... +options { + .... + allow-transfer {none;}; + .... +} +.... +zone "example.com" in { + .... + allow-transfer {192.168.1.2;}; + .... +}; diff --git a/code/chapter07/F0716NF.txt b/code/chapter07/F0716NF.txt new file mode 100644 index 0000000..8be1d64 --- /dev/null +++ b/code/chapter07/F0716NF.txt @@ -0,0 +1,76 @@ +// Slave & caching Name Server for EXAMPLE.NET. +// provides slave name server support for example com +// Recommended that you always maintain a change log in this file as shown here +// CHANGELOG: +// 1. 9 july 2005 INITIALS or NAME +// a. did something +// a. 23 july 2005 INITIALS or NAME +// a. did something again +// b. another change +// +options { + // all relative paths use this directory as a base + directory "/var/named"; + // version statement for security to avoid hacking known weaknesses + // if the real version number is published + version "not currently available"; + // configuration unique statements + // disables all zone transfer requests + allow-transfer {"none";}; + // optional - BIND default behavior is recusrion + recursion yes; + // Closed DNS - permits only local IPs to issue recursive queries + allow-recursion {172.16.2/24;}; +}; +// +// log to /var/log/named/examplenet.log all events from info UP +// in severity +// defaults to use 3 files in rotation +// failure messages up to this point are in (syslog) /var/log/messages + logging{ + channel examplenet_log{ + file "/var/log/named/examplenet.log" versions 3 size 250k; + severity info; + }; + category default{ + examplenet_log; + }; +}; +// required zone for recursive queries +zone "." { + type hint; + file "root.servers"; +}; +// assumes this server is also master for example.net +zone "example.net" in{ + type master; + file "master/master.example.net"; + allow-update {none;}; +}; +// slave for example.com; see following notes +zone "example.com" in{ + type slave; + file "slave/slave.example.com"; + masters {192.168.254.2;}; + // allows notifies only from master + allow-notify {192.168.254.2;}; +}; +// required local host domain +zone "localhost" in{ + type master; + file "master.localhost"; + allow-update{none;}; +}; +// localhost reverse map +zone "0.0.127.IN-ADDR.ARPA" in{ + type master; + file "localhost.rev"; + allow-update{none;}; +}; +// reverse map for example.net local IPs +// assumed 192.168.1.0 (see notes) +zone "1.168.192.IN-ADDR.ARPA" IN { + type slave; + file "slave.192.168.1.rev"; + masters {192.168.1.1;}; +}; diff --git a/code/chapter07/F0717NF.txt b/code/chapter07/F0717NF.txt new file mode 100644 index 0000000..53007a8 --- /dev/null +++ b/code/chapter07/F0717NF.txt @@ -0,0 +1,54 @@ +// Caching Name Server for Exammple.COM. +// Recommended that you always maintain a change log in this file as shown here +// CHANGELOG: +// 1. 9 july 2005 INITIALS or NAME +// a. did something +// a. 23 july 2005 INITIALS or NAME +// a. did something more +// b. another change +// +options { + // all relative paths use this directory as a base + directory "/var/named"; + // version statement for security to avoid hacking known weaknesses + // if the real version number is published + version "not currently available"; + // configuration-specific option clause statements + // disables all zone transfer requests + allow-transfer{"none";}; + // optional - BIND default behavior is recursion + recursion yes; + // Closed DNS - permits limited IPs to issue recursive queries + allow-recursion {10/8; 192.168.5.3; 192.168.7/24}; // prevents Open resolver +}; +// +// log to /var/log/example.log all events from info UP in severity (no debug) +// defaults to use 3 files in rotation +// failure messages up to this point are in (syslog) /var/log/messages +// + logging{ + channel example_log{ + file "/var/log/named/example.log" versions 3 size 250k; + severity info; + }; + category default{ + example_log; + }; +}; +// required zone for recursive queries +zone "." { + type hint; + file "root.servers"; +}; +// required local host domain +zone "localhost" in{ + type master; + file "master.localhost"; + allow-update{none;}; +}; +// localhost reverse map +zone "0.0.127.IN-ADDR.ARPA" in{ + type master; + file "localhost.rev"; + allow-update{none;}; +}; diff --git a/code/chapter07/F0718NF.txt b/code/chapter07/F0718NF.txt new file mode 100644 index 0000000..11d28df --- /dev/null +++ b/code/chapter07/F0718NF.txt @@ -0,0 +1,51 @@ +// Forwarding & Caching Name Server for Example, INC. +// Corrected October 23 2005 +// Recommended that you always maintain a change log in this file as shown here +// CHANGELOG: +// 1. 9 july 2005 INITIALS or NAME +// a. did something +// a. 23 july 2005 INITIALS or NAME +// a. did something more +// b. another change +// +options { + // all relative paths use this directory as a base + directory "/var/named"; + // version statement for security to avoid hacking known weaknesses + version "not currently available"; + // configuration specfic options statements + forwarders {10.0.0.1; 10.0.0.2;}; + forward only; + // disables all zone transfer requests + allow-transfer{"none";}; + // turn off recursion + recursion no; + allow-query-cache {localnets;}; //enables access to the cache for local LAN users +}; +// log to /var/log/example.log all events from info UP in severity (no debug) +// defaults to use 3 files in rotation +// failure messages up to this point are in (syslog) /var/log/messages + logging{ + channel example_log{ + file "/var/log/named/example.log" versions 3 size 250k; + severity info; + print-severity yes; + print-time yes; + print-category yes; + }; + category default{ + example_log; + }; +}; +// required local host domain +zone "localhost" in{ + type master; + file "master.localhost"; + allow-update{none;}; +}; +// localhost reverse map +zone "0.0.127.IN-ADDR.ARPA" in{ + type master; + file "localhost.rev"; + allow-update{none;}; +}; diff --git a/code/chapter07/F0719NS.txt b/code/chapter07/F0719NS.txt new file mode 100644 index 0000000..540d5ab --- /dev/null +++ b/code/chapter07/F0719NS.txt @@ -0,0 +1,7 @@ +// BIND named.conf fragment +// use of forward in a zone clause +zone "example.net" in{ + type forward; + forwarders{10.0.0.3;}; + forward only; +}; diff --git a/code/chapter07/F0720NF.txt b/code/chapter07/F0720NF.txt new file mode 100644 index 0000000..beb429e --- /dev/null +++ b/code/chapter07/F0720NF.txt @@ -0,0 +1,63 @@ +// Master & Caching Name Server for Example, INC. STEALTH SIDE +// Recommended that you always maintain a change log in this file as shown here +// CHANGELOG: +// 1. 9 july 2005 INITIALS or NAME +// a. did something +// a. 23 july 2005 INITIALS or NAME +// a. did something again +// b. another change +// +options { + // all relative paths use this directory as a base + directory "/var/named"; + // version statement for security to avoid hacking known weaknesses + // if the real version number is published + version "not currently available"; + // optional - BIND default behavior is recursion + recursion yes; + allow-recursion {172.18/16;}; // permits access to the cache +}; +// +// log to /var/log/named/example.log all events from info UP in severity (no debug) +// uses 3 files in rotation swaps files when size reaches 250K +// failure messages up to this point are in syslog e.g. /var/log/messages +// + logging{ + channel example_log{ + file "/var/log/named/example.log" versions 3 size 250k; + severity info; + }; + category default{ + example_log; + }; +}; +// required zone for recursive queries +// transactions will pass through a classic firewall +zone "." { + type hint; + file "root.servers"; +}; +// zone clause - master for example.com +zone "example.com" in{ + type master; + file "master/master.example.com.internal"; + allow-update{none;}; +}; +// required local host domain +zone "localhost" in{ + type master; + file "master.localhost"; + allow-update {none;}; +}; +// localhost reverse map +zone "0.0.127IN-ADDR.ARPA" in{ + type master; + file "localhost.rev"; + allow-update{none;}; +}; +// reverse map for local address at example.com +// uses 192.168.254.0 for illustration +zone "254.168.192.IN-ADDR.ARPA" in{ + type master; + file "192.168.254.rev"; +}; diff --git a/code/chapter07/F0721ZF.txt b/code/chapter07/F0721ZF.txt new file mode 100644 index 0000000..4526704 --- /dev/null +++ b/code/chapter07/F0721ZF.txt @@ -0,0 +1,29 @@ +; simple zone file for example.com +$TTL 2d ; default TTL for zone +$ORIGIN example.com. ; base domain-name +; Start of Authority RR defining the key characteristics of the zone (domain) +@ IN SOA ns3.example.com. hostmaster.example.com. ( + 2010080800 ; se = serial number + 12h ; ref = refresh + 15m ; ret = refresh retry + 3w ; ex = expiry + 2h ; nx = nxdomainttl + ) +; name server RRs for the domain + IN NS ns3.example.com. +; mail server RRs for the zone (domain) + 3w IN MX 10 mail.example.com. +; the second mail servers is external to the zone (domain) + IN MX 20 mail.example.net. +; domain hosts includes NS and MX records defined previously +; plus any others required +mail IN A 192.168.254.4 +joe IN A 192.168.254.6 +www IN A 192.168.254.7 +; aliases ftp (ftp server) to an external domain +ftp IN CNAME ftp.example.net. +// private hosts and services +ns3 IN A 192.168.254.10 +accounts IN A 192.168.254.11 +hr IN A 192.168.254.12 +last IN A 192.168.254.233 diff --git a/code/chapter07/F0722NF.txt b/code/chapter07/F0722NF.txt new file mode 100644 index 0000000..e32ef7a --- /dev/null +++ b/code/chapter07/F0722NF.txt @@ -0,0 +1,61 @@ +// Authoritative only Name Server for Example, INC. +// Recommended that you always maintain a change log in this file as shown here +// CHANGELOG: +// 1. 9 july 2005 INITIALS or NAME +// a. did something +// a. 23 july 2005 INITIALS or NAME +// a. did something again +// b. another change +// +options { + // all relative paths use this directory as a base + directory "/var/named"; + // version statement for security to avoid hacking known weaknesses + version "not currently available"; + recursion no; + // disables all zone transfer requests + // for performance as well as security reasons + allow-transfer{"none";}; + dnssec-enable no; // zone not signed in this case - see Chapter 11 + minimal-responses yes; // optional - improved performance + additional-from-auth no; // optional - improved performance + additional-from-cache no; // optional - minimal performance change + +}; +// +// log to /var/log/zytrax-named all events from info UP in severity (no debug) +// uses 3 files in rotation swaps files when size reaches 250K +// failure messages up to this point are in (syslog) /var/log/messages +// + logging{ + channel example_log{ + file "/var/log/named/example.log" versions 3 size 250k; + severity info; + }; + category default{ + example_log; + }; +}; +zone "example.com" in{ + type master; + file "master/master.example.com"; + allow-update{none;}; +}; +// reverse map for local address at example.com +// uses 192.168.254.0 for illustration +zone "254.168.192.IN-ADDR.ARPA" in{ + type master; + file "192.168.254.rev"; +}; +// required local host domain +zone "localhost" in{ + type master; + file "master.localhost"; + allow-update{none;}; +}; +// localhost reverse map +zone "0.0.127.IN-ADDR.ARPA" in{ + type master; + file "localhost.rev"; + allow-update{none;}; +}; diff --git a/code/chapter07/F0723NF.txt b/code/chapter07/F0723NF.txt new file mode 100644 index 0000000..e9c3b63 --- /dev/null +++ b/code/chapter07/F0723NF.txt @@ -0,0 +1,94 @@ +// View-based Authoritative Name Server for EXAMPLE, INC. +// Recommended that you always maintain a change log in this file as shown here +// CHANGELOG: +// 1. 9 july 2005 INITIALS or NAME +// a. did something +// a. 23 july 2005 INITIALS or NAME +// a. did something again +// b. another change +// +// global options +options { + // all relative paths use this directory as a base + directory "/var/named"; + // version statement for security to avoid hacking known weaknesses + version "not currently available"; + dnssec-enable no; // zone not signed in this case - see Chapter 11 +}; +// +// log to /var/log/example.com all events from info UP in severity (no debug) +// uses 3 files in rotation swaps files when size reaches 250K + +// failure messages up to this point are in (syslog) /var/log/messages +// + logging{ + channel example_log{ + file "/var/log/named/example.log" versions 3 size 250k; + severity info; + }; + category default{ + example_log; + }; +}; +// provide recursive queries and caching for internal users +view "goodguys" { + match-clients { 192.168.254.0/24; }; // the example.com network + recursion yes; + allow-recursion { 192.168.254/24;}; // allows cache access for selected IPs + // required zone for recursive queries + zone "." { + type hint; + file "root.servers"; + }; + zone "example.com" { + type master; + // private zone files including local hosts + file "view/master.example.com.internal"; + allow-update{none;}; + }; + // required local host domain + zone "localhost" in{ + type master; + file "master.localhost"; + allow-update{none;}; + }; + // localhost reverse map + zone "0.0.127.IN-ADDR.ARPA" in{ + type master; + file "localhost.rev"; + allow-update{none;}; + }; + // reverse map for local address at example.com + // uses 192.168.254.0 for illustration + zone "254.168.192.IN-ADDR.ARPA" in{ + type master; + file "view/192.168.254.rev.internal"; + allow-update{none;}; +}; + +}; // end view + +// external hosts view +view "badguys" { + match-clients {"any"; }; // all other hosts + // recursion not supported + recursion no; + minimal-responses yes; // optional - improved performance + additional-from-auth no; // optional - improved performance + additional-from-cache no; // optional - minimal performance change + + zone "example.com" { + type master; + // only public hosts + file "view/master.example.com.external"; + allow-update{none;}; + }; + // reverse map for local address at example.com + // uses 192.168.254.0 for illustration + zone "254.168.192.IN-ADDR.ARPA" in{ + type master; + file "view/192.168.254.rev.external"; + allow-update{none;}; + }; + +}; // end view diff --git a/code/chapter07/F0724NF.txt b/code/chapter07/F0724NF.txt new file mode 100644 index 0000000..b7d4c5a --- /dev/null +++ b/code/chapter07/F0724NF.txt @@ -0,0 +1,65 @@ +// View based Authoritative Name Server for EXAMPLE.COM. +// Recommended that you always maintain a change log in this file as shown here +// CHANGELOG: +// 1. 9 july 2005 INITIALS or NAME +// a. did something +// a. 23 july 2005 INITIALS or NAME +// a. did something again +// b. another change +// +// global options +options { + // all relative paths use this directory as a base + directory "/var/named"; + // version statement for security to avoid hacking known weaknesses + version "not currently available"; + dnssec-enable no; // zone not signed in this case - see Chapter 11 +}; +// +// log to /var/log/example.com all events from info UP in severity (no debug) +// uses 3 files in rotation swaps files when size reaches 250K + +// failure messages up to this point are in (syslog) /var/log/messages +// + logging{ + channel example_log{ + file "/var/log/named/example.log" versions 3 size 250k; + severity info; + }; + category default{ + example_log; + }; +}; +// provide recursive queries and caching for our internal users +view "goodguys" { + match-clients { 192.168.254.0/24; }; // example.com's network + recursion yes; + // required zone for recursive queries + zone "." { + type hint; + file "root.servers"; + }; +}; // end view + +// external hosts view +view "badguys" { + match-clients {"any"; }; // all other hosts + // recursion not supported + recursion no; + minimal-responses yes; // optional - improved performance + additional-from-auth no; // optional - improved performance + additional-from-cache no; // optional - minimal performance + + zone "example.com" { + type master; + // only public hosts + file "view/master.example.com.external"; + }; + // reverse map for local address at example.com + // uses 192.168.254.0 for illustration + zone "254.168.192.IN-ADDR.ARPA" in{ + type master; + file "view/192.168.254.rev.external"; + }; + +}; // end view diff --git a/code/chapter07/F0725NS.txt b/code/chapter07/F0725NS.txt new file mode 100644 index 0000000..126b391 --- /dev/null +++ b/code/chapter07/F0725NS.txt @@ -0,0 +1,8 @@ +// BIND named.conf fragment +// forwards requests for domains other than example.com +// to the public name server ns1.example.com = 192.168.254.2 +zone "." in{ + type forward; + forwarders{192.168.254.2;}; + forward only; +}; diff --git a/code/chapter08/F0801NS.txt b/code/chapter08/F0801NS.txt new file mode 100644 index 0000000..101a506 --- /dev/null +++ b/code/chapter08/F0801NS.txt @@ -0,0 +1,13 @@ +// named.conf file fragment + +zone "example.com" in{ + type master; + file "master.example.com"; +}; +// optional - example.com acts as the slave (secondary) for the delegated subdomain +zone "us.example.com" IN { + type slave; + file "slave.us.example.com"; + masters {10.10.0.24;}; +}; + diff --git a/code/chapter08/F0802ZF.txt b/code/chapter08/F0802ZF.txt new file mode 100644 index 0000000..3482632 --- /dev/null +++ b/code/chapter08/F0802ZF.txt @@ -0,0 +1,37 @@ +; zone fragment for 'zone name' example.com +$TTL 2d ; default TTL is 2 days +$ORIGIN example.com. +@ . IN SOA ns1.example.com. hostmaster.example.com. ( + 2010121500 ; serial number + 12h ; refresh = 12 hours + 15m ; refresh retry = 15 minutes + 3w12h ; expiry = 3 weeks + 12 hours + 2h20m ; nx = 2 hours + 20 minutes + ) +; main domain name servers + IN NS ns1.example.com. + IN NS ns2.example.com. +; mail domain mail servers + IN MX mail.example.com. +; A records for preceding name servers +ns1 IN A 192.168.0.3 +ns2 IN A 192.168.0.4 +; A record for preceding mail server +mail IN A 192.168.0.5 +.... +; subdomain definitions in the same zone file +; $ORIGIN directive simplifies and clarifies definitions +$ORIGIN us.example.com. ; all subsequent RRs use this ORIGIN +; two name servers for the subdomain +@ IN NS ns3.us.example.com. +; the preceding record could have been written without the $ORIGIN as +; us.example.com. IN NS ns3.us.example.com. +; or @ IN NS ns3 +; the second name server points back to preceding ns1 + IN NS ns1.example.com. +; A records for name server ns3 required - the glue record +ns3 IN A 10.10.0.24 ; glue record +; the preceding record could have been written as +; ns3.us.example.com. A 10.10.0.24 if it's less confusing + + diff --git a/code/chapter08/F0803NS.txt b/code/chapter08/F0803NS.txt new file mode 100644 index 0000000..06a6332 --- /dev/null +++ b/code/chapter08/F0803NS.txt @@ -0,0 +1,6 @@ +// named.conf file fragment for the subdomain us.example.com + +zone "us.example.com" in{ + type master; + file "master.us.example.com"; +}; diff --git a/code/chapter08/F0804ZF.txt b/code/chapter08/F0804ZF.txt new file mode 100644 index 0000000..1fdb6a9 --- /dev/null +++ b/code/chapter08/F0804ZF.txt @@ -0,0 +1,29 @@ +; zone file for subdomain us.example.com +$TTL 2d ; zone default of 2 days +$ORIGIN us.example.com. + IN SOA ns3.us.example.com. hostmaster.us.example.com. ( + 2010121500 ; serial number + 2h ; refresh = 2 hours + 15m ; refresh retry = 15 minutes + 3w12h ; expiry = 3 weeks + 12 hours + 2h20m ; nx = 2 hours + 20 minutes + ) +; subdomain name servers + IN NS ns3.us.example.com. + IN NS ns1.example.com. ; see following notes +; subdomain mail server + IN MX 10 mail.us.example.com. +; preceding record could have been written as +; IN MX 10 mail +; A records for preceding name servers +ns3 IN A 10.10.0.24 +ns1.example.com. IN A 192.168.0.3 ; 'glue' record +; A record for preceding mail server +mail IN A 10.10.0.25 +; next record defines our ftp server +ftp IN A 10.10.0.28 +; the preceding record could have been written as +; ftp.us.example.com. A 10.10.0.24 if it's less confusing + +; other subdomain records + diff --git a/code/chapter08/F0805NS.txt b/code/chapter08/F0805NS.txt new file mode 100644 index 0000000..d450b06 --- /dev/null +++ b/code/chapter08/F0805NS.txt @@ -0,0 +1,6 @@ +// named.conf file fragment + +zone "example.com" in{ + type master; + file "master.example.com"; +}; diff --git a/code/chapter08/F0806ZF.txt b/code/chapter08/F0806ZF.txt new file mode 100644 index 0000000..4849b8d --- /dev/null +++ b/code/chapter08/F0806ZF.txt @@ -0,0 +1,36 @@ +; zone fragment for example.com +$TTL 2d ; zone TTL default = 2 days +$ORIGIN example.com. +@ IN SOA ns1.example.com. root.example.com. ( + 2010121500 ; serial number + 2h ; refresh = 2 hours + 15m ; refresh retry = 15 minutes + 3w12h ; expiry = 3 weeks + 12 hours + 2h20m ; nx = 2 hours + 20 minutes + ) +; main domain name servers + IN NS ns1.example.com. + IN NS ns2.example.com. +; mail servers for main domain + IN MX 10 mail.example.com. +; A records for preceding name servers +ns1 IN A 192.168.0.3 +ns2 IN A 192.168.0.4 +; A record for preceding mail servers +mail IN A 192.168.0.5 +; other domain-level hosts and services +bill IN A 192.168.0.6 +; subdomain definitions +$ORIGIN us.example.com. + IN MX 10 mail +; preceding record could have been written as +; us.example.com. IN MX 10 mail.us.example.com. +; A record for subdomain mail server +mail IN A 10.10.0.28 +; the preceding record could have been written as +; mail.us.example.com. A 10.10.0.28 if it's less confusing +ftp IN A 10.10.0.29 +; the preceding record could have been written as +; ftp.us.example.com. A 10.10.0.29 if it's less confusing +; other subdomain definitions as required +$ORIGIN uk.example.com. diff --git a/code/chapter08/F0807ZS.txt b/code/chapter08/F0807ZS.txt new file mode 100644 index 0000000..a2aedc6 --- /dev/null +++ b/code/chapter08/F0807ZS.txt @@ -0,0 +1,8 @@ +; fragment from zone file showing use of $INCLUDE +.... +; other domain-level hosts and services +bill IN A 192.168.0.5 +.... +; subdomain definitions +$INCLUDE sub.us.example.com +; other subdomain definitions as required diff --git a/code/chapter08/F0808ZS.txt b/code/chapter08/F0808ZS.txt new file mode 100644 index 0000000..d57ec55 --- /dev/null +++ b/code/chapter08/F0808ZS.txt @@ -0,0 +1,6 @@ +; zone file fragment + IN MX 10 mail.example.com. + IN MX 20 mail.example.net. +.... +mail IN A 192.168.0.4 +.... diff --git a/code/chapter08/F0809ZS.txt b/code/chapter08/F0809ZS.txt new file mode 100644 index 0000000..03d00c4 --- /dev/null +++ b/code/chapter08/F0809ZS.txt @@ -0,0 +1,32 @@ +; zone file fragment for example.net +$TTL 2d ; zone default TTL = 2 days +$ORIGIN 199.168.192.IN-ADDR.ARPA. +@ IN SOA ns1.example.net. hostmaster.example.net. ( + 2010121500 ; serial number + 2h ; refresh + 15m ; refresh retry + 2w ; expiry + 3h ; nx + ) + IN NS ns1.example.net. + IN NS ns2.example.net. +; definition of other IP address 0 - 63 +.... +; definition of our target 192.168.199.64/26 subnet +; name servers for subnet reverse map +64/26 IN NS ns1.example.com. +64/26 IN NS ns2.example.com. +; the preceding could have been written as +; 64/26.199.168.192.IN-ARDDR.ARPA. IN NS ns2.example.com. +; IPs addresses in the subnet - all need to be defined +; except 64 and 127 since they are the subnets multicast +; and broadcast addresses not hosts/nodes +65 IN CNAME 65.64/26.199.168.192.IN_ADDR.ARPA. ;qualified +66 IN CNAME 66.64/26 ;unqualified name +67 IN CNAME 67.64/26 +.... +125 IN CNAME 125.64/26 +126 IN CNAME 126.64/26 +; end of 192.168.199.64/26 subnet +..... +; other subnet definitions diff --git a/code/chapter08/F0810ZS.txt b/code/chapter08/F0810ZS.txt new file mode 100644 index 0000000..72653e1 --- /dev/null +++ b/code/chapter08/F0810ZS.txt @@ -0,0 +1,21 @@ +$TTL 2d ; zone default = 2 days +$ORIGIN 64/26.199.168.192.IN-ADDR.ARPA. +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2010121500 ; serial number + 2h ; refresh + 15m ; refresh retry + 2w ; expiry + 3h ; nx + ) + IN NS ns1.example.com. + IN NS ns2.example.com. +; IPs addresses in the subnet - all need to be defined +; except 64 and 127 since they are the subnets multicast +; and broadcast addresses not hosts/nodes +65 IN PTR fred.example.com. ;qualified +66 IN PTR joe.example.com. +67 IN PTR bill.example.com. +.... +125 IN PTR web.example.com. +126 IN PTR ftp.example.com. +; end of 192.168.23.64/26 subnet diff --git a/code/chapter08/F0811NS.txt b/code/chapter08/F0811NS.txt new file mode 100644 index 0000000..a43eedd --- /dev/null +++ b/code/chapter08/F0811NS.txt @@ -0,0 +1,6 @@ +// named.conf fragment at example.com +// revised reverse-map zone name +zone "64/26.199.168.192.IN-ADDR.ARPA" in{ + type master; + file "192.168.23.rev"; +}; diff --git a/code/chapter08/F0812ZS.txt b/code/chapter08/F0812ZS.txt new file mode 100644 index 0000000..1127a18 --- /dev/null +++ b/code/chapter08/F0812ZS.txt @@ -0,0 +1,9 @@ +; zone file fragment + IN MX 10 mail.example.com. + IN MX 10 mail1.example.com. + IN MX 10 mail2.example.com. +.... +mail IN A 192.168.0.4 +mail1 IN A 192.168.0.5 +mail2 IN A 192.168.0.6 + diff --git a/code/chapter08/F0813ZS.txt b/code/chapter08/F0813ZS.txt new file mode 100644 index 0000000..5feca45 --- /dev/null +++ b/code/chapter08/F0813ZS.txt @@ -0,0 +1,7 @@ +; zone file fragment + IN MX 10 mail.example.com. +.... +mail IN A 192.168.0.4 + IN A 192.168.0.5 + IN A 192.168.0.6 + diff --git a/code/chapter08/F0814ZS.txt b/code/chapter08/F0814ZS.txt new file mode 100644 index 0000000..60e2019 --- /dev/null +++ b/code/chapter08/F0814ZS.txt @@ -0,0 +1,7 @@ +; reverse-map file fragment +; for 0.168.192.IN-ADDR.ARPA +.... +4 PTR mail.example.com. +5 PTR mail.example.com. +6 PTR mail.example.com. + diff --git a/code/chapter08/F0815ZS.txt b/code/chapter08/F0815ZS.txt new file mode 100644 index 0000000..64bb919 --- /dev/null +++ b/code/chapter08/F0815ZS.txt @@ -0,0 +1,8 @@ +; example.com zone file fragment +.... +ftp IN A 192.168.0.4 +ftp IN A 192.168.0.5 +ftp IN A 192.168.0.6 +www IN A 192.168.0.7 +www IN A 192.168.0.8 + diff --git a/code/chapter08/F0816ZS.txt b/code/chapter08/F0816ZS.txt new file mode 100644 index 0000000..32367da --- /dev/null +++ b/code/chapter08/F0816ZS.txt @@ -0,0 +1,9 @@ +; example.com zone file fragment +.... + +ftp IN A 192.168.0.4 + IN A 192.168.0.5 + IN A 192.168.0.6 +www IN A 192.168.0.7 + IN A 192.168.0.8 + diff --git a/code/chapter08/F0817NS.txt b/code/chapter08/F0817NS.txt new file mode 100644 index 0000000..0698c1e --- /dev/null +++ b/code/chapter08/F0817NS.txt @@ -0,0 +1,6 @@ +// named.conf fragment +options { +// other options + rrset-order {order cyclic;}; +}; + diff --git a/code/chapter08/F0818ZS.txt b/code/chapter08/F0818ZS.txt new file mode 100644 index 0000000..1c14454 --- /dev/null +++ b/code/chapter08/F0818ZS.txt @@ -0,0 +1,6 @@ +; zone file fragment for example.com + MX 10 mail1.example.com. + MX 10 mail2.example.com. + MX 20 mail3.example.com. + + diff --git a/code/chapter08/F0819ZS.txt b/code/chapter08/F0819ZS.txt new file mode 100644 index 0000000..d557efc --- /dev/null +++ b/code/chapter08/F0819ZS.txt @@ -0,0 +1,15 @@ +; zone file fragment for example.com + IN MX 10 mail.example.com. +.... +mail IN A 192.168.0.4 +; SPF records +; domain SPF +example.com. IN TXT "v=spf1 mx -all" +; AND if supported +example.com. IN SPF "v=spf1 mx -all" +; mail host SPF +mail IN TXT "v=spf1 a -all" +; AND if supported +mail IN SPF "v=spf1 a -all" + + diff --git a/code/chapter08/F0820ZS.txt b/code/chapter08/F0820ZS.txt new file mode 100644 index 0000000..24b146b --- /dev/null +++ b/code/chapter08/F0820ZS.txt @@ -0,0 +1,7 @@ +; zone fragment for example.com +$ORIGIN example.com. +... +@ IN A 192.168.0.2 + IN TXT "v=spf1 a -all" +.... + diff --git a/code/chapter08/F0821ZS.txt b/code/chapter08/F0821ZS.txt new file mode 100644 index 0000000..d85d7f5 --- /dev/null +++ b/code/chapter08/F0821ZS.txt @@ -0,0 +1,8 @@ +; zone fragment for example.com +$ORIGIN example.com. +... +@ IN A 192.168.0.2 + IN TXT "v=spf1 +exists -all" +.... + + diff --git a/code/chapter08/F0822ZS.txt b/code/chapter08/F0822ZS.txt new file mode 100644 index 0000000..b927a43 --- /dev/null +++ b/code/chapter08/F0822ZS.txt @@ -0,0 +1,18 @@ +; zone file fragment for example.com +$ORIGIN example.com. +…. + IN MX 10 mail.example.com. +.... +mail IN A 192.168.0.4 +; SPF records +; domain SPF +@ IN TXT "v=spf1 mx -all" +; AND if supported +@ IN SPF "v=spf1 mx -all" +; mail host SPF +mail IN TXT "v=spf1 a -all" +; AND if supported +mail IN SPF "v=spf1 a -all" + + + diff --git a/code/chapter08/F0823ZS.txt b/code/chapter08/F0823ZS.txt new file mode 100644 index 0000000..ec1a62f --- /dev/null +++ b/code/chapter08/F0823ZS.txt @@ -0,0 +1,13 @@ +; zone file fragment for example.com +$ORIGIN example.com. +…. + IN MX 10 mail.example.net. +.... +; SPF records +; domain SPF +@ IN TXT "v=spf1 include:example.net -all" +; AND if supported +@ IN SPF "v=spf1 include:example.net -all" +; WARNING: offsite.com MUST have a valid SPF definition + + diff --git a/code/chapter08/F0824ZS.txt b/code/chapter08/F0824ZS.txt new file mode 100644 index 0000000..ce41efa --- /dev/null +++ b/code/chapter08/F0824ZS.txt @@ -0,0 +1,13 @@ +; zone file fragment for example.com +$ORIGIN example.com. +…. + IN MX 10 mail.example.net. +.... +; SPF records +; domain SPF +@ IN TXT "v=spf1 include:example.net -all" +; AND if supported +@ IN SPF "v=spf1 include:example.net -all" + + + diff --git a/code/chapter08/F0825ZS.txt b/code/chapter08/F0825ZS.txt new file mode 100644 index 0000000..b064a7f --- /dev/null +++ b/code/chapter08/F0825ZS.txt @@ -0,0 +1,20 @@ +; zone file fragment for example.net +$ORIGIN example.net. +…. + IN MX 10 mail.example.net. +.... +mail IN A 192.168.0.37 +; SPF records +; domain SPF - any host from +; 192.168.0.32 to 192.168.0.63 can send mail +; and any MX host +@ IN TXT "v=spf1 ip4:192.168.0.37/27 mx -all" +; AND if supported +@ IN SPF "v=spf1 ip4:192.168.0.37/27 mx -all" +; mail SPF +mail IN TXT "v=spf1 a -all" +; AND if supported +mail IN SPF "v=spf1 a -all" + + + diff --git a/code/chapter08/F0826ZS.txt b/code/chapter08/F0826ZS.txt new file mode 100644 index 0000000..0f738a4 --- /dev/null +++ b/code/chapter08/F0826ZS.txt @@ -0,0 +1,12 @@ +; zone file fragment for example.org +; zone does NOT contain MX record(s) +$ORIGIN example.org. +... +; SPF records +; domain SPF +@ IN TXT "v=spf1 -all" +; AND if supported +@ IN SPF "v=spf1 -all" + + + diff --git a/code/chapter08/F0827ZS.txt b/code/chapter08/F0827ZS.txt new file mode 100644 index 0000000..e4d0337 --- /dev/null +++ b/code/chapter08/F0827ZS.txt @@ -0,0 +1,12 @@ +; zone file fragment for example.com +$ORIGIN example.org. + IN MX 10 mail.example.com. +.... +; SPF records +; domain SPF +@ IN TXT "v=spf1 exists:%(d) -all ext=badguy.example.com" +; AND if supported +@ IN SPF "v=spf1 exists:%(d) -all ext=badguy.example.com" +badguy IN TXT "The email from %{s} using SMTP server at %{I} was rejected by %{c} (%{r}) at %{t} because it failed the SPF records check for the domain %{p}. Please visit http://abuse.example.com/badguys.html for more information" + + diff --git a/code/chapter08/F0828ZS.txt b/code/chapter08/F0828ZS.txt new file mode 100644 index 0000000..c96ab0b --- /dev/null +++ b/code/chapter08/F0828ZS.txt @@ -0,0 +1,17 @@ +; zone fragment for example.com +$TTL 2d ; zone ttl default = 2 days +$ORIGIN example.com. +.... +; SOA NS MX and other records + +; define an IP that will resolve example.com +@ IN A 192.168.0.3 +; you could also write the preceding line as +; example.com. IN A 192.168.0.3 +www IN CNAME example.com. ; dot essential +; aliases www.example.com to example.com +; OR define another A record for www using same host +; this is the least number of changes and saves a CNAME +www IN A 192.168.0.3 + + diff --git a/code/chapter08/F0829ZS.txt b/code/chapter08/F0829ZS.txt new file mode 100644 index 0000000..c9cc996 --- /dev/null +++ b/code/chapter08/F0829ZS.txt @@ -0,0 +1,15 @@ +; zone example.com fragment +$ORIGIN example.com. +... +; DKIM TXT RR +mail._domainkey IN TXT "v=DKIM1;t=s;p=blah....blah;" +; ADSP TXT RR +_adsp._domainkey IN TXT "dkim=discardable;" +; OR, if you like typing you could have written +mail._domainkey.example.com. IN TXT "v=DKIM1;t=s;p=blah....blah;" +_adsp._domainkey.example.com. IN TXT "dkim=discardable;" +; OR, using an $ORIGIN +$ORIGIN _domainkey +mail IN TXT "v=DKIM1;t=s;p=blah....blah;" +_adsp IN TXT "dkim=discardable;" +; if RRs appear below, $ORIGIN may have to be set to a new value diff --git a/code/chapter08/F0830ZS.txt b/code/chapter08/F0830ZS.txt new file mode 100644 index 0000000..bb70411 --- /dev/null +++ b/code/chapter08/F0830ZS.txt @@ -0,0 +1,14 @@ +; zone example.com fragment +$ORIGIN example.com. +... +;DKIM TXT RR +hope._domainkey IN TXT "v=DKIM1;t=y;p=blah....blah;" +; ADSP TXT RR +_adsp._domainkey IN TXT "dkim=unknown;" +; OR, if you like typing you could have written +hope._domainkey.example.com. IN TXT "v=DKIM1;t=y;p=blah....blah;" +_adsp._domainkey.example.com. IN TXT "dkim=unknown;" +; OR, using an $ORIGIN +$ORIGIN _domainkey +hope IN TXT "v=DKIM1;t=y;p=blah....blah;" +_adsp IN TXT "dkim=unknown;" diff --git a/code/chapter08/F0831ZS.txt b/code/chapter08/F0831ZS.txt new file mode 100644 index 0000000..c4dadee --- /dev/null +++ b/code/chapter08/F0831ZS.txt @@ -0,0 +1,26 @@ +; zone example.com fragment +$ORIGIN example.com. +... +; DKIM TXT RR +; DKIM and ADSP TXT RR for main domain +domain._domainkey IN TXT "v=DKIM1;t=s;p=blah....blah;" +; ADSP TXT RR +_adsp.domainkey IN TXT "dkim=unknown;" +…. +; DKIM and ADSP for secure subdomain +; DKIM TXT RR +internal._domainkey.secure IN TXT "v=DKIM1;t=s;p=blah....blah;" +; ADSP TXT RR +_adsp._domainkey.secure IN TXT "dkim=discardable;" +; OR, using an $ORIGIN +$ORIGIN _domainkey.secure +internal IN TXT "v=DKIM1;t=s;p=blah....blah;" +_adsp IN TXT "dkim=discardable;" +; if RRs appear below, $ORIGIN may have to be set to anew value +…. +; ADSP for maillist subdomain +; ADSP TXT RR +_adsp._domainkey.maillist IN TXT "dkim=discardable;" +; OR, using an $ORIGIN +$ORIGIN _domainkey.maillist +_adsp IN TXT "dkim=discardable;" diff --git a/code/chapter08/F0832AS.txt b/code/chapter08/F0832AS.txt new file mode 100644 index 0000000..2f88788 --- /dev/null +++ b/code/chapter08/F0832AS.txt @@ -0,0 +1,9 @@ + + ServerAdmin webmaster@example.com + DocumentRoot /path/to/web/root + ServerName www.example.com + ErrorLog logs/www.example.err + CustomLog logs/www.example.log common + + + diff --git a/code/chapter08/F0833AS.txt b/code/chapter08/F0833AS.txt new file mode 100644 index 0000000..3011172 --- /dev/null +++ b/code/chapter08/F0833AS.txt @@ -0,0 +1,9 @@ + + ServerAdmin webmaster@example.com + DocumentRoot /path/to/web/root + ServerName example.com + ErrorLog logs/example.err + CustomLog logs/example.log common + + + diff --git a/code/chapter08/F0834AS.txt b/code/chapter08/F0834AS.txt new file mode 100644 index 0000000..d174122 --- /dev/null +++ b/code/chapter08/F0834AS.txt @@ -0,0 +1,11 @@ + + ServerAdmin webmaster@example.com + DocumentRoot /path/to/web/root + ServerName www.example.com + ServerAlias example.com + ErrorLog logs/example.err + CustomLog logs/example.log common + + + + diff --git a/code/chapter08/F0835ZS.txt b/code/chapter08/F0835ZS.txt new file mode 100644 index 0000000..950375b --- /dev/null +++ b/code/chapter08/F0835ZS.txt @@ -0,0 +1,8 @@ +; zone file for example.com +$TTL 2d ; zone default = 2 days +$ORIGIN example.com. +@ IN MX 10 mail.example.com. +* IN MX 10 mail.example.com. +subdomain IN MX 10 mail.example.net. + + diff --git a/code/chapter08/F0836ZS.txt b/code/chapter08/F0836ZS.txt new file mode 100644 index 0000000..736f34b --- /dev/null +++ b/code/chapter08/F0836ZS.txt @@ -0,0 +1,7 @@ +; zone file for example.com +$TTL 2d ; zone default = 2 days +$ORIGIN example.com. +@ IN MX 10 mail.example.com. +* IN MX 10 mail.example.com. + + diff --git a/code/chapter08/F0837ZF.txt b/code/chapter08/F0837ZF.txt new file mode 100644 index 0000000..d052ca9 --- /dev/null +++ b/code/chapter08/F0837ZF.txt @@ -0,0 +1,4 @@ +$TTL 86400 ; 24 hours +@ IN SOA @ hostmaster (2010020800 12h 15m 1w 3h) +@ IN NS localhost. +1.0.0 IN PTR localhost. diff --git a/code/chapter08/F0838NS.txt b/code/chapter08/F0838NS.txt new file mode 100644 index 0000000..5e1d7d2 --- /dev/null +++ b/code/chapter08/F0838NS.txt @@ -0,0 +1,8 @@ +// named.conf fragment +… +zone "127.IN-ADDR.ARPA" in{ // IPv4 reverse loopback + … +} +zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA" in{ // IPv6 reverse loopback + … +} diff --git a/code/chapter08/F0839NS.htm b/code/chapter08/F0839NS.htm new file mode 100644 index 0000000..473419c --- /dev/null +++ b/code/chapter08/F0839NS.htm @@ -0,0 +1,34 @@ +// View based geographic name server for EXAMPLE, INC. +// global options +options { + … + recursion no; // authoritative only +}; +… +// map service to geographic origination +view "gondor" { + match-clients { 172.15/16; 172.14/16; }; // originate in gondor + zone "example.com" { + type master; + // zone file will return www.example.com = 172.2.1.1 + file "view/gondor.example.com"; + … + }; +}; // end view +view "mordor" { + match-clients { 172.16/16; }; // originate in mordor + zone "example.com" { + type master; + // zone file will return www.example.com = 172.1.1.1 + file "view/mordor.example.com "; + … + }; +}; // end view + +// default for everything else lies outside views + zone "example.com" { + type master; + // zone file will return www.example.com = 192.168.1.2 + file "view/master.example.com"; + … + }; diff --git a/code/chapter08/F0840NS.htm b/code/chapter08/F0840NS.htm new file mode 100644 index 0000000..eb1b4cd --- /dev/null +++ b/code/chapter08/F0840NS.htm @@ -0,0 +1,9 @@ +// default for everything else lies in a default view +view "default" + match-clients { "any"; }; // must be in the last clause + zone "example.com" { + type master; + // zone file will return www.example.= 192.168.1.2 + file "view/master.example.com.default"; + }; +}; diff --git a/code/chapter08/F0841ZS.htm b/code/chapter08/F0841ZS.htm new file mode 100644 index 0000000..dac6bef --- /dev/null +++ b/code/chapter08/F0841ZS.htm @@ -0,0 +1,23 @@ +$TTL 2d # default RR TTL +$ORIGIN blacklist.example.com + IN SOA ns1.example.com. hostmaster.example.com.( + 2010080800 ; sn = serial number + 3h ; refresh + 15m ; retry = refresh retry + 3w ; expiry + 3h ; nx= nxdomain ttl + ) + IN NS ns1.example.com. + IN NS ns2.example.com. +# black list records - using origin substitution rule +# order not important other than for local usage reasons +# by convention this address should be listed to allow for external testing +2.0.0.127 IN A 127.0.0.2 +# black list RRs +135.2.168.192 IN A 127.0.0.2 # presence result + IN A 127.0.0.5 # optional reason/result code + IN TXT "Optional - Some explanation for black listing" +# the above entries expand to 135.2.168.192.blacklist.example.com +... +135.17.168.192 IN A 127.0.0.2 # presence result +... diff --git a/code/chapter08/F0842NS.htm b/code/chapter08/F0842NS.htm new file mode 100644 index 0000000..922a063 --- /dev/null +++ b/code/chapter08/F0842NS.htm @@ -0,0 +1,8 @@ +// local named.conf +… +zone "blacklist.example.com"{ + type slave; + file "slave/blacklist.example.com" + masters {192.168.2.23;}; + notify no; // inhibits notify propagation +} diff --git a/code/chapter09/F0901DS.txt b/code/chapter09/F0901DS.txt new file mode 100644 index 0000000..ad23cb4 --- /dev/null +++ b/code/chapter09/F0901DS.txt @@ -0,0 +1,8 @@ +// rndc.conf fragment +options { + default-server 127.0.0.1; + default-key "my-key"; + default-port 3346; +}; + + diff --git a/code/chapter09/F0902DS.txt b/code/chapter09/F0902DS.txt new file mode 100644 index 0000000..9260bab --- /dev/null +++ b/code/chapter09/F0902DS.txt @@ -0,0 +1,8 @@ +// rndc.conf fragment +server "ns1.example.net" { + key "ns1.example.net"; + port 953; +}; + + + diff --git a/code/chapter09/F0903DS.txt b/code/chapter09/F0903DS.txt new file mode 100644 index 0000000..ecc579b --- /dev/null +++ b/code/chapter09/F0903DS.txt @@ -0,0 +1,9 @@ +// rndc.conf file fragment +key "ns1.example.net" { + algorithm hmac-md5; + secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K"; +}; + + + + diff --git a/code/chapter09/F0904DF.txt b/code/chapter09/F0904DF.txt new file mode 100644 index 0000000..e0f3977 --- /dev/null +++ b/code/chapter09/F0904DF.txt @@ -0,0 +1,28 @@ +# Start of rndc.conf +key "ns1.example.com" { + algorithm hmac-md5; + secret "tRNNxQ240B7Gwc/XhS+VLQ=="; +}; + +options { + default-key "ns1.example.com"; + default-server 192.168.2.3; + default-port 3396; +}; +# End of rndc.conf + +# Use with the following in named.conf, adjusting the allow list as needed: +# key "ns1.example.com" { +# algorithm hmac-md5; +# secret "tRNNxQ240B7Gwc/XhS+VLQ=="; +# }; +# +# controls { +# inet 192.168.2.3 port 3396 +# allow { 192.168.2.3; } keys { "ns1.example.com"; }; +# }; +# End of named.conf + + + + diff --git a/code/chapter09/F0905DF.txt b/code/chapter09/F0905DF.txt new file mode 100644 index 0000000..2569dc7 --- /dev/null +++ b/code/chapter09/F0905DF.txt @@ -0,0 +1,49 @@ +# Start of rndc.conf +key "ns1.example.com" { + algorithm hmac-md5; + secret "tRNNxQ240B7Gwc/XhS+VLQ=="; +}; + +options { + default-key "ns1.example.com"; + default-server 192.168.2.3; + default-port 3396; +}; +# End of rndc.conf + +# Use with the following in named.conf, adjusting the allow list as needed: +# key "ns1.example.com" { +# algorithm hmac-md5; +# secret "tRNNxQ240B7Gwc/XhS+VLQ=="; +# }; +# +# controls { +# inet 192.168.2.3 port 3396 +# allow { 192.168.2.3; } keys { "ns1.example.com"; }; +# }; +# End of named.conf + +// start of second (appended) rndc.conf file +# Start of rndc.conf +key "ns2.example.com" { + algorithm hmac-md5; + secret "oSbqEQ7KVw3PZlisH+g/XQ=="; +}; +options { + default-key "ns2.example.com"; + default-server 192.168.2.4; + default-port 953; +}; +# End of rndc.conf + +# Use with the following in named.conf, adjusting the allow list as needed: +# key "ns2.example.com" { +# algorithm hmac-md5; +# secret "oSbqEQ7KVw3PZlisH+g/XQ=="; +# }; +# +# controls { +# inet 192.168.2.4 port 953 +# allow { 192.168.2.4; } keys { "ns2.example.com"; }; +# }; +# End of named.conf diff --git a/code/chapter09/F0906DF.txt b/code/chapter09/F0906DF.txt new file mode 100644 index 0000000..fcb492c --- /dev/null +++ b/code/chapter09/F0906DF.txt @@ -0,0 +1,50 @@ +# Start of rndc.conf +key "ns1.example.com" { + algorithm hmac-md5; + secret "tRNNxQ240B7Gwc/XhS+VLQ=="; +}; +// moved ns2.example.com key clause +key "ns2.example.com" { + algorithm hmac-md5; + secret "oSbqEQ7KVw3PZlisH+g/XQ=="; +}; + +options { + default-key "ns1.example.com"; + default-server 192.168.2.3; + default-port 3396; +}; +server ns2.example.com { + key ns2.example.com; + port 953; // required because of default-port in options clause +}; +# End of rndc.conf + +# Use with the following in named.conf, adjusting the allow list as needed: +# key "ns1.example.com" { +# algorithm hmac-md5; +# secret "tRNNxQ240B7Gwc/XhS+VLQ=="; +# }; +# +# controls { +# inet 192.168.2.3 port 3396 +# allow { 192.168.2.3; } keys { "ns1.example.com"; }; +# }; +# End of named.conf + +// start of second (appended) rndc.conf file +# Start of rndc.conf +// deleted second options clause +# End of rndc.conf + +# Use with the following in named.conf, adjusting the allow list as needed: +# key "ns2.example.com" { +# algorithm hmac-md5; +# secret "oSbqEQ7KVw3PZlisH+g/XQ=="; +# }; +# +# controls { +# inet 192.168.2.4 port 953 +# allow { 192.168.2.4; } keys { "ns2.example.com"; }; +# }; +# End of named.conf diff --git a/code/chapter09/F0907NS.txt b/code/chapter09/F0907NS.txt new file mode 100644 index 0000000..a374d2f --- /dev/null +++ b/code/chapter09/F0907NS.txt @@ -0,0 +1,13 @@ +logging { + .... + channel example-update { + file "/var/log/named/update.log" versions 3 size 1m; + severity info; + print-time yes; + print-severity yes; + print-category yes; + }; + category update{ + example-update; + }; +}; diff --git a/code/chapter10/F1001NS.txt b/code/chapter10/F1001NS.txt new file mode 100644 index 0000000..6c08ab6 --- /dev/null +++ b/code/chapter10/F1001NS.txt @@ -0,0 +1,11 @@ +options { +.... + allow-update {none;}; // no DDNS by default +.... +}; +.... +zone "example.com in{ +.... + allow-update {10.0.1.2;}; // DDNS this host only +.... +}; diff --git a/code/chapter10/F1002NS.txt b/code/chapter10/F1002NS.txt new file mode 100644 index 0000000..51bb28b --- /dev/null +++ b/code/chapter10/F1002NS.txt @@ -0,0 +1,4 @@ +// named.conf fragment +controls {}; +.... + diff --git a/code/chapter10/F1003NS.txt b/code/chapter10/F1003NS.txt new file mode 100644 index 0000000..fdf957f --- /dev/null +++ b/code/chapter10/F1003NS.txt @@ -0,0 +1,5 @@ +// named.conf fragment +controls { + inet 127.0.0.1 allow {localhost;} keys {"rndc-key"}; +}; + diff --git a/code/chapter10/F1004NS.txt b/code/chapter10/F1004NS.txt new file mode 100644 index 0000000..99d5a47 --- /dev/null +++ b/code/chapter10/F1004NS.txt @@ -0,0 +1,22 @@ +// named.conf fragment +include "/var/named/rndc/keys/key.clause"; // single file containing keys +include "/var/named/keys/key.clauses"; // single file containing keys +controls { + inet 127.0.0.1 allow {localhost;} keys {"rndc-key"}; +}; +options { + .... +}; +include "/var/named/views/private-view.clause"; // hidden private view +view "public-view" { + include "/home/firstuser/zone.clause"; + zone "example.com" in { + type master; + file "var/named/masters/ddns/example.net"; + // key clause referenced below will be in + // /var/named/keys/keys.clause above + allow-update {key "example.net";}; + }; +}; + + diff --git a/code/chapter10/F1005SF.txt b/code/chapter10/F1005SF.txt new file mode 100644 index 0000000..fc68607 --- /dev/null +++ b/code/chapter10/F1005SF.txt @@ -0,0 +1,45 @@ +#!/bin/sh +# +# named This shell script takes care of starting and stopping +# named under its own (non-root) UID. +# + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 0 + +[ -f /usr/sbin/named ] || exit 0 + +# See how we were called. +case "$1" in + start) + # Start daemons. + echo -n "Starting named: " + daemon /usr/sbin/named -u named + echo + ;; + stop) + # Stop daemons. + echo -n "Shutting down named: " + killproc named + echo + ;; + restart) + $0 stop + $0 start + exit $? + ;; + *) + echo "Usage: named {start|stop|restart}" + exit 1 +esac + +exit 0 + + + diff --git a/code/chapter10/F1006NS.txt b/code/chapter10/F1006NS.txt new file mode 100644 index 0000000..a1940eb --- /dev/null +++ b/code/chapter10/F1006NS.txt @@ -0,0 +1,9 @@ +logging{ + channel normal_log { + file "/var/log/named/normal.log" versions 3 size 2m; + severity error; + print-time yes; + print-severity yes; + print-category yes; + }; +.... diff --git a/code/chapter10/F1007RS.txt b/code/chapter10/F1007RS.txt new file mode 100644 index 0000000..dabc50c --- /dev/null +++ b/code/chapter10/F1007RS.txt @@ -0,0 +1,13 @@ +# +# named. It may be possible to run named in a sandbox, man security for +# details. +# +named_enable="YES" # Run named, the DNS server (or NO). +named_program="/usr/sbin/named" # path to named, if you want a different one. +named_flags="-u bind" # Flags for named +named_pidfile="/var/run/named/pid" # Must set this in named.conf as well +named_chrootdir="/var/named" # Chroot directory (or "" not to auto-chroot it) +named_chroot_autoupdate="YES" # Automatically install/update chrooted + # components of named. See /etc/rc.d/named. +named_symlink_enable="YES" # Symlink the chrooted pid file + diff --git a/code/chapter10/F1008NF.txt b/code/chapter10/F1008NF.txt new file mode 100644 index 0000000..deae5d3 --- /dev/null +++ b/code/chapter10/F1008NF.txt @@ -0,0 +1,53 @@ +// Caching Name Server for Example.com. +// We recommend that you always maintain a change log in this file as shown below +// CHANGELOG: +// 1. 9 july 2005 INITIALS or NAME +// a. did something +// a. 23 july 2005 INITIALS or NAME +// a. did something more +// b. another change +// +options { + // all relative paths use this directory as a base + directory "/var/named"; + // version statement for security to avoid hacking known weaknesses + // if the real version number is published + version "not currently available"; + // configuration specific option clause statements + // disables all zone transfer requests + allow-transfer{"none"}; + // optional - BIND default behavior is recursion + recursion yes; +}; +// +// log to /var/log/example.log all events from info UP in severity (no debug) +// defaults to use 3 files in rotation +// failure messages up to this point are in (syslog) /var/log/messages +// + logging{ + channel example_log{ + file "/var/log/named/example.log" versions 3 size 250k; + severity info; + }; + category default{ + example_log; + }; +}; +// required zone for recursive queries +zone "." { + type hint; + file "root.servers"; +}; +// required local host domain +zone "localhost" in{ + type master; + file "master.localhost"; + allow-update{none;}; +}; +// localhost reverse map +zone "0.0.127.in-addr.arpa" in{ + type master; + file "localhost.rev"; + allow-update{none;}; +}; + diff --git a/code/chapter10/F1009NS.txt b/code/chapter10/F1009NS.txt new file mode 100644 index 0000000..4a8e5fd --- /dev/null +++ b/code/chapter10/F1009NS.txt @@ -0,0 +1,24 @@ +// named.conf fragment +logging{ + channel normal_log { + file "/var/log/named/normal.log" versions 3 size 2m; + severity error; + print-time yes; + print-severity yes; + print-category yes; + }; + channel security_log { // streamed security log + file "/var/log/named/security.log" versions 3 size 500k; + severity info; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + normal_log; + }; + category security{ + security_log; + }; +}; +.... diff --git a/code/chapter10/F1010NS.txt b/code/chapter10/F1010NS.txt new file mode 100644 index 0000000..a13cf1d --- /dev/null +++ b/code/chapter10/F1010NS.txt @@ -0,0 +1,34 @@ +// named.conf fragment +logging{ + channel normal_log { + file "/var/log/named/normal.log" versions 3 size 2m; + severity error; + print-time yes; + print-severity yes; + print-category yes; + }; + channel security_log { // streamed security log + file "/var/log/named/security.log" versions 3 size 2m; + severity info; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + normal_log; + }; + category security{ + security_log; + }; +}; +options { +.... + allow-transfer {none;}; // none by default +.... +}; +.... +zone "example.com in{ +.... + allow-transfer {10.1.2.5;}; // this zone only +.... +}; diff --git a/code/chapter10/F1011NS.txt b/code/chapter10/F1011NS.txt new file mode 100644 index 0000000..28a42a1 --- /dev/null +++ b/code/chapter10/F1011NS.txt @@ -0,0 +1,4 @@ +key "example.com" ( + alogorithm hmac-md5; + secret JuxDyYXIJhAia5WQe9oqUA==; +}; diff --git a/code/chapter10/F1012NS.txt b/code/chapter10/F1012NS.txt new file mode 100644 index 0000000..e629d24 --- /dev/null +++ b/code/chapter10/F1012NS.txt @@ -0,0 +1,44 @@ +// named.conf example.com master fragment +logging{ + channel normal_log { + file "/var/log/named/normal.log" versions 3 size 2m; + severity error; + print-time yes; + print-severity yes; + print-category yes; + }; + channel dnssec_log { // streamed dnssec log + file "/var/log/named/dnssec.log" versions 3 size 2m; + severity debug 3; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + normal_log; + }; + category dnssec{ + dnssec_log; + }; +}; +options { + .... + directory "/var/named"; + dnssec-enable yes; + .... +}; +// include the key clause for example.com key name +include "keys/example.com.key"; // include the key clause +// server clause references the key clause included above +server 10.1.2.3 { + keys {"example.com";}; // name used in key clause +}; +.... +zone "example.com" in{ + type master; + file "master.example.com"; + // allow transfer only if key (TSIG) present + allow-transfer {key "example.com";}; +}; +.... + diff --git a/code/chapter10/F1013NS.txt b/code/chapter10/F1013NS.txt new file mode 100644 index 0000000..e554744 --- /dev/null +++ b/code/chapter10/F1013NS.txt @@ -0,0 +1,17 @@ +// named.conf example.com slave fragment +options { + .... + directory "/var/named"; + dnssec-enable yes; + .... +}; +include "keys/example.com.key"; // include the key clause +server 10.1.2.5 { + keys {"example.com";}; // name used in key clause +}; +.... +zone "example.com" in{ + type slave; + file "slave.example.com"; + masters {10.1.2.5;}; +}; diff --git a/code/chapter10/F1014NS.txt b/code/chapter10/F1014NS.txt new file mode 100644 index 0000000..b54c768 --- /dev/null +++ b/code/chapter10/F1014NS.txt @@ -0,0 +1,34 @@ +// named.conf fragment +logging{ + channel normal_log { + file "/var/log/named/normal.log" versions 3 size 2m; + severity error; + print-time yes; + print-severity yes; + print-category yes; + }; + channel security_log { // streamed security log + file "/var/log/named/security.log" versions 3 size 2m; + severity info; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + normal_log; + }; + category security{ + security_log; + }; +}; +options { +.... + allow-update {none;}; // none by default +.... +}; +.... +zone "example.com in{ +.... + allow-update {10.1.2.5;}; // this zone only +.... +}; diff --git a/code/chapter10/F1015NS.txt b/code/chapter10/F1015NS.txt new file mode 100644 index 0000000..6cfafaf --- /dev/null +++ b/code/chapter10/F1015NS.txt @@ -0,0 +1,48 @@ +// named.conf example.com master fragment +logging{ + channel normal_log { + file "/var/log/named/normal.log" versions 3 size 2m; + severity error; + print-time yes; + print-severity yes; + print-category yes; + }; + channel dnssec_log { // streamed dnssec log + file "/var/log/named/dnssec.log" versions 3 size 2m; + severity debug 3; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + normal_log; + }; + category dnssec{ + dnssec_log; + }; +}; +options { + .... + directory "/var/named"; + dnssec-enable yes; // default and could be omitted + .... +}; +include "keys/example.com.key"; // include the key clause +server 10.1.2.3 { + keys {"example.com";}; // name used in key clause +}; +.... +zone "example.com" in{ + type master; + file "master.example.com"; + allow-update {key "example.com";}; +}; +.... +zone "example.net" in{ + type master; + file "master.example.net"; + update-policy { grant example.com subdomain example.net ANY;}; + update-policy { grant * self * A;}; + update-policy { grant update-mx name example.net MX;}; +}; +.... diff --git a/code/chapter10/F1016NS.txt b/code/chapter10/F1016NS.txt new file mode 100644 index 0000000..798b658 --- /dev/null +++ b/code/chapter10/F1016NS.txt @@ -0,0 +1,4 @@ +key "update-mx" ( + alogorithm hmac-md5; + secret 7aBDy3XIJhA775WQ4FoqUA==; +}; diff --git a/code/chapter10/F1017ZS.txt b/code/chapter10/F1017ZS.txt new file mode 100644 index 0000000..4fb58e6 --- /dev/null +++ b/code/chapter10/F1017ZS.txt @@ -0,0 +1,7 @@ +; example.com zone file fragment +$TTL 2d ; zone TTL default of 2 days +$ORIGIN example.com. +.... +$INCLUDE keys/Kupdate.example.com.+001+00706.key +.... + diff --git a/code/chapter10/F1018NS.txt b/code/chapter10/F1018NS.txt new file mode 100644 index 0000000..ce63222 --- /dev/null +++ b/code/chapter10/F1018NS.txt @@ -0,0 +1,35 @@ +// named.conf fragment +logging{ + channel normal_log { + file "/var/log/named/normal.log" versions 3 size 2m; + severity error; + print-time yes; + print-severity yes; + print-category yes; + }; + channel dnssec_log { // streamed dnssec log + file "/var/log/named/dnssec.log" versions 3 size 2m; + severity debug 3; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + normal_log; + }; + category dnssec{ + dnssec_log; + }; +}; +options { + .... + directory "/var/named"; + dnssec-enable yes; // default and could be omitted + .... +}; +.... +zone "example.com" IN{ + type master; + file master.example.com; + update-policy {grant update.example.com subdomain example.com ANY}; +}; diff --git a/code/chapter10/F1019ZS.txt b/code/chapter10/F1019ZS.txt new file mode 100644 index 0000000..514fcc2 --- /dev/null +++ b/code/chapter10/F1019ZS.txt @@ -0,0 +1,11 @@ +; example.com zone file fragment +$TTL 2d ; zone TTL default of 2 days +$ORIGIN example.com. +.... +bill IN A 192.168.2.3 + IN TXT "one fine day" + IN RP bill.example.com. +fred IN A 192.168.2.4 + IN RP fred.example.com. + IN AAAA 2001:db8::15 +.... diff --git a/code/chapter10/F1020ZS.txt b/code/chapter10/F1020ZS.txt new file mode 100644 index 0000000..6fd4e5e --- /dev/null +++ b/code/chapter10/F1020ZS.txt @@ -0,0 +1,14 @@ +; example.com zone file fragment +$TTL 2d ; zone TTL default of 2 days +$ORIGIN example.com. +.... +bill IN A 192.168.2.3 + IN TXT "one fine day" + IN RP bill.example.com. . +$INCLUDE keys/Kbill.example.com.+001+77325.key ; bill KEY RR +fred IN A 192.168.2.4 + IN RP fred.example.com. . + IN AAAA 2001:db8::15 +$INCLUDE keys/Kfred.example.com.+001+08634.key ; fred KEY RR +.... + diff --git a/code/chapter11/F1101ZF.txt b/code/chapter11/F1101ZF.txt new file mode 100644 index 0000000..ff0ec4c --- /dev/null +++ b/code/chapter11/F1101ZF.txt @@ -0,0 +1,50 @@ +$TTL 86400 ; 1 day +$ORIGIN example.com. +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2010121500 ; serial +43200 ; refresh (12 hours) + 600 ; retry (10 minutes) + 604800 ; expire (1 week) + 10800 ; nx (3 hours) + ) + IN NS ns1.example.com. + IN NS ns2.example.com. + IN MX 10 mail.example.com. + IN MX 10 mail1.example.com. +_ldap._tcp IN SRV 5 2 235 www +ns1 IN A 192.168.2.6 +ns2 IN A 192.168.23.23 +www IN A 10.1.2.1 + IN A 172.16.2.1 +ftp IN CNAME ftp.example.net. +mail IN A 192.168.2.3 +mail1 IN A 192.168.2.4 +$ORIGIN sub.example.com. +@ IN NS ns3.sub.example.com. + IN NS ns4.sub.example.com. +ns3 IN A 10.2.3.4 ; glue RR +ns4 IN A 10.2.3.5 ; glue RR +; This is a key-signing key, keyid 34957, for example.com. +; Created: 20101216115248 (Thu Dec 16 06:52:48 2010) +; Publish: 20101216115248 (Thu Dec 16 06:52:48 2010) +; Activate: 20101216115248 (Thu Dec 16 06:52:48 2010) +example.com. IN DNSKEY 257 3 8 (AwEAAcdPX24uAsa2b2dfBG + b+GfC2kkEpaDCEXcS2oMmsL + mxfUi0jw4+5FlEB74AmvNTY + ovJKhcekPlJGUqULnpohbcB + qgtGKGPtOy43taTl3kCoH B + T+8IE1RzCGnDmG7HNWB6Bjk + Qqp1gk/R5Jq6Dp+JyHN03OH + qgHv2KrRu vUOXV+8l) +; This is a zone-signing key, keyid 27228, for example.com. +; Created: 20101216115101 (Thu Dec 16 06:51:01 2010) +; Publish: 20101216115101 (Thu Dec 16 06:51:01 2010) +; Activate: 20101216115101 (Thu Dec 16 06:51:01 2010) +example.com. IN DNSKEY 256 3 8 (AwEAAe9cQz4kHCCaocjIlSB + 547QVSUZ9xYBPqTXPX2oTXr + zyHqfgPPnM ZFvvPwGDZtZT + q1K9kkEFXJ9FpwvlslKZT0W + emnIci4qH8uWmoY8n7/n/ b + wLGAuyE6R1FMWTpDSy8sDSj + PKaqqXXf8R77exTNyWDf0Rf + dHvQXCjnx Gls1o4Y5) diff --git a/code/chapter11/F1102ZF.txt b/code/chapter11/F1102ZF.txt new file mode 100644 index 0000000..4ad83d7 --- /dev/null +++ b/code/chapter11/F1102ZF.txt @@ -0,0 +1,153 @@ +; File written on Sat Dec 18 21:31:01 2010 +; dnssec_signzone version 9.7.2-P2 +example.com. 86400 IN SOA ns1.example.com. hostmaster.example.com. ( + 2010121500 ; serial + 43200 ; refresh (12 hours) + 600 ; retry (10 minutes) + 604800 ; expire (1 week) + 10800 ; minimum (3 hours) + ) + 86400 RRSIG SOA 8 2 86400 20110118013101 ( + 20101219013101 27228 example.com. + Mnm5RaKEFAW4V5dRhP70xLtGAFMb/Zsej2vH + mK507zHL+U2Hbx+arMMoA/aOxtp6Jxp0FWM3 + 67VHclTjjGX9xf++6qvA65JHRNvKoZgXGtXI + VGG6ve8A8J9LRePtCKwo3WfhtLEMFsd1KI6o + JTViPzs3UDEqgAvy8rgtvwr80a8= ) + 86400 NS ns1.example.com. + 86400 NS ns2.example.com. + 86400 RRSIG NS 8 2 86400 20110118013101 ( + 20101219013101 27228 example.com. + ubbRJV+DiNmgQITtncLOCjIw4cfB4qnC+DX8 + .... + S78T5Fxh5SbLBPTBKmlKvKxcx6k= ) + 86400 MX 10 mail.example.com. + 86400 MX 10 mail1.example.com. + 86400 RRSIG MX 8 2 86400 20110118013101 ( + 20101219013101 27228 example.com. + K5CVLZDZ/p8KeVVJ/2kxMjN8QaYLZRmvcbi0 + .... + T8a4tw5E+Sv/BX+x1QqksFics64= ) + 10800 NSEC _ldap._tcp.example.com. NS SOA MX RRSIG NSEC DNSKEY + 10800 RRSIG NSEC 8 2 10800 20110118013101 ( + 20101219013101 27228 example.com. + UO8drM7W0wyaF6FXqFuybQpUUGvhRr58xM2S + .... + PFnee80+vXd4sgN6+SfY6AyQV2M= ) + 86400 DNSKEY 256 3 8 ( + AwEAAe9cQz4kHCCaocjIlSB547QVSUZ9xYBP + qTXPX2oTXrzyHqfgPPnMZFvvPwGDZtZTq1K9 + kkEFXJ9FpwvlslKZT0WemnIci4qH8uWmoY8n + 7/n/bwLGAuyE6R1FMWTpDSy8sDSjPKaqqXXf + 8R77exTNyWDf0RfdHvQXCjnxGls1o4Y5 + ) ; key id = 27228 + 86400 DNSKEY 257 3 8 ( + AwEAAcdPX24uAsa2b2dfBGb+GfC2kkEpaDCE + .... + 5Jq6Dp+JyHN03OHqgHv2KrRuvUOXV+8l + ) ; key id = 34957 + 86400 RRSIG DNSKEY 8 2 86400 20110118013101 ( + 20101219013101 27228 example.com. + rRjX4FpgIhRiZgwE1G8pOKH8Uhz2JksbJsif + .... + apROsSPuroSFcRYyxcfLG3HdIS4= ) + 86400 RRSIG DNSKEY 8 2 86400 20110118013101 ( + 20101219013101 34957 example.com. + rGqGH632fMqKC5G5yhLZiTUL3liMzu+CTiC1 + .... + j3d5ig0DKdRHEZKWnvaPZfVWKXo= ) +_ldap._tcp.example.com. 86400 IN SRV 5 2 235 www.example.com. + 86400 RRSIG SRV 8 4 86400 20110118013101 ( + 20101219013101 27228 example.com. + HvjoUq/sQKZb/DnGyWthxNQyeFs62CRtU43a + .... + oYmF3EUjBdIgBAJiqdTR/2pqBus= ) + 10800 NSEC ftp.example.com. SRV RRSIG NSEC + 10800 RRSIG NSEC 8 4 10800 20110118013101 ( + 20101219013101 27228 example.com. + fYNrf2jm73jltGDC7aF6DlSTvcyCpZ+cHSiT + .... + ZALrIjznKyH8pl66qE989YCIneY= ) +ftp.example.com. 86400 IN CNAME ftp.example.net. + 86400 RRSIG CNAME 8 3 86400 20110118013101 ( + 20101219013101 27228 example.com. + hjChA2GkSRZeQMFY7+LJTlIHDVEL7ZQ3zmyU + .... + 2pOU1junt22N21bYHT7mF6SZsec= ) + 10800 NSEC mail.example.com. CNAME RRSIG NSEC + 10800 RRSIG NSEC 8 3 10800 20110118013101 ( + 20101219013101 27228 example.com. + 0dn+xpgWlx7TRJufHlhkfAxo9wMSCG5O25kb + .... + 9NE+9NMhbqDhIi0fQ8GEb/b2t4M= ) +mail1.example.com. 86400 IN A 192.168.2.4 + 86400 RRSIG A 8 3 86400 20110118013101 ( + 20101219013101 27228 example.com. + bMWvyVmoNcBcq/T4zVABdramRz60thZGITcz + .... + kojE4FfJRdWjCB6F/lpt1pL72nE= ) + 10800 NSEC ns1.example.com. A RRSIG NSEC + 10800 RRSIG NSEC 8 3 10800 20110118013101 ( + 20101219013101 27228 example.com. + B10ytuM0qcslrDTDnquEKEvO6UVvgxe0ROxZ + .... + 7D6lMBbDxLcrab4kQY63PjKjFtw= ) +ns1.example.com. 86400 IN A 192.168.2.6 + 86400 RRSIG A 8 3 86400 20110118013101 ( + 20101219013101 27228 example.com. + yV3AwrksW8s54jMZdDFsicAVXcdkfvP7jgNo + .... + i88/ViKCIREhX3Jl33u0zwv4720= ) + 10800 NSEC ns2.example.com. A RRSIG NSEC + 10800 RRSIG NSEC 8 3 10800 20110118013101 ( + 20101219013101 27228 example.com. + R6NF/W2J59eRnaBSQCvpLtjvHXcsV8g1OEUb + .... + 1kjsIkAoSJ6mMnxKhxj7o+CYxJ4= ) +ns2.example.com. 86400 IN A 192.168.23.23 + 86400 RRSIG A 8 3 86400 20110118013101 ( + 20101219013101 27228 example.com. + juzbAhNyGevhrrpKq0Y82EXVStLTZk42/vPt + .... + 7ahKR9HNA9mg2go+H+QLQVYQ18I= ) + 10800 NSEC sub.example.com. A RRSIG NSEC + 10800 RRSIG NSEC 8 3 10800 20110118013101 ( + 20101219013101 27228 example.com. + a63Sf4DP1UEbqdZKR05I6vMmbNmy9vo7YgS2 + .... + aCRIk45rOr2aSVGe19kCZQc+fF0= ) +mail.example.com. 86400 IN A 192.168.2.3 + 86400 RRSIG A 8 3 86400 20110118013101 ( + 20101219013101 27228 example.com. + hpArsBJoHqi9+9Ys4o46WZogwd8Li4Zn3FkQ + .... + MTnI6ULQvwcFfVVif07zs5xBa8U= ) + 10800 NSEC mail1.example.com. A RRSIG NSEC + 10800 RRSIG NSEC 8 3 10800 20110118013101 ( + 20101219013101 27228 example.com. + TJ+EDteAhUV1KNPG+tbDbGz0jjKjqdHkIoZd + .... + qtAtFhFysMH7JFvnKZEOeRec2T0= ) +sub.example.com. 86400 IN NS ns3.sub.example.com. + 86400 IN NS ns4.sub.example.com. + 10800 NSEC www.example.com. NS RRSIG NSEC + 10800 RRSIG NSEC 8 3 10800 20110118013101 ( + 20101219013101 27228 example.com. + UxsUTlFZ9HIIOelqkHPFpoA7HcB/o/oZchdD + .... + NbjZ42hmv5kBMq8RKX0Zql4hUsc= ) +ns3.sub.example.com. 86400 IN A 10.2.3.4 +ns4.sub.example.com. 86400 IN A 10.2.3.5 +www.example.com. 86400 IN A 10.1.2.1 + 86400 IN A 172.16.2.1 + 86400 RRSIG A 8 3 86400 20110118013101 ( + 20101219013101 27228 example.com. + wtBArhmhUS76gzkjQR4oun0HMSpeI7UngTFO + .... + FVejigwrKP0x+DGGsj6t9qetfmE= ) + 10800 NSEC example.com. A RRSIG NSEC + 10800 RRSIG NSEC 8 3 10800 20110118013101 ( + 20101219013101 27228 example.com. + k95zDrRq4UmJAAea+m2Ag2mVtqnMgSGMqHCR + .... + NFQ9D+/Tvo/Te6ha70Pvs2JGN3Y= ) diff --git a/code/chapter11/F1103ZF.txt b/code/chapter11/F1103ZF.txt new file mode 100644 index 0000000..9eebdfc --- /dev/null +++ b/code/chapter11/F1103ZF.txt @@ -0,0 +1,25 @@ +$TTL 86400 ; 1 day +$ORIGIN example.com. +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2010082500 ; serial + 43200 ; refresh (12 hours) + 15 ; retry (15 seconds) + 604800 ; expire (1 week) + 10800 ; nx (3 hours) + ) + IN NS ns1.example.com. + IN NS ns2.example.com. + IN MX 10 mail.example.com. + IN MX 10 mail1.example.com. +_ldap._tcp IN SRV 5 2 235 www +ns1 IN A 192.168.2.6 +ns2 IN A 192.168.23.23 +www IN A 10.1.2.1 + IN A 172.16.2.1 +mail IN A 192.168.2.3 +mail1 IN A 192.168.2.4 +$ORIGIN sub.example.com. +@ IN NS ns3.sub.example.com. + IN NS ns4.sub.example.com. +ns3 IN A 10.2.3.4 ; glue RR +ns4 IN A 10.2.3.5 ; glue RR diff --git a/code/chapter11/F1104ZF.txt b/code/chapter11/F1104ZF.txt new file mode 100644 index 0000000..2749d8d --- /dev/null +++ b/code/chapter11/F1104ZF.txt @@ -0,0 +1,27 @@ +$TTL 86400 ; 1 day +$ORIGIN example.com. +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2010122000 ; serial + 10800 ; refresh (3 hours) + 15 ; retry (15 seconds) + 604800 ; expire (1 week) + 10800 ; nx (3 hours) + ) + IN NS ns1.example.com. + IN NS ns2.example.com. + IN MX 10 mail.example.com. + IN MX 10 mail1.example.com. +_ldap._tcp IN SRV 5 2 235 www +ns1 IN A 192.168.2.6 +ns2 IN A 192.168.23.23 +www IN A 10.1.2.1 + IN A 172.16.2.1 +mail IN A 192.168.2.3 +mail1 IN A 192.168.2.4 +$ORIGIN sub.example.com. +@ IN NS ns3.sub.example.com. + IN NS ns4.sub.example.com. +ns3 IN A 10.2.3.4 ; glue RR +ns4 IN A 10.2.3.5 ; glue RR +$INCLUDE keys/Kexample.com.+008+60366.key ; KSK +$INCLUDE keys/Kexample.com.+008+23110.key ; ZSK diff --git a/code/chapter11/F1105ZE.txt b/code/chapter11/F1105ZE.txt new file mode 100644 index 0000000..a95fbbf --- /dev/null +++ b/code/chapter11/F1105ZE.txt @@ -0,0 +1,95 @@ +; File written on Mon Apr 18 10:48:29 2005 +; dnssec_signzone version 9.3.0 +example.com. 86400 IN SOA ns1.example.com. hostmaster.example.com. ( + 2005032902 ; serial + 10800 ; refresh (3 hours) + 15 ; retry (15 seconds) + 604800 ; expire (1 week) + 10800 ; minimum (3 hours) + ) + 86400 RRSIG SOA 5 2 86400 20050518134829 ( + 20050418134829 3977 example.com. + Pcj36/iCWbY+9/sq9Dw7+QaeRbs= ) + 86400 NS ns1.example.com. + 86400 NS ns2.example.com. + 86400 RRSIG NS 5 2 86400 20050518134829 ( + 20050418134829 3977 example.com. + 6sfpgAuKarGSbhN3elYozOaBU6c= ) + 86400 MX 10 mail.example.com. + 86400 MX 10 mail1.example.com. + 86400 RRSIG MX 5 2 86400 20050518134829 ( + 20050418134829 3977 example.com. + 2y4QQlM7+Rs039wLaxA/I+69d38= ) + 10800 NSEC ldap._tcp.example.com. (NS SOA MX + RRSIG NSEC DNSKEY) + 10800 RSIG NSEC 5 2 10800 20050518134829 ( + 20050418134829 3977 example.com. + k4T48nVQVZuPBW3aQ0BhlQmYP6c= ) + 86400 DNSKEY 256 3 5 ( + t/4w8JgeybiVZeHbYXHIljS0kHt8vw== + ) ; key id = 3977 + 86400 DNSKEY 257 3 5 ( + 1WnVhGKV1I6T01x+u4uNoe1/uocNOQ== + ) ; key id = 12513 + 86400 RRSIG DNSKEY 5 2 86400 20050518134829 ( + 20050418134829 3977 example.com. + ihcz6BqjNRBFk4vCSGjS2UWdx7M= ) + 86400 RRSIG DNSKEY 5 2 86400 20050518134829 ( + 20050418134829 12513 example.com. + vv2TqynHfZI8I9GA9zpyd+y/54M= ) +_ldap._tcp.example.com . 86400 IN SRV 5 2 235 www.example.com. + 86400 RRSIG SRV 5 4 86400 20050518134829 ( + 4hzYqMuD+YfCe6CYijkvxaK2AI8= ) + 10800 NSEC mail.example.com. SRV RRSIG NSEC + 10800 RRSIG NSEC 5 4 10800 20050518134829 ( + 20050418134829 3977 example.com. + 8q0gADAR86IvfVUT7eXtRbXhyQg= ) +mail.example.com. 86400 IN A 192.168.2.3 + 86400 RRSIG A 5 3 86400 20050518134829 ( + 20050418134829 3977 example.com. + ntx8VinqRDuVGdLv6j1aTZPk26c= ) + 10800 NSEC mail1.example.com. A RRSIG NSEC + 10800 RRSIG NSEC 5 3 10800 20050518134829 ( + 20050418134829 3977 example.com. + bsjUM4szz6k1kJj1eASDVh+PPdc= ) +mail1.example.com. 86400 IN A 192.168.2.4 + 86400 RRSIG A 5 3 86400 20050518134829 ( + 20050418134829 3977 example.com. + s5jnGdHV0zLEN9OooydL5QOq6Bg= ) + 10800 NSEC ns1.example.com. A RRSIG NSEC + 10800 RRSIG NSEC 5 3 10800 20050518134829 ( + 20050418134829 3977 example.com. + /Ca0z+gPDCxpgXp9vVBwoCDZyNs= ) +ns1.example.com. 86400 IN A 192.168.2.6 + 86400 RRSIG A 5 3 86400 20050518134829 ( + 20050418134829 3977 example.com. + WLwY0eMj29hoehng6Q8MOqP/Fps= ) + 10800 NSEC ns2.example.com. A RRSIG NSEC + 10800 RRSIG NSEC 5 3 10800 20050518134829 ( + 20050418134829 3977 example.com. + iUm0ZtFd2tlB1kCGd03TWHA6XLE= ) +ns2.example.com. 86400 IN A 192.168.23.23 + 86400 RRSIG A 5 3 86400 20050518134829 ( + 20050418134829 3977 example.com. + D5g1Bc235ra+kcgdLy0i5o0xyKs= ) + 10800 NSEC sub.example.com. A RRSIG NSEC + 10800 RRSIG NSEC 5 3 10800 20050518134829 ( + 20050418134829 3977 example.com. + KrYgcGOtK2EZkbMBpedYBjVLVwE= ) +sub.example.com. 86400 IN NS ns3.sub.example.com. + 86400 IN NS ns4.sub.example.com. + 10800 NSEC www.example.com. NS RRSIG NSEC + 10800 RRSIG NSEC 5 3 10800 20050518134829 ( + 20050418134829 3977 example.com. + lwTngtzMsECH+ZsOqza0d8mxORE= ) +ns3.sub.example.com. 86400 IN A 10.2.3.4 +ns4.sub.example.com. 86400 IN A 10.2.3.5 +www.example.com. 86400 IN A 10.1.2.1 + 86400 IN A 172.16.2.1 + 86400 RRSIG A 5 3 86400 20050518134829 ( + 20050418134829 3977 example.com. + 5djR2cKlFB5XUU4uT92hFWGfsKE= ) + 10800 NSEC example.com. A RRSIG NSEC + 10800 RRSIG NSEC 5 3 10800 20050518134829 ( + 20050418134829 3977 example.com. + 8OcJsjO6zzkINiR2nqLUh2GEbvI= ) diff --git a/code/chapter11/F1106NS.txt b/code/chapter11/F1106NS.txt new file mode 100644 index 0000000..a26f9a6 --- /dev/null +++ b/code/chapter11/F1106NS.txt @@ -0,0 +1,38 @@ +// named.cong fragment for ns1.example.com +logging{ + channel normal_log { + file "/var/log/named/normal.log" versions 3 size 2m; + severity error; + print-time yes; + print-severity yes; + print-category yes; + }; + channel dnssec_log { // streamed dnssec log + file "/var/log/named/dnssec.log" versions 3 size 2m; + severity debug 3; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + normal_log; + }; + category dnssec{ + dnssec_log; + }; +}; +options { + .... + directory "/var/named"; + dnssec-enable yes; // default could be omitted + allow-transfer {"none"}; + allow-update {"none";}; + .... +}; +.... +zone "example.com" in{ + type master; + file "master.example.com.signed"; + allow-transfer {192.168.23.23;}; // ns2.example.com +}; +.... diff --git a/code/chapter11/F1107NS.txt b/code/chapter11/F1107NS.txt new file mode 100644 index 0000000..dc04698 --- /dev/null +++ b/code/chapter11/F1107NS.txt @@ -0,0 +1,38 @@ +// named.conf fragment for ns2.example.com +logging{ + channel normal_log { + file "/var/log/named/normal.log" versions 3 size 2m; + severity error; + print-time yes; + print-severity yes; + print-category yes; + }; + channel dnssec_log { // streamed dnssec log + file "/var/log/named/dnssec.log" versions 3 size 2m; + severity debug 3; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + normal_log; + }; + category dnssec{ + dnssec_log; + }; +}; +options { + .... + directory "/var/named"; + dnssec-enable yes; // default could be omitted + allow-transfer {"none"}; + allow-update {"none";}; + .... +}; +.... +zone "example.com" in{ + type slave; + file "slave.example.com.signed"; + masters {192.168.2.6;}; // ns1.example.com +}; +.... diff --git a/code/chapter11/F1108ZS.txt b/code/chapter11/F1108ZS.txt new file mode 100644 index 0000000..63e87db --- /dev/null +++ b/code/chapter11/F1108ZS.txt @@ -0,0 +1,3 @@ + 86400 DNSKEY 257 3 8 ( + 5Jq6Dp+JyHN03OHqgHv2KrRuvUOXV+8l + ) ; key id = 34957 diff --git a/code/chapter11/F1109NS.txt b/code/chapter11/F1109NS.txt new file mode 100644 index 0000000..298b555 --- /dev/null +++ b/code/chapter11/F1109NS.txt @@ -0,0 +1,35 @@ +// named.conf fragment for ns1.example.net +logging{ + channel normal_log { + file "/var/log/named/normal.log" versions 3 size 2m; + severity error; + print-time yes; + print-severity yes; + print-category yes; + }; + channel dnssec_log { // streamed dnssec log + file "/var/log/named/dnssec.log" versions 3 size 2m; + severity debug 3; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + normal_log; + }; + category dnssec{ + dnssec_log; + }; +}; +options { + .... + directory "/var/named"; + dnssec-enable yes; // default could be omitted + dnssec-validation yes; // default could be omitted + allow-recursion {10.2/16; 192.168.2/24;}; // recursion limits - closes resolver + .... +}; +trusted-keys{ + "example.com" 257 3 5 "1WnVhGKV1I6T01x+u4uNoe1/uocNOQ=="; +}; +.... diff --git a/code/chapter11/F1110ZF.txt b/code/chapter11/F1110ZF.txt new file mode 100644 index 0000000..532f746 --- /dev/null +++ b/code/chapter11/F1110ZF.txt @@ -0,0 +1,18 @@ +// named.conf fragment for ns1.example.net +$TTL 86400 ; 1 day +$ORIGIN sub.example.com. +@ IN SOA ns1.sub.example.com. hostmaster.example.com. ( + 2010122000 ; serial + 10800 ; refresh (3 hours) + 15 ; retry (15 seconds) + 604800 ; expire (1 week) + 10800 ; nx (3 hours) + ) + IN NS ns3.example.com. + IN NS ns4.example.com. + IN MX 10 mail.example.com. +ns3 IN A 10.2.3.4 +ns4 IN A 10.2.3.5 +fred IN A 10.1.2.1 +$INCLUDE Ksub.example.com.+008+60366.key ; ZSK +$INCLUDE Ksub.example.com.+008+23110.key ; KSK diff --git a/code/chapter11/F1111ZF.txt b/code/chapter11/F1111ZF.txt new file mode 100644 index 0000000..5a5166b --- /dev/null +++ b/code/chapter11/F1111ZF.txt @@ -0,0 +1,28 @@ +$TTL 86400 ; 1 day +$ORIGIN example.com. +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2005032902 ; serial + 10800 ; refresh (3 hours) + 15 ; retry (15 seconds) + 604800 ; expire (1 week) + 10800 ; minimum (3 hours) + ) + IN NS ns1.example.com. + IN NS ns2.example.com. + IN MX 10 mail.example.com. + IN MX 10 mail1.example.com. +_ldap._tcp IN SRV 5 2 235 www +ns1 IN A 192.168.2.6 +ns2 IN A 192.168.23.23 +www IN A 10.1.2.1 + IN A 172.16.2.1 +mail IN A 192.168.2.3 +mail1 IN A 192.168.2.4 +$ORIGIN sub.example.com. +@ IN NS ns3.sub.example.com. + IN NS ns4.sub.example.com. +ns3 IN A 10.2.3.4 ; glue RR +ns4 IN A 10.2.3.5 ; glue RR +$INCLUDE keys/Kexample.com.+008+34957.key ; KSK +$INCLUDE keys/Kexample.com.+008+27228.key ; ZSK +$INCLUDE dsset-sub.example.com. ; DS RR diff --git a/code/chapter11/F1112ZS.txt b/code/chapter11/F1112ZS.txt new file mode 100644 index 0000000..d1035c7 --- /dev/null +++ b/code/chapter11/F1112ZS.txt @@ -0,0 +1,15 @@ +sub.example.com. 86400 IN NS ns3.sub.example.com. + 86400 IN NS ns4.sub.example.com. + 86400 DS 23110 8 1 ( + 9D9A1E894BEE23B85FD8807A629D3236C2E9 + 9B7E ) + 86400 DS 23110 8 2 ( + 12264712A245E1EEB81E077870FB72B19F01 + E740F9FAA71F9C2A921AC61C35B6 ) + 86400 RRSIG DS 8 3 86400 20110119221601 ( + 20101220221601 27228 example.com. + EEnwSuLJjm36aJsFm3RWf0G8T6k= ) + 10800 NSEC www.example.com. NS DS RRSIG NSEC + 10800 RRSIG NSEC 8 3 10800 20110119221601 ( + 20101220221601 27228 example.com. + fFOyyxzJaHqVK/I0trYo4/5CSK8= ) diff --git a/code/chapter11/F1113ZF.txt b/code/chapter11/F1113ZF.txt new file mode 100644 index 0000000..09cefb9 --- /dev/null +++ b/code/chapter11/F1113ZF.txt @@ -0,0 +1,29 @@ +$TTL 86400 ; 1 day +$ORIGIN example.com. +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2005032902 ; serial + 10800 ; refresh (3 hours) + 15 ; retry (15 seconds) + 604800 ; expire (1 week) + 10800 ; minimum (3 hours) + ) + IN NS ns1.example.com. + IN NS ns2.example.com. + IN MX 10 mail.example.com. + IN MX 10 mail1.example.com. +_ldap._tcp IN SRV 5 2 235 www +ns1 IN A 192.168.2.6 +ns2 IN A 192.168.23.23 +www IN A 10.1.2.1 + IN A 172.16.2.1 +mail IN A 192.168.2.3 +mail1 IN A 192.168.2.4 +$ORIGIN sub.example.com. +@ IN NS ns3.sub.example.com. + IN NS ns4.sub.example.com. +ns3 IN A 10.2.3.4 ; glue RR +ns4 IN A 10.2.3.5 ; glue RR +$INCLUDE keys/Kexample.com.+008+34957.key ; KSK +$INCLUDE keys/Kexample.com.+008+27228.key ; current ZSK +$INCLUDE dsset-sub.example.com. ; DS RR +$INCLUDE keys/Kexample.com.+008+10476.key ; new ZSK diff --git a/code/chapter11/F1114ZS.txt b/code/chapter11/F1114ZS.txt new file mode 100644 index 0000000..8417857 --- /dev/null +++ b/code/chapter11/F1114ZS.txt @@ -0,0 +1,16 @@ + 86400 DNSKEY 256 3 8 ( + kzenp/JaUHd6+VUjLiMGrQ3keBID0clv + ) ; key id = 10476 + 86400 DNSKEY 256 3 8 ( + 8R77exTNyWDf0RfdHvQXCjnxGls1o4Y5 + ) ; key id = 27228 + 86400 DNSKEY 257 3 8 ( + 5Jq6Dp+JyHN03OHqgHv2KrRuvUOXV+8l + ) ; key id = 34957 + 86400 RRSIG DNSKEY 8 2 86400 20110119224405 ( + 20101220224405 27228 example.com. + 4MNN1+EdmsJuiKsT+9ccBZTsxuE= ) + 86400 RRSIG DNSKEY 8 2 86400 20110119224405 ( + 20101220224405 34957 example.com. + +XyQZnoPOdvdrxCfDlWrhzGZUkw= ) +_ldap._tcp.example.com. 86400 IN SRV 5 2 235 www.example.com. diff --git a/code/chapter11/F1115ZF.txt b/code/chapter11/F1115ZF.txt new file mode 100644 index 0000000..dc21b11 --- /dev/null +++ b/code/chapter11/F1115ZF.txt @@ -0,0 +1,29 @@ +$TTL 86400 ; 1 day +$ORIGIN example.com. +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2010122000 ; serial + 10800 ; refresh (3 hours) + 15 ; retry (15 seconds) + 604800 ; expire (1 week) + 10800 ; nx (3 hours) + ) + IN NS ns1.example.com. + IN NS ns2.example.com. + IN MX 10 mail.example.com. + IN MX 10 mail1.example.com. +_ldap._tcp IN SRV 5 2 235 www +ns1 IN A 192.168.2.6 +ns2 IN A 192.168.23.23 +www IN A 10.1.2.1 + IN A 172.16.2.1 +mail IN A 192.168.2.3 +mail1 IN A 192.168.2.4 +$ORIGIN sub.example.com. +@ IN NS ns3.sub.example.com. + IN NS ns4.sub.example.com. +ns3 IN A 10.2.3.4 ; glue RR +ns4 IN A 10.2.3.5 ; glue RR +$INCLUDE keys/Kexample.com.+008+34957.key ; current KSK +$INCLUDE keys/Kexample.com.+008+32647.key ; new KSK +$INCLUDE dsset-sub.example.com. ; DS RR +$INCLUDE keys/Kexample.com.+008+10476.key ; new ZSK diff --git a/code/chapter11/F1116ZS.txt b/code/chapter11/F1116ZS.txt new file mode 100644 index 0000000..d1412e9 --- /dev/null +++ b/code/chapter11/F1116ZS.txt @@ -0,0 +1,18 @@ + 86400 DNSKEY 256 3 8 ( + kzenp/JaUHd6+VUjLiMGrQ3keBID0clv + ) ; key id = 10476 + 86400 DNSKEY 257 3 8 ( + WcArjB35mSEVw+ZWGnmQujc= + ) ; key id = 32647 + 86400 DNSKEY 257 3 8 ( + 5Jq6Dp+JyHN03OHqgHv2KrRuvUOXV+8l + ) ; key id = 34957 + 86400 RRSIG DNSKEY 8 2 86400 20110119230454 ( + 20101220230454 10476 example.com. + eqLnidIMy7jO+MYlsNoWfpX+XtE= ) + 86400 RRSIG DNSKEY 8 2 86400 20110119230454 ( + 20101220230454 32647 example.com. + X+ZOKqjBKy8hLFYtzg== ) + 86400 RRSIG DNSKEY 8 2 86400 20110119230454 ( + 20101220230454 34957 example.com. + cLOrfsoYSui3nskUi9A6h43B1AA= ) diff --git a/code/chapter11/F1117ZS.txt b/code/chapter11/F1117ZS.txt new file mode 100644 index 0000000..33d4614 --- /dev/null +++ b/code/chapter11/F1117ZS.txt @@ -0,0 +1,4 @@ + 86400 DNSKEY 257 3 8 ( + WcArjB35mSEVw+ZWGnmQujc= + ) ; key id = 32647 + diff --git a/code/chapter11/F1118NS.txt b/code/chapter11/F1118NS.txt new file mode 100644 index 0000000..ffaad58 --- /dev/null +++ b/code/chapter11/F1118NS.txt @@ -0,0 +1,4 @@ +trusted-keys{ + "example.com." 257 3 8 "5Jq6Dp+JyHN03OHqgHv2KrRuvUOXV+8l"; // old KSK + "example.com." 257 3 8 "WcArjB35mSEVw+ZWGnmQujc="; // new KSK +}; diff --git a/code/chapter12/F1201NS.txt b/code/chapter12/F1201NS.txt new file mode 100644 index 0000000..9fb337b --- /dev/null +++ b/code/chapter12/F1201NS.txt @@ -0,0 +1,9 @@ +/* C-style comment format needs opening and closing markers +** but allows multiple lines or */ +/* single lines or */ +zone /* in-line comment does not terminate line */ in {some zone statements}; +// C++-style comments have single line format, no closing required +...some statement; // comment ends this line +# SHELL/PERL-style comments have single lines, no closing required + some statement; # comment ends this line + diff --git a/code/chapter12/F1202NS.txt b/code/chapter12/F1202NS.txt new file mode 100644 index 0000000..53109a8 --- /dev/null +++ b/code/chapter12/F1202NS.txt @@ -0,0 +1,14 @@ +// dense single-line style +zone "example.com" {type slave; file "slave.example.com"; masters {10.0.0.1;};}; +// single-statement-per-line style +zone "example.com" { + type slave; + file "slave.example.com"; + masters {10.0.0.1;}; + }; +// spot the difference +zone "example.com" { + type slave; + file "sec.slave.com"; + masters {10.0.0.1;}; }; + diff --git a/code/chapter12/F1203NS.txt b/code/chapter12/F1203NS.txt new file mode 100644 index 0000000..df2a1b3 --- /dev/null +++ b/code/chapter12/F1203NS.txt @@ -0,0 +1,27 @@ +// change log +// 1. changed by M.E. on 24th January +// a. added something +acl "name" {... + // acl clauses if present generally come first + // to avoid forward references +}; +key "name" {... + // key clauses if present must appear + // before being referenced +}; + +logging { + // requires at least a file + // statement unless using syslog + // order not important with BIND 9 +}; +options { + // other statements (as required) +}; +// zones statements including 'required' zones +zone { +.... +}; +zone { +.... +}; diff --git a/code/chapter12/F1204NS.txt b/code/chapter12/F1204NS.txt new file mode 100644 index 0000000..ae80f46 --- /dev/null +++ b/code/chapter12/F1204NS.txt @@ -0,0 +1,39 @@ +// change log +// 1. changed by M.E. on 24th January +// a. added something +acl "name" {... + // acl clauses if present come first + // to avoid forward references +}; +key "name" {... + // key clauses if present must appear + // before being referenced +}; +logging {. + // usually requires at least a file statement + // unless using the syslog + // order not important with BIND 9 +}; +options { + // global options + // other statements as required +}; +view "first" { + // view specific statements + // view specific zone clauses + // including required zones + zone { + }; + ..... + zone { + }; +}; // end of view "first" + view "second" { + // view specific statements + // view specific zone clauses + // including required zones + zone { + }; + zone { + }; +}; // end of view "second" diff --git a/code/chapter12/F1205NS.txt b/code/chapter12/F1205NS.txt new file mode 100644 index 0000000..4f06b2b --- /dev/null +++ b/code/chapter12/F1205NS.txt @@ -0,0 +1,3 @@ +options { + allow-transfer { !192.168.2.7;192.168.2.3/24;}; +}; diff --git a/code/chapter12/F1206NS.txt b/code/chapter12/F1206NS.txt new file mode 100644 index 0000000..ca8d03a --- /dev/null +++ b/code/chapter12/F1206NS.txt @@ -0,0 +1,3 @@ +options { + allow-transfer {192.168.2.3/24; !192.168.2.7;}; +}; diff --git a/code/chapter12/F1207NS.txt b/code/chapter12/F1207NS.txt new file mode 100644 index 0000000..c82cad1 --- /dev/null +++ b/code/chapter12/F1207NS.txt @@ -0,0 +1,10 @@ +acl "good-guys" { + !192.169.2.5/28; // denies first 16 IPs + 192.168.2.5/24; // allows rest of subnet + localnets; // allows our network + 2001:db8:0:1::/64; // allows this subnet only +}; +options { + allow-transfer {"good-guys";}; +}; + diff --git a/code/chapter12/F1208NS.txt b/code/chapter12/F1208NS.txt new file mode 100644 index 0000000..2a13ca4 --- /dev/null +++ b/code/chapter12/F1208NS.txt @@ -0,0 +1,40 @@ +//defining acls +// simple ip address acl +acl "someips" { + 10.0.0.1; 192.168.23.1; 192.168.23.15; +}; +// ip address acl with '/' format + acl "moreips" { + 10.0.0.2; + 192.168.23.128/25; // 128 IPs +}; +// nested acl +acl "allips" { + "someips"; + "moreips"; +}; +// messy acl +acl "complex" { + "someips"; + 10.0.15.0/24; + !10.0.16.1/24; // negated + {10.0.17.1;10.0.18.2;}; // nested + }; +view "my stuff" { + match-clients {"someips";}; + .... +}; +// using acls +zone "example.com" { + type master; + file "master.example.com"; + also-notify {"allips";}; +}; +zone "example.net" { + type slave; + masters {192.168.2.3;192.168.2.4;}; + file "slave.example.net; + allow-transfer {"none";}; // this is a special acl +}; + + diff --git a/code/chapter12/F1209NS.txt b/code/chapter12/F1209NS.txt new file mode 100644 index 0000000..42179c2 --- /dev/null +++ b/code/chapter12/F1209NS.txt @@ -0,0 +1,23 @@ +// include two acl clauses +include "/var/named/acl/private.acl" +include "/var/named/acl/public.acl" +options { + // relative to named.conf directory + include "some.options"; + directory "/var/named"; + // include inside a clause - relative to 'directory' + include "other.options" +}; +// using include for zones +... +// zones for chemical division - absolute path +include "/var/named/chemical/zone.files"; +// zones for engineering division +include "/var/named/engineering/zone.files"; +// these load from the path specified by 'directory' option +include "more-zone.files"; +// housekeeping zones explicitly included +zone "64/27.23.168.192.in-addr.arpa" in{ + type master; + file "192.169.23.rev"; +}; diff --git a/code/chapter12/F1210NS.txt b/code/chapter12/F1210NS.txt new file mode 100644 index 0000000..3630e37 --- /dev/null +++ b/code/chapter12/F1210NS.txt @@ -0,0 +1,5 @@ +// included acl + acl "private-acl" { + 10.0.0.1; + 192.168.23.128/25; // 128 IPs +}; diff --git a/code/chapter12/F1211NS.txt b/code/chapter12/F1211NS.txt new file mode 100644 index 0000000..ade7b4c --- /dev/null +++ b/code/chapter12/F1211NS.txt @@ -0,0 +1,3 @@ +recursion yes; +allow-transfer {"none";}; + diff --git a/code/chapter12/F1212NS.txt b/code/chapter12/F1212NS.txt new file mode 100644 index 0000000..637f103 --- /dev/null +++ b/code/chapter12/F1212NS.txt @@ -0,0 +1,13 @@ +// named.conf fragment +logging{ + channel single_log { + file "/var/log/named/bind.log" versions 3 size 2m; + severity info; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + single_log; + }; +}; diff --git a/code/chapter12/F1213NS.txt b/code/chapter12/F1213NS.txt new file mode 100644 index 0000000..00ffe6a --- /dev/null +++ b/code/chapter12/F1213NS.txt @@ -0,0 +1,21 @@ +// defining masters +masters "common masters" { + masters {192.168.2.7; 10.2.3.15 port 1127; 2001:db8:0:1::15;}; +}; +// using masters +zone "example.com" { + type slave; + file "slave.example.com"; + masters {"common masters";}; +}; +zone "example.net" { + type slave; + file "slave.example.net; + masters {"common masters";}; +}; +BIND options Clause +The options clause is used to group statements that have global scope. The options clause may take a ferocious number of statements-see the list found in Table 12-6. +options Clause Syntax +options { + // options statements +}; diff --git a/code/chapter12/F1214NS.txt b/code/chapter12/F1214NS.txt new file mode 100644 index 0000000..efb622e --- /dev/null +++ b/code/chapter12/F1214NS.txt @@ -0,0 +1,24 @@ +// defining masters +masters "common masters" { + masters {192.168.2.7; 10.2.3.15 port 1127; 2001:db8:0:1::15;}; +}; +// defining options clause +options { + .... + also-notify {192.168.2.3;192.168.2.4;}; + .... +}; +// zones +zone "example.com" { + // NOTIFY messages for this domain sent to global + // also-notify list + type master; + file "master.example.com"; +}; +zone "example.net" { + // NOTIFY messages NOT sent to global + // also-notify list + type master; + file "master.example.net; + also-notify {"none";}; +}; diff --git a/code/chapter12/F1215NS.txt b/code/chapter12/F1215NS.txt new file mode 100644 index 0000000..86af7b9 --- /dev/null +++ b/code/chapter12/F1215NS.txt @@ -0,0 +1,13 @@ +// named.conf fragment +.... +// IPv4 server +server 10.2.3.15 { + transfer-format one-answer; + edns no; +}; +// IPv6 addresses of same server +server 2001:db8:0:27::17 { + transfer-format one-answer; + edns no; +}; +.... diff --git a/code/chapter12/F1216ZS.txt b/code/chapter12/F1216ZS.txt new file mode 100644 index 0000000..b69d0c3 --- /dev/null +++ b/code/chapter12/F1216ZS.txt @@ -0,0 +1,8 @@ +example.com. IN DNSKEY 257 3 5 ( + AQPSKmynfzW4kyBv015MUG2DeIQ3 + Cbl+BBZH4b/0PY1kxkmvHjcZc8no + kfzj31GajIQKY+5CptLr3buXA10h + WqTkF7H6RfoRqXQeogmMHfpftf6z + Mv1LyBUgia7za6ZEzOJBOztyvhjL + 742iU/TpPSEDhm2SNKLijfUppn1U + aNvv4w== ) diff --git a/code/chapter12/F1217NS.txt b/code/chapter12/F1217NS.txt new file mode 100644 index 0000000..85a215a --- /dev/null +++ b/code/chapter12/F1217NS.txt @@ -0,0 +1,9 @@ +trusted-keys { +"example.com" 257 3 5 "AQPSKmynfzW4kyBv015MUG2DeIQ3 + Cbl+BBZH4b/0PY1kxkmvHjcZc8no + kfzj31GajIQKY+5CptLr3buXA10h + WqTkF7H6RfoRqXQeogmMHfpftf6z + Mv1LyBUgia7za6ZEzOJBOztyvhjL + 742iU/TpPSEDhm2SNKLijfUppn1U + aNvv4w=="; +}; diff --git a/code/chapter12/F1218NS.txt b/code/chapter12/F1218NS.txt new file mode 100644 index 0000000..bb4d309 --- /dev/null +++ b/code/chapter12/F1218NS.txt @@ -0,0 +1,17 @@ +// named.conf fragment +view "recursive-external" { + match-clients {!10.2.3.4/24;}; + match-recursive-only yes; + // other view statements + zone "example.com" in { + .... + }; +}; +view "internal" { + match-clients {10.2.3.4/24;}; + // other view statements + zone "example.com" in { + .... + }; +}; + diff --git a/code/chapter12/F1219NS.txt b/code/chapter12/F1219NS.txt new file mode 100644 index 0000000..4682220 --- /dev/null +++ b/code/chapter12/F1219NS.txt @@ -0,0 +1,23 @@ +// named.conf fragment +view "recursive-external" { + match-clients {10.2.4.4/24;}; + match-recursive-only yes; + // other view statements + zone "example.com" in { + .... + }; +}; +view "internal" { + match-clients {10.2.3.4/24;}; + match-recursive-only yes; + // other view statements + zone "example.com" in { + .... + }; +}; +// definition of zone behavior outside the views +zone "example.com" in { +.... +}; + + diff --git a/code/chapter12/F1220NS.txt b/code/chapter12/F1220NS.txt new file mode 100644 index 0000000..689a03c --- /dev/null +++ b/code/chapter12/F1220NS.txt @@ -0,0 +1,16 @@ +// named.conf fragment +acl "rndc-users" { + 10.0.15.0/24; + !10.0.16.1/24; // negated + 2001:db8:0:27::/64; // any address in subnet + }; +.... +key "rndc-remote" { + algorithm hmac-md5; + secret "OmItW1lOyLVUEuvv+Fme+Q=="; +}; +controls { + // local host - default key + inet 127.0.0.1 allow {localhost;}; + inet * port 7766 allow {"rndc-users";} keys {"rndc-remote";}; +}; diff --git a/code/chapter12/F1221NS.txt b/code/chapter12/F1221NS.txt new file mode 100644 index 0000000..3dd75b2 --- /dev/null +++ b/code/chapter12/F1221NS.txt @@ -0,0 +1,17 @@ +// named.conf fragment +logging{ + channel single_log { + file "/var/log/named/bind.log" versions 3 size 2m; + severity info; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + single_log; + }; + category lame-servers{ + null; // discard + }; +}; + diff --git a/code/chapter12/F1222NS.txt b/code/chapter12/F1222NS.txt new file mode 100644 index 0000000..402ac0a --- /dev/null +++ b/code/chapter12/F1222NS.txt @@ -0,0 +1,44 @@ +// named.conf fragment +logging{ + channel main_log { + file "/var/log/named/main.log" versions 3 size 2m; + severity info; + print-time yes; + print-severity yes; + print-category yes; + }; + channel notify_log { + file "/var/log/named/notify.log" versions 3 size 1m; + severity info; + print-time yes; + print-severity yes; + print-category yes; + }; + channel ddns_log { + file "/var/log/named/ddns.log" versions 3 size 1m; + severity info; + print-time yes; + print-severity yes; + print-category yes; + }; + category default{ + main_log; + }; + category lame-servers{ + null; // discard + }; + category notify{ + notify_log; + }; + category update{ + ddns_log; + }; + category update-security{ + ddns_log; + }; + category unmatched { + main_log; default_stderr; + }; +}; + + diff --git a/code/chapter12/F1223NS.txt b/code/chapter12/F1223NS.txt new file mode 100644 index 0000000..cf9c911 --- /dev/null +++ b/code/chapter12/F1223NS.txt @@ -0,0 +1,16 @@ +// named.conf fragment +.... +zone "example.com" in{ + type slave; + masters {192.168.254.2;}; + file "slave.example.com"; + // allows notify from the defined IPs + allow-notify (192.168.0.15; 192.168.0.16; 10.0.0.1;); +}; +zone "example.net" in{ + type slave; + file "slave.example.net"; + masters {192.168.254.3;}; + // allows no notifies + allow-notify (none;); +}; diff --git a/code/chapter12/F1224NS.txt b/code/chapter12/F1224NS.txt new file mode 100644 index 0000000..b1d00c6 --- /dev/null +++ b/code/chapter12/F1224NS.txt @@ -0,0 +1,12 @@ +options { +.... + allow-transfer {none;}; // none by default +.... +}; +.... +zone "example.com in{ +.... + allow-transfer {any;}; // this zone only +.... +}; + diff --git a/code/chapter12/F1225NS.txt b/code/chapter12/F1225NS.txt new file mode 100644 index 0000000..394da1a --- /dev/null +++ b/code/chapter12/F1225NS.txt @@ -0,0 +1,22 @@ +// named.conf fragment +key "update-key" { + .... +}; +zone "example.net" in{ + type master; + allow-update {none;}; // no DDNS by default + .... +}; +.... +zone "example.com in{ +....type master; + allow-update {10.0.1.2;}; // DDNS this host only + .... +}; +zone "example.org" in { + type master; + allow-update {keys "update-key";}; + .... +}; + + diff --git a/code/chapter12/F1226NS.txt b/code/chapter12/F1226NS.txt new file mode 100644 index 0000000..3b92afd --- /dev/null +++ b/code/chapter12/F1226NS.txt @@ -0,0 +1,19 @@ +// named.conf fragment +options { +.... + also-notify {10.1.0.15; 172.28.32.7;}; // all zones +.... +}; +.... +zone "example.com in{ +.... + also-notify {10.0.1.2;}; // only this host + those in NS RRs for zone +.... +}; +zone "example.net in{ +.... + notify no; // no NOTIFY for zone +.... +}; + + diff --git a/code/chapter12/F1227NS.txt b/code/chapter12/F1227NS.txt new file mode 100644 index 0000000..750ccfb --- /dev/null +++ b/code/chapter12/F1227NS.txt @@ -0,0 +1,23 @@ +options { +.... + also-notify {10.1.0.15; 172.28.32.7;}; // all zones +.... +}; +.... +zone "example.com in{ +.... + // NS RRs and global also-notify + // default behavior so could have been omitted + notify yes; +.... +}; +zone "example.net in{ +.... + // no NOTIFY to NS RRs + // NOTIFY to global also-notify IPs + notify explicit; +.... +}; + + + diff --git a/code/chapter12/F1228NS.txt b/code/chapter12/F1228NS.txt new file mode 100644 index 0000000..22ca7c5 --- /dev/null +++ b/code/chapter12/F1228NS.txt @@ -0,0 +1,9 @@ +options { +.... + notify-source-v6 {2001:db8:0:1::3;}; // all zones +.... +}; + + + + diff --git a/code/chapter12/F1229NS.txt b/code/chapter12/F1229NS.txt new file mode 100644 index 0000000..c652a00 --- /dev/null +++ b/code/chapter12/F1229NS.txt @@ -0,0 +1,12 @@ +// named.conf fragment +zone "example.com" in { + type slave; + ... + // force transfers onto one interface + transfer-source 192.168.254.4; +}; + + + + + diff --git a/code/chapter12/F1230NS.txt b/code/chapter12/F1230NS.txt new file mode 100644 index 0000000..767a154 --- /dev/null +++ b/code/chapter12/F1230NS.txt @@ -0,0 +1,13 @@ +// named.conf fragment +zone "example.com" in { + type master; + ... + // permit transfer + allow-transfer 192.168.254.4; +}; + + + + + + diff --git a/code/chapter12/F1231NS.txt b/code/chapter12/F1231NS.txt new file mode 100644 index 0000000..e1dfb47 --- /dev/null +++ b/code/chapter12/F1231NS.txt @@ -0,0 +1,12 @@ +zone "example.com" in { + type master; + .... + update-policy { grant * self * A;}; +}; + + + + + + + diff --git a/code/chapter12/F1232NS.txt b/code/chapter12/F1232NS.txt new file mode 100644 index 0000000..47eef4d --- /dev/null +++ b/code/chapter12/F1232NS.txt @@ -0,0 +1,24 @@ +options { +.... + // turns on IPv6 for port 53 + listen-on-v6 {any;}; +}; +options { +.... + // turns off IPv6 + listen-on-v6 {none;}; +}; + +options { +.... + // turns on IPv6 for port 53 for 16 IP range + listen-on-v6 {2001:db8::/124;}; +}; + + + + + + + + diff --git a/code/chapter12/F1233ZS.txt b/code/chapter12/F1233ZS.txt new file mode 100644 index 0000000..a49d99d --- /dev/null +++ b/code/chapter12/F1233ZS.txt @@ -0,0 +1,16 @@ +// zone file example.com +$ORIGIN example.com. +lots IN A 192.168.3.6 + IN A 192.168.4.5 + IN A 192.168.5.5 + IN A 10.2.4.5 + IN A 172.17.4.5 + + + + + + + + + diff --git a/code/chapter12/F1234NS.txt b/code/chapter12/F1234NS.txt new file mode 100644 index 0000000..dea1c83 --- /dev/null +++ b/code/chapter12/F1234NS.txt @@ -0,0 +1,21 @@ +options { + .... + sortlist { + 192.168.4/24; // 1st client IP selection + {10.2/16; // 1st preference + 172.17.4/24; // 2nd preference + }; + 192.168.5/24; // 2nd client IP selection + {192.168.4/24; // 1st preference + 172.18/24; // 2nd preference + 10.2/16; // 3rd preference + }; + }; +}; + + + + + + + diff --git a/code/chapter12/F1235NS.txt b/code/chapter12/F1235NS.txt new file mode 100644 index 0000000..bd40264 --- /dev/null +++ b/code/chapter12/F1235NS.txt @@ -0,0 +1,13 @@ +// named.conf fragment +zone "example.com" in { + type slave; + // defines an optional file used to save slave zone data + file "slave.example.com"; + ... +}; +zone "example.net" in { + type master; + // defines a master zone file + file "master.example.net"; + .... +}; diff --git a/code/chapter12/F1236NS.txt b/code/chapter12/F1236NS.txt new file mode 100644 index 0000000..0fb1e8c --- /dev/null +++ b/code/chapter12/F1236NS.txt @@ -0,0 +1,6 @@ +// named.conf fragment +zone "example.com" in { + type slave; + file "slave.example.com"; + masters {192.168.2.7; 10.2.3.15 port 1127; 2001:db8:0:1::15;}; +}; diff --git a/code/chapter13/F1301ZS.txt b/code/chapter13/F1301ZS.txt new file mode 100644 index 0000000..b36c45f --- /dev/null +++ b/code/chapter13/F1301ZS.txt @@ -0,0 +1,16 @@ +; this is a full-line comment +$TTL 12h ; directive - comment terminates the line +$ORIGIN example.com. +; Start of Authority (SOA) record defining the zone (domain) +; illustrates an RR record spread over more than one line +; using the enclosing parentheses +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; se = serial number + 3h ; ref = refresh + 15m ; ret = update retry + 3w ; ex = expiry + 2h20m ; min = minimum + ) +; single line RR + IN NS ns1.example.com. ;with a comment +... diff --git a/code/chapter13/F1302ZS.txt b/code/chapter13/F1302ZS.txt new file mode 100644 index 0000000..a74c6f4 --- /dev/null +++ b/code/chapter13/F1302ZS.txt @@ -0,0 +1,11 @@ +$ORIGIN example.com. +; unqualified names from here will append example.com. +www IN A 192.168.2.2 ; unqualified +; www expands to www.example.com. +... +ftp.example.com. IN A 192.168.2.3 ; FQDN +... +$ORIGIN us.example.com. +; unqualified names from here will append us.example.com. +www IN A 192.168.254.2 ; unqualified +; www expands to www.us.example.com. diff --git a/code/chapter13/F1303ZS.txt b/code/chapter13/F1303ZS.txt new file mode 100644 index 0000000..04e0159 --- /dev/null +++ b/code/chapter13/F1303ZS.txt @@ -0,0 +1,7 @@ +$ORIGIN us.example.com. +... +mail IN A 192.168.35.12 +; expands to mail.us.example.com. +$INCLUDE /var/named/zones/sub.example.com ; absolute path no $ORIGIN +ftp IN A 192.168.35.16 +; expands to ftp.us.example.com. diff --git a/code/chapter13/F1304ZS.txt b/code/chapter13/F1304ZS.txt new file mode 100644 index 0000000..3df612d --- /dev/null +++ b/code/chapter13/F1304ZS.txt @@ -0,0 +1,5 @@ +; INCLUDE file statements +www IN A 192.168.23.15 +; expands to www.us.example.com +... +; end of included file diff --git a/code/chapter13/F1305ZS.txt b/code/chapter13/F1305ZS.txt new file mode 100644 index 0000000..f6b11c5 --- /dev/null +++ b/code/chapter13/F1305ZS.txt @@ -0,0 +1,8 @@ +$ORIGIN us.example.com. +... +mail IN A 192.168.35.15 +; expands to mail.us.example.com. +$INCLUDE sub.example.com uk.example.com. ; overrides current $ORIGIN +; $ORIGIN reverts to value before the $INCLUDE directive +ftp IN A 192.168.35.16 +; expands to ftp.us.example.com diff --git a/code/chapter13/F1306ZS.txt b/code/chapter13/F1306ZS.txt new file mode 100644 index 0000000..f169028 --- /dev/null +++ b/code/chapter13/F1306ZS.txt @@ -0,0 +1,5 @@ +; INCLUDE file statements +www IN A 192.168.23.15 +; expands to www.uk.example.com +... +; end of included file diff --git a/code/chapter13/F1307ZS.txt b/code/chapter13/F1307ZS.txt new file mode 100644 index 0000000..5e7bcdb --- /dev/null +++ b/code/chapter13/F1307ZS.txt @@ -0,0 +1,8 @@ +$ORIGIN us.example.com. +... +mail IN A 192.168.35.15 +; expands to mail.us.example.com. +$INCLUDE sub.example.com ; no $ORIGIN +; $ORIGIN reverts to value before the $INCLUDE directive +ftp IN A 192.168.35.16 +; expands to ftp.us.example.com diff --git a/code/chapter13/F1308ZS.txt b/code/chapter13/F1308ZS.txt new file mode 100644 index 0000000..780852e --- /dev/null +++ b/code/chapter13/F1308ZS.txt @@ -0,0 +1,6 @@ +; INCLUDE file statements +$ORIGIN uk.example.com. +www IN A 192.168.23.15 +; expands to www.uk.example.com +... +; end of included file diff --git a/code/chapter13/F1309ZS.txt b/code/chapter13/F1309ZS.txt new file mode 100644 index 0000000..7407a5c --- /dev/null +++ b/code/chapter13/F1309ZS.txt @@ -0,0 +1,8 @@ +$ORIGIN 199.168.192.IN-ADDR.ARPA. +..... +65 IN CNAME 65.64/26 +66 IN CNAME 66.64/26 +67 IN CNAME 67.64/26 +.... +125 IN CNAME 125.64/26 +126 IN CNAME 126.64/26 diff --git a/code/chapter13/F1310ZS.txt b/code/chapter13/F1310ZS.txt new file mode 100644 index 0000000..0f1af51 --- /dev/null +++ b/code/chapter13/F1310ZS.txt @@ -0,0 +1,23 @@ +$ORIGIN IPV6.ARPA. +; first 16 bits +..... +\[x2001/16] IN DNAME tla.example.org. +..... + +$ORIGIN tla.example.org. +; next 13 bits +..... +\[x0db8/13] IN DNAME nla.example.net. +..... + +$ORIGIN nla.example.net. +; next 19 bits only possible with binary format +..... +\[b0010000000000111101] IN DNAME ip6.example.com. +..... + +$ORIGIN ip6.example.com. +; last 80 bits +..... +\[x000100000001/80] IN PTR bill.example.com. +..... diff --git a/code/chapter13/F1311ZS.txt b/code/chapter13/F1311ZS.txt new file mode 100644 index 0000000..443da8f --- /dev/null +++ b/code/chapter13/F1311ZS.txt @@ -0,0 +1,8 @@ +; zone file fragment +$TTL 2d ;172800 seconds +$ORIGIN example.com. +.... + 3w IN MX 10 mail.example.com. + 4h IN MX 10 mail.example.com. + IN MX 20 mail.example.net. +.... diff --git a/code/chapter13/F1312ZS.txt b/code/chapter13/F1312ZS.txt new file mode 100644 index 0000000..d402535 --- /dev/null +++ b/code/chapter13/F1312ZS.txt @@ -0,0 +1,15 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... +joe IN A 192.168.0.3 ; joe & www = same ip +www IN A 192.168.0.3 +; could be rewritten as +; www.example.com. A 192.168.0.3 +fred 3600 IN A 192.168.0.4 ; ttl overrides $TTL default +ftp IN A 192.168.0.5 ; round-robin with next + IN A 192.168.0.6 +mail IN A 192.168.0.15 ; mail = round-robin +mail IN A 192.168.0.32 +mail IN A 192.168.0.33 +squat IN A 10.0.14.13 ; address in another range & class diff --git a/code/chapter13/F1313ZS.txt b/code/chapter13/F1313ZS.txt new file mode 100644 index 0000000..338becb --- /dev/null +++ b/code/chapter13/F1313ZS.txt @@ -0,0 +1,10 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... +joe IN A6 64 ::1 subnet1.example.com. +.... +; the next A6 RR defines the subnet ID only (16 bits) and +; references a further A6 RR for the remaining 48 bits +subnet1 IN A6 48 0:0:0:1:: example-com.example.net. +.... diff --git a/code/chapter13/F1314ZS.txt b/code/chapter13/F1314ZS.txt new file mode 100644 index 0000000..e225bf7 --- /dev/null +++ b/code/chapter13/F1314ZS.txt @@ -0,0 +1,7 @@ +$ORIGIN example.net. +; NLA assigns 19 bits +example-com IN A6 29 0:2:ddef:: ipv6.example.org. + +$ORIGIN example.org. +; SLA assigns remaining 29 bits +example-com IN A6 0 2001:db8:: diff --git a/code/chapter13/F1315ZS.txt b/code/chapter13/F1315ZS.txt new file mode 100644 index 0000000..84debdf --- /dev/null +++ b/code/chapter13/F1315ZS.txt @@ -0,0 +1,15 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... +joe IN AAAA 2001:db8::3 ; joe & www = same ip +www IN AAAA 2001:db8::3 +; functionally the same as the preceding record +www.example.com. AAAA 2001:db8::3 +fred 3600 IN AAAA 2001:db8::4 ; ttl =3600 overrides $TTL default +ftp IN AAAA 2001:db8::5 ; round robin with next + IN AAAA 2001:db8::6 +mail IN AAAA 2001:db8::7 ; mail = round robin +mail IN AAAA 2001:db8::32 +mail IN AAAA 2001:db8::33 +squat IN AAAA 2001:db8:0:0:1::13 ; address in another subnet diff --git a/code/chapter13/F1316ZS.txt b/code/chapter13/F1316ZS.txt new file mode 100644 index 0000000..1759dda --- /dev/null +++ b/code/chapter13/F1316ZS.txt @@ -0,0 +1,9 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... + +www IN A 192.168.0.3 +mail IN A 192.168.0.32 +www IN AAAA 2001:db8::3 +mail IN AAAA 2001:db8::32 diff --git a/code/chapter13/F1317ZS.txt b/code/chapter13/F1317ZS.txt new file mode 100644 index 0000000..3f31771 --- /dev/null +++ b/code/chapter13/F1317ZS.txt @@ -0,0 +1,8 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... +www IN A 192.168.0.3 + IN AAAA 2001:db8::3 +mail IN A 192.168.0.32 + IN AAAA 2001:db8::32 diff --git a/code/chapter13/F1318ZS.txt b/code/chapter13/F1318ZS.txt new file mode 100644 index 0000000..ee008e7 --- /dev/null +++ b/code/chapter13/F1318ZS.txt @@ -0,0 +1,9 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +... +@ IN AFSDB 1 joe.example.com. + IN AFSDB 1 bill.example.com. +joe IN A 192.168.254.3 +bill IN A 192.168.254.4 +.... diff --git a/code/chapter13/F1319ZS.txt b/code/chapter13/F1319ZS.txt new file mode 100644 index 0000000..6c3b5fe --- /dev/null +++ b/code/chapter13/F1319ZS.txt @@ -0,0 +1,12 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +... +nat-pt IN A 192.168.254.3 + IN AAAA 2001:db8::17 + IN APL ( + 1:192.168.254.0/27 ; IPv4 = 32 + 2:2001:db8::0/122 ; IPv6 = 64 + !2:2001:db8::37/128 ; excluding 1 IPv6 + ) +.... diff --git a/code/chapter13/F1320ZS.txt b/code/chapter13/F1320ZS.txt new file mode 100644 index 0000000..4a3a166 --- /dev/null +++ b/code/chapter13/F1320ZS.txt @@ -0,0 +1,7 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... +server1 IN A 192.168.0.3 +www IN CNAME server1 +ftp IN CNAME server1 diff --git a/code/chapter13/F1321ZS.txt b/code/chapter13/F1321ZS.txt new file mode 100644 index 0000000..44597c9 --- /dev/null +++ b/code/chapter13/F1321ZS.txt @@ -0,0 +1,7 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... + IN MX 10 mail.example.com. +mail IN CNAME server1 +server1 IN A 192.168.0.3 diff --git a/code/chapter13/F1322ZS.txt b/code/chapter13/F1322ZS.txt new file mode 100644 index 0000000..10bcba0 --- /dev/null +++ b/code/chapter13/F1322ZS.txt @@ -0,0 +1,7 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... + IN MX 10 mail.example.com. +server1 IN CNAME mail +mail IN A 192.168.0.3 diff --git a/code/chapter13/F1323ZS.txt b/code/chapter13/F1323ZS.txt new file mode 100644 index 0000000..9f5956e --- /dev/null +++ b/code/chapter13/F1323ZS.txt @@ -0,0 +1,5 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... +ftp IN CNAME ftp.example.net. diff --git a/code/chapter13/F1324ZS.txt b/code/chapter13/F1324ZS.txt new file mode 100644 index 0000000..b616e82 --- /dev/null +++ b/code/chapter13/F1324ZS.txt @@ -0,0 +1,8 @@ +; www.example.com and example.com access +$TTL 2d ; zone default = 2 days +$ORIGIN example.com. +; resolves example.com to an IP +@ IN A 192.168.254.8 + IN A 192.168.254.9 + IN A 192.168.254.10 +www IN CNAME example.com. diff --git a/code/chapter13/F1325ZS.txt b/code/chapter13/F1325ZS.txt new file mode 100644 index 0000000..579b560 --- /dev/null +++ b/code/chapter13/F1325ZS.txt @@ -0,0 +1,6 @@ +; zone file fragment for example.com +$TTL 2d ; zone default = 2 days +$ORIGIN example.com. +.... +www IN A 192.168.254.8 + IN HINFO "AMD 64 4.8GHZ 10TB" "FreeBSD 5.3" diff --git a/code/chapter13/F1326ZS.txt b/code/chapter13/F1326ZS.txt new file mode 100644 index 0000000..0bb8672 --- /dev/null +++ b/code/chapter13/F1326ZS.txt @@ -0,0 +1,12 @@ +; yahoo.com LOC RR +yahoo.com. IN LOC 37 23 30.900 N 121 59 19.000 W 7.00m 100m 100m 2m +; Stamford, CT, US - Harbor Lighthouse + IN LOC 41 00 48 N 73 32 21 W 10m +; Kilmarnock, Scotland UK + IN LOC { + 55 ;latitude + 38 ; seconds omitted + N + 4 32 W ; longitude + 100m ; altitude - pure guess + ) diff --git a/code/chapter13/F1327ZS.txt b/code/chapter13/F1327ZS.txt new file mode 100644 index 0000000..690d278 --- /dev/null +++ b/code/chapter13/F1327ZS.txt @@ -0,0 +1,15 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) + IN MX 10 mail.example.com. +hostmaster IN MB bill.example.com. +bill IN A 192.168.254.2 +mail IN A 192.168.254.3 +.... diff --git a/code/chapter13/F1328ZS.txt b/code/chapter13/F1328ZS.txt new file mode 100644 index 0000000..8e128b2 --- /dev/null +++ b/code/chapter13/F1328ZS.txt @@ -0,0 +1,20 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) + IN MX 10 mail.example.com. +hostmaster IN MG phil.example.com. + IN MG sheila.example.com. +phil IN MB bill.example.com. +sheila IN MB pc.example.com. +.... +pc IN A 192.168.254.4 +bill IN A 192.168.254.2 +mail IN A 192.168.254.3 +.... diff --git a/code/chapter13/F1329ZS.txt b/code/chapter13/F1329ZS.txt new file mode 100644 index 0000000..be25077 --- /dev/null +++ b/code/chapter13/F1329ZS.txt @@ -0,0 +1,18 @@ +; zone file fragment for example.com +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) + IN MX 10 mail.example.com. +hostmaster IN MR phil.example.com. +phil IN MB bill.example.com. +.... +bill IN A 192.168.254.2 +mail IN A 192.168.254.3 +.... diff --git a/code/chapter13/F1330ZS.txt b/code/chapter13/F1330ZS.txt new file mode 100644 index 0000000..57a52b7 --- /dev/null +++ b/code/chapter13/F1330ZS.txt @@ -0,0 +1,18 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) + IN MX 10 mail.example.com. +people IN MINFO admin.example.com. broken.example.com. +admin IN MB bill.example.com. +broken IN MB bill.example.com. +.... +bill IN A 192.168.254.2 +mail IN A 192.168.254.3 +.... diff --git a/code/chapter13/F1331ZS.txt b/code/chapter13/F1331ZS.txt new file mode 100644 index 0000000..fc95a5d --- /dev/null +++ b/code/chapter13/F1331ZS.txt @@ -0,0 +1,21 @@ +; zone fragment for example.com +; mail servers in the same zone +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) + IN MX 10 mail ; unqualified name +; the line above is functionally the same as the line that follows +; example.com. IN MX 10 mail.example.com. +; any number of mail servers may be defined + IN MX 20 mail2.example.com. +; an external back-up + IN MX 30 mail.example.net. +; the local mail servers need an A record +mail IN A 192.168.0.3 +mail2 IN A 192.168.0.3 diff --git a/code/chapter13/F1332ZS.txt b/code/chapter13/F1332ZS.txt new file mode 100644 index 0000000..faf1237 --- /dev/null +++ b/code/chapter13/F1332ZS.txt @@ -0,0 +1,16 @@ +; zone fragment for example.com +; mail servers in the same zone +; zone fragment for example.com +; mail servers not in the zone +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. root.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) +; mail servers not in zone - no A records required + IN MX 10 mail.example.net. + IN MX 20 mail.example.org. diff --git a/code/chapter13/F1333ZS.txt b/code/chapter13/F1333ZS.txt new file mode 100644 index 0000000..3e1b513 --- /dev/null +++ b/code/chapter13/F1333ZS.txt @@ -0,0 +1,31 @@ +; zone fragment for example.com +; subdomain name servers +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 2h ; refresh = 2 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) +.... +; mail server for main domain + IN MX 10 mail.example.com. +; A record for mail server earlier +mail IN A 192.168.0.5 +; other domain level hosts and services +.... +; subdomain definitions +$ORIGIN us.example.com. + IN MX 10 mail +; preceding record could have been written as +; us.example.com. IN MX 10 mail.us.example.com. +; optional - define the main mail server as backup + IN MX 20 mail.example.com. +; A record for subdomain mail server +mail IN A 10.10.0.29 +; the preceding record could have been written as +; mail.us.example.com. A 10.10.0.29 if it is less confusing +.... +; other subdomain definitions as required diff --git a/code/chapter13/F1334ZS.txt b/code/chapter13/F1334ZS.txt new file mode 100644 index 0000000..a15a35b --- /dev/null +++ b/code/chapter13/F1334ZS.txt @@ -0,0 +1,29 @@ +; zone fragment for example.com +; subdomain mail servers +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 2h ; refresh = 2 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) +.... +; mail server for main domain + IN MX 10 mail.example.com. +; mail server for subdomain 'us' +us IN MX 10 mail.us.example.com. +us IN MX 20 mail.example.com. +; A record for main mail server earlier +mail IN A 192.168.0.5 +; other domain level hosts and services +.... +; subdomain definitions +$ORIGIN us.example.com. +; A record for subdomain mail server +mail IN A 10.10.0.29 +; the record above could have been written as +; mail.us.example.com. A 10.10.0.28 if it is less confusing +.... +; other subdomain definitions as required diff --git a/code/chapter13/F1335ZS.txt b/code/chapter13/F1335ZS.txt new file mode 100644 index 0000000..9c92e3f --- /dev/null +++ b/code/chapter13/F1335ZS.txt @@ -0,0 +1,13 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN 5.5.5.1.1.1.4.4.E164.ARPA. +.... +2.1.2.1 NAPTR ( + 10 ;order + 100 ; prerference + "u" ; flag + "E2U+sip" ;svc + "!^\\+44111555(.#)$!sip:7\\1@sip.example.com!" + .) ; replace + NAPTR 10 101 "u" "E2U+pres" "!^.*$!mailto:sheila@example.com!" . +.... diff --git a/code/chapter13/F1336ZS.txt b/code/chapter13/F1336ZS.txt new file mode 100644 index 0000000..4288506 --- /dev/null +++ b/code/chapter13/F1336ZS.txt @@ -0,0 +1,19 @@ +; zone fragment for example.com +; name servers in the same zone +$TTL 2d ; default TTL is 2 days +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) + IN NS ns1 ; unqulaified name +; the preceding line is functionally the same as the line that follows +; example.com. IN NS ns1.example.com. +; at least two name servers must be defined + IN NS ns2.example.com. ;FQDN +; the in-zone name server(s) should have an A record +ns1 IN A 192.168.0.3 +ns2 IN A 192.168.0.3 diff --git a/code/chapter13/F1337ZS.txt b/code/chapter13/F1337ZS.txt new file mode 100644 index 0000000..f2eb4d9 --- /dev/null +++ b/code/chapter13/F1337ZS.txt @@ -0,0 +1,14 @@ +; zone fragment for example.com +; name servers not in the zone +$TTL 2d ; default TTL is 2 days +$ORIGIN example.com. +example.com. IN SOA ns1.example.net. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) +; name servers not in zone - no A records required + IN NS ns1.example.net. + IN NS ns2.example.net. diff --git a/code/chapter13/F1338ZS.txt b/code/chapter13/F1338ZS.txt new file mode 100644 index 0000000..e6ed940 --- /dev/null +++ b/code/chapter13/F1338ZS.txt @@ -0,0 +1,32 @@ +; zone fragment for example.com +; name servers in the same zone +$TTL 2d ; default TTL is 2 days +$ORIGIN example.com. +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 2h ; refresh = 2 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) +; main domain name servers + IN NS ns1.example.com. + IN NS ns2.example.com. +; A records for name servers above +ns1 IN A 192.168.0.3 +ns2 IN A 192.168.0.4 +.... +; subdomain definitions +$ORIGIN us.example.com. +; two name servers for the subdomain +@ IN NS ns3.us.example.com. +; the record above could have been written as +; us.example.com. IN NS ns3.us.example.com. +; OR as simply +; IN NS ns3 +; the next name server points to ns1 above + IN NS ns1.example.com. +; address record for subdomain name server - essential glue record +ns3 IN A 10.10.0.24 ; glue record +; the record above could have been written as +; ns3.us.example.com. A 10.10.0.24 if it is less confusing diff --git a/code/chapter13/F1339ZS.txt b/code/chapter13/F1339ZS.txt new file mode 100644 index 0000000..1426a73 --- /dev/null +++ b/code/chapter13/F1339ZS.txt @@ -0,0 +1,17 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) + IN MX 10 mail.example.com. +.... +fred IN A 192.168.254.2 + IN NSAP 0x47.0005.80.005a00.0000.0001.e133.ffffff000161.00 +.... +mail IN A 192/168.254.3 +.... diff --git a/code/chapter13/F1340ZS.txt b/code/chapter13/F1340ZS.txt new file mode 100644 index 0000000..b020798 --- /dev/null +++ b/code/chapter13/F1340ZS.txt @@ -0,0 +1,12 @@ +; reverse zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN 3.3.1.e.1.0.0.0.0.0.0.0.0.0.a.5.0.0.0.8.5.0.0.0.7.4.NSAP.INT. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) +.... +0.0.1.6.1.0.0.0.f.f.f.f.f.f IN PTR fred.example.com. diff --git a/code/chapter13/F1341ZS.txt b/code/chapter13/F1341ZS.txt new file mode 100644 index 0000000..1cc593a --- /dev/null +++ b/code/chapter13/F1341ZS.txt @@ -0,0 +1,13 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... +mail IN A 192,168.2.3 + IN AAAA 2001:db8::3 + IN TXT "one upon a time" + IN KX 10 bill.example.com. + IN RRSIG + IN NSEC www (A TXT KX AAAA NSEC RRSIG) +www IN AAAA 2001:db8::4 + IN A 192.168.2.4 + IN NSEC @ (A AAAA) ; loops back to SOA diff --git a/code/chapter13/F1342ZS.txt b/code/chapter13/F1342ZS.txt new file mode 100644 index 0000000..5e81acc --- /dev/null +++ b/code/chapter13/F1342ZS.txt @@ -0,0 +1,22 @@ +; Reverse map for 192.168.23.0 +$TTL 12h +$ORIGIN 23.168.192.IN-ADDR.ARPA. +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh + 15m ; update retry + 3w ; expiry + 3h ; minimum + ) + IN NS ns1.example.com. + IN NS ns2.example.com. +.... +2 IN PTR joe.example.com. ; right-hand FQDN names +; 2 is an unqualified name and could have been written as +; 2.23.168.192.IN-ADDR.ARPA. IN PTR joe.example.com. +.... +15 IN PTR www.example.com. +.... +17 IN PTR bill.example.com. +.... +254 IN PTR fred.mydomain.com. diff --git a/code/chapter13/F1343ZS.txt b/code/chapter13/F1343ZS.txt new file mode 100644 index 0000000..c30862a --- /dev/null +++ b/code/chapter13/F1343ZS.txt @@ -0,0 +1,22 @@ +; reverse IPV6 zone file for example.com +$TTL 2d ; default TTL for zone +$ORIGIN 0.0.0.0.8.b.d.0.1.0.0.2.IP6.ARPA. +@ IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; sn = serial number + 12h ; refresh = refresh + 15m ; retry = update retry + 3w ; expiry = expiry + 2h ; min = minimum + ) +; name servers Resource Recordsfor the domain + IN NS ns1.example.com. +; the second name servers is +; external to this zone (domain). + IN NS ns2.example.net. +; PTR RR maps a IPv6 address to a host name +; hosts in subnet ID 1 +1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0 IN PTR ns1.example.com. +2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0 IN PTR mail.example.com. +; hosts in subnet ID 2 +1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0 IN PTR joe.example.com. +2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0 IN PTR www.example.com. diff --git a/code/chapter13/F1344ZS.txt b/code/chapter13/F1344ZS.txt new file mode 100644 index 0000000..f877ecc --- /dev/null +++ b/code/chapter13/F1344ZS.txt @@ -0,0 +1,16 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +example.com. IN SOA ns1.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 3h ; refresh = 3 hours + 15M ; update retry = 15 minutes + 3W12h ; expiry = 3 weeks + 12 hours + 2h20M ; minimum = 2 hours + 20 minutes + ) + IN NS ns1.example.com. + IN NS ns2.example.com. +*.example.com. IN PX 10 example.com. PRMD-example.ADMD-p400.C-nl. +ns1 IN A 192.168.254.2 +ns2 IN A 192.168.254.3 +www IN A 192.168.254.4 diff --git a/code/chapter13/F1345ZS.txt b/code/chapter13/F1345ZS.txt new file mode 100644 index 0000000..32c03b6 --- /dev/null +++ b/code/chapter13/F1345ZS.txt @@ -0,0 +1,16 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +... +www IN A 192.168.254.2 + IN A 192.168.254.3 + IN RP bill.example.com. bill.people.example.com. +; could have been written as +; IN RP bill bill.people +; line that follows uses an e-mail external to the domain +; and has no corresponding text record (replaced with a single dot) + IN RP fred.example.net. . +... +; all people records organized under people +bill.people IN TXT "Bill Someone - pager = 111-1111" +.... diff --git a/code/chapter13/F1346ZS.txt b/code/chapter13/F1346ZS.txt new file mode 100644 index 0000000..27fccf5 --- /dev/null +++ b/code/chapter13/F1346ZS.txt @@ -0,0 +1,10 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +... +fred IN A 192.168.254.2 +joe IN A 192.168.254.3 +bill IN A 192.168.254.4 + IN RT 10 fred.example.com. + IN RT 20 joe.example.com. +.... diff --git a/code/chapter13/F1347ZS.txt b/code/chapter13/F1347ZS.txt new file mode 100644 index 0000000..f33f42c --- /dev/null +++ b/code/chapter13/F1347ZS.txt @@ -0,0 +1,12 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +@ IN SOA ns.example.net. hostmaster.example.com. ( + 2003080800 ; serial number + 1d12h ; refresh = 1 day 12 hours + 15m ; update retry = 15 minutes + 3w12h ; expiry = 3 weeks + 12 hours + 2h20m ; minimum = 2 hours + 20 minutes + ) + IN NS ns.example.net. ;name servers + IN NS ns.example.org. diff --git a/code/chapter13/F1348ZS.txt b/code/chapter13/F1348ZS.txt new file mode 100644 index 0000000..4bdfa70 --- /dev/null +++ b/code/chapter13/F1348ZS.txt @@ -0,0 +1,12 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +@ IN SOA ns.example.net. hostmaster ( + 2003080800 ; serial number + 1d12h ; refresh = 1 day 12 hours + 15m ; update retry = 15 minutes + 3w12h ; expiry = 3 weeks + 12 hours + 2h20m ; minimum = 2 hours + 20 minutes + ) + IN NS ns.example.net. ;name servers + IN NS ns.example.org. diff --git a/code/chapter13/F1349ZS.txt b/code/chapter13/F1349ZS.txt new file mode 100644 index 0000000..03bb1ac --- /dev/null +++ b/code/chapter13/F1349ZS.txt @@ -0,0 +1,15 @@ +; zone file fragment for example.com +$TTL 2d ; zone TTL default = 2 days or 172800 seconds +$ORIGIN example.com. +@ IN SOA ns.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 1d12h ; refresh = 1 day 12 hours + 15m ; update retry = 15 minutes + 3w12h ; expiry = 3 weeks + 12 hours + 2h20m ; minimum = 2 hours + 20 minutes + ) + IN NS ns.example.com. + IN NS ns.example.net. +... +; A record required for internal name server +ns IN A 192.168.2.1 diff --git a/code/chapter13/F1350ZS.txt b/code/chapter13/F1350ZS.txt new file mode 100644 index 0000000..384a79c --- /dev/null +++ b/code/chapter13/F1350ZS.txt @@ -0,0 +1,18 @@ +; zone file fragment for example.com. +$TTL 2d ; zone TTL default = 2 days +$ORIGIN example.com. +@ SOA server.example.com. hostmaster.example.com. ( + 2003080800 ; serial number + 1d12h ; refresh = 1 day 12 hours + 15m ; update retry = 15 minutes + 3w12h ; expiry = 3 weeks + 12 hours + 2h20m ; minimum = 2 hours + 20 minutes + ) +... +_http._tcp SRV 10 1 80 slow.example.com. + SRV 10 3 80 fast.example.com. +; if neither slow or fast available, switch to +; an external backup web server but use port 8100 not port 80 + SRV 20 0 8100 backup.example.net. +slow A 192.168.254.3 +fast A 192.168.254.4 diff --git a/code/chapter13/F1351ZS.txt b/code/chapter13/F1351ZS.txt new file mode 100644 index 0000000..642a56e --- /dev/null +++ b/code/chapter13/F1351ZS.txt @@ -0,0 +1,8 @@ +; zone fragment for example.com +$TTL 2d ; zone default = 2 days or 172800 seconds +$ORIGIN example.com. +.... +www IN A 192.168.0.3 + IN SSHFP 1 1 (AABB12AA334477 + CD1234a57890) +.... diff --git a/code/chapter13/F1352ZS.txt b/code/chapter13/F1352ZS.txt new file mode 100644 index 0000000..8fca390 --- /dev/null +++ b/code/chapter13/F1352ZS.txt @@ -0,0 +1,9 @@ +; zone file fragment for example.com +$TTL 2d ; zone default = 2 days +$ORIGIN example.com. +.... +@ IN A 192.168.254.8 + IN A 192.168.254.9 + IN A 192.168.254.10 + IN TXT "Example.com web service is here" +www IN CNAME example.com. diff --git a/code/chapter13/F1353ZS.txt b/code/chapter13/F1353ZS.txt new file mode 100644 index 0000000..4531f51 --- /dev/null +++ b/code/chapter13/F1353ZS.txt @@ -0,0 +1,14 @@ +; zone file fragment for example.com +$TTL 2d ; zone default = 2 days +$ORIGIN example.com. +.... +@ IN WKS 192.168.254.2 TCP telnet http + IN WKS 192.168.254.3 { + telnet + smptp ;some comment about this service + ftp + } +.... +bill IN 192.168.254.2 +fred IN 192.168.254.2 +... diff --git a/code/chapter13/F1354ZS.txt b/code/chapter13/F1354ZS.txt new file mode 100644 index 0000000..48d9c8a --- /dev/null +++ b/code/chapter13/F1354ZS.txt @@ -0,0 +1,8 @@ +example.com. IN DNSKEY 256 3 5 ( + AQPSKmynfzW4kyBv015MUG2DeIQ3 + Cbl+BBZH4b/0PY1kxkmvHjcZc8no + kfzj31GajIQKY+5CptLr3buXA10h + WqTkF7H6RfoRqXQeogmMHfpftf6z + Mv1LyBUgia7za6ZEzOJBOztyvhjL + 742iU/TpPSEDhm2SNKLijfUppn1U + aNvv4w== ) diff --git a/code/chapter13/F1355ZS.txt b/code/chapter13/F1355ZS.txt new file mode 100644 index 0000000..d909480 --- /dev/null +++ b/code/chapter13/F1355ZS.txt @@ -0,0 +1,8 @@ +example.com. IN DNSKEY 256 3 254 (1.3.6.1.4.1.X.22.55.4.3 + AQPSKmynfzW4kyBv015MUG2DeIQ3 + Cbl+BBZH4b/0PY1kxkmvHjcZc8no + kfzj31GajIQKY+5CptLr3buXA10h + WqTkF7H6RfoRqXQeogmMHfpftf6z + Mv1LyBUgia7za6ZEzOJBOztyvhjL + 742iU/TpPSEDhm2SNKLijfUppn1U + aNvv4w== ) diff --git a/code/chapter13/F1356ZS.txt b/code/chapter13/F1356ZS.txt new file mode 100644 index 0000000..d909480 --- /dev/null +++ b/code/chapter13/F1356ZS.txt @@ -0,0 +1,8 @@ +example.com. IN DNSKEY 256 3 254 (1.3.6.1.4.1.X.22.55.4.3 + AQPSKmynfzW4kyBv015MUG2DeIQ3 + Cbl+BBZH4b/0PY1kxkmvHjcZc8no + kfzj31GajIQKY+5CptLr3buXA10h + WqTkF7H6RfoRqXQeogmMHfpftf6z + Mv1LyBUgia7za6ZEzOJBOztyvhjL + 742iU/TpPSEDhm2SNKLijfUppn1U + aNvv4w== ) diff --git a/code/chapter14/F1401CF.txt b/code/chapter14/F1401CF.txt new file mode 100644 index 0000000..c8fe45c --- /dev/null +++ b/code/chapter14/F1401CF.txt @@ -0,0 +1,208 @@ +// example sdb driver for BIND +// reads and parses zone file into ram structure +// INCLUDES +// add any required std function includes used by driver +#include // for fopen etc. + +// BIND includes +#include // required for isc_mem_t structure +#include // result codes +#include // std headers for all sdb functions +#include // BIND globals +#include // for isc_log_write +// driver includes +#include "example.h" // header for sample driver + +// DEFINES and MACROS +#define DRIVERNAME "example" +#define PRIVATE static +#define EXAMPLE_ZONE_SIZE (2 * 1024) // fixed memory allocation +#define FILENAME_SIZE 50 +#define BUFFER_SIZE 200 +// STRUCTURES +/* trivial structure to hold RRs */ +typedef struct rrset_tag{ + char owner[30]; // owner name + unsigned int ttl; // TTL + char type[10]; // RR type + char rdata[50]; // rdata +}RRSET, *RRSET_ID; +// PRIVATE PROTOTYPES +PRIVATE isc_result_t example_create(const char *zone, int argc, char **argv, + void *driverdata, void **dbdata); +PRIVATE void example_destroy(const char *zone, void *driverdata, void **dbdata); +PRIVATE isc_result_t example_lookup(const char *zone, const char *name, + void *dbdata, dns_sdblookup_t *); +PRIVATE isc_result_t example_allnodes(const char *zone, void *dbdata, + dns_sdballnodes_t *allnodes); +PRIVATE void * example_read_zone(char *directory, char *file,const char* zone); +// PRIVATE VARIABLES +// list of callback functions in dns_sdbmethods_t structure +PRIVATE dns_sdbmethods_t example_callbacks = { + example_lookup, // lookup callback function - mandatory + NULL, // authority callback function - optional + example_allnodes, // allnodes callback function - optional + example_create, // create callback function - optional + example_destroy // destroy callback function - optional +}; +// pointer to handle allocated by BIND and supplied to dns_sdb_unregister +PRIVATE dns_sdbimplementation_t *namedhandle = NULL; + +// PRIVATE FUNCTIONS +/********************* +* +* example_create() +* handle create callback for the example driver +* 1. call example_read_zone +* 2. update dbdata if OK +* 3. driverdata contains /var/named/zones/ +* 4. on good exit dbdata contains memory based zone structure +*********************/ +PRIVATE isc_result_t example_create(const char *zone, int argc, char **argv, + void *driverdata, void **dbdata) +{ + isc_result_t result = ISC_R_FAILURE; + if (argc != 2){ + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_ERROR, + "Example Driver: No file defined for %s", zone); + return result; + }; + *dbdata = example_read_zone(driverdata, argv[1],zone); + if(*dbdata == NULL){ // failed + return result; + }; + return ISC_R_SUCCESS; +}; +/********************* +* +* example_read_zone +* 1. read zone file +* 2. allocate fixed memory chunk (2K) +* 3. add count of RRs +* 4. populate RR structure +* return NULL = error else address of buffer containing zone file +*********************/ +PRIVATE void * example_read_zone(char *directory, char *file, const char* zone) +{ + char filename[FILENAME_SIZE]; // zone file name + char buffer[BUFFER_SIZE]; // zone file line buffer + FILE *fp; + RRSET_ID rrs; + strcpy(filename, directory); + strcpy(&filename[0] + strlen(directory), file); + if(!fopen(filename,"r")){ + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,NS_LOGMODULE_SERVER, ISC_LOG_ERROR, + "Example Driver: Zone %s File %s does not exist", zone, filename); + return NULL; + } + // allocate fixed memory for file + // very crude for example purposes only + rrs = (RRSET_ID)isc_mem_get(ns_g_mctx,EXAMPLE_ZONE_SIZE); + if (rrs == NULL){ // failed + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,NS_LOGMODULE_SERVER, ISC_LOG_ERROR, + "Example Driver: isc_mem_get fail"); + return NULL; + } + while(fgets(buffer, BUFFER_SIZE, fp) != NULL){ + /* read file discard comments + * populate structure rrs + * all zone apex RRs will have @ in owner name */ + }; + ++rrs; // point to next structure entry + // add dummy end record + *(&rrs->owner[0]) = '~'; // special end name + fclose(fp); // close file + return rrs; // return dbdata containing zone file +}; +/********************* +* +* example_lookup +* handle lookup callback for the example driver +* trivial exhaustive scan of the whole memory structure +* +*********************/ +isc_result_t example_lookup(const char *zone, const char *name, + void *dbdata, dns_sdblookup_t *lookup) +{ + RRSET_ID rrs = dbdata; + isc_result_t result = ISC_R_NOTFOUND; // default + while(*(&rrs->owner[0]) != '~') + { + if(strcmp(name,rrs->owner)) + { + result = ISC_R_SUCCESS; + result = dns_sdb_putrr(lookup,rrs->type,rrs->ttl, rrs->rdata); + if (result != ISC_R_SUCCESS) + { + return result; // error exit + }; + }; + ++rrs; + }; + return result; +}; + +/********************* +* +* example_allnodes +* handle allnodes callback for the example driver +* +*********************/ +PRIVATE isc_result_t example_allnodes(const char *zone, void *dbdata, + dns_sdballnodes_t *allnodes) +{ + RRSET_ID rrs = dbdata; + isc_result_t result = ISC_R_SUCCESS; // default + while(*(&rrs->owner[0]) != '~'){ + result = dns_sdb_putnamedrr(allnodes,rrs->owner,rrs->type,rrs->ttl, rrs->rdata); + if (result != ISC_R_SUCCESS){ + return result; // error exit + }; + ++rrs; + }; + return result; +}; +/********************* +* +* example_destroy +* handle destroy callback for the example driver +* deallocate memory allocated at create +*********************/ +PRIVATE void example_destroy(const char *zone, void *driverdata, void **dbdata) +{ + isc_mem_free(ns_g_mctx, dbdata); + return; +}; + +// PUBLIC FUNCTIONS +/********************* +* +* example_init +* register callbacks for the example driver +* Note: In this driver the DNS_SDBFLAG_RELATIVERDATA flag +* is not strictly needed and is used only to illustrate the use of multiple flags +* the variable 'directory' is used to illustrate that +* parameters may be supplied on this call +* equally the function may or may not return a value +* +*********************/ +isc_result_t example_init (char directory[]) +{ + // initialize flags + unsigned int flags = DNS_SDBFLAG_RELATIVEOWNER | DNS_SDBFLAG_RELATIVERDATA; + return (dns_sdb_register(DRIVERNAME,&example_callbacks,directory,flags,ns_g_mctx, &namedhandle)); +}; +/********************* +* +* example_clear +* unregister callbacks for this driver +* +*********************/ + +void example_clear(void) +{ + if (namedhandle != NULL){ + dns_sdb_unregister(&namedhandle); + }; +}; diff --git a/code/chapter14/F1402HF.txt b/code/chapter14/F1402HF.txt new file mode 100644 index 0000000..38467b6 --- /dev/null +++ b/code/chapter14/F1402HF.txt @@ -0,0 +1,5 @@ +// example sdb driver for BIND +// reads and parses zone file into ram structure +// header file +isc_result_t example_init (char directory[]); +void example_clear(void); diff --git a/code/chapter14/F1403CS.txt b/code/chapter14/F1403CS.txt new file mode 100644 index 0000000..7ac5511 --- /dev/null +++ b/code/chapter14/F1403CS.txt @@ -0,0 +1,40 @@ +struct __res_state { + int retrans; /* retransmission interval */ + int retry; /* no. of retransmits */ + u_long options; /* option flags */ + int nscount; /* number of name servers */ + struct sockaddr_in nsaddr_list[MAXNS]; +/* address of name server */ +#define nsaddr nsaddr_list[0] +/* for backward compatibility */ + u_short id; /* current message id */ + char *dnsrch[MAXDNSRCH+1]; +/* components of domain to search */ + char defdname[256]; /* default domain (deprecated) */ + u_long pfcode; /* RES_PRF_ flags - see below. */ + unsigned ndots:4; +/* threshold for initial abs. query */ + unsigned nsort:4; /* number of elements in sort_list[] */ + char unused[3]; + struct { + struct in_addr addr; + u_int32_t mask; + } sort_list[MAXRESOLVSORT]; + char pad[72]; /* on an i386 this means 512b total */ +}; + +/* for INET6 */ +/* +* replacement of __res_state, separated to +* keep binary compatibility. +*/ +struct __res_state_ext { + struct sockaddr_storage nsaddr_list[MAXNS]; + struct { + int af; /* address family for addr, mask */ + union { + struct in_addr ina; + struct in6_addr in6a; + } addr, mask; + } sort_list[MAXRESOLVSORT]; +}; diff --git a/code/chapter15/F1501NS.txt b/code/chapter15/F1501NS.txt new file mode 100644 index 0000000..1bfd818 --- /dev/null +++ b/code/chapter15/F1501NS.txt @@ -0,0 +1,10 @@ +// named.conf fragment +options { + .... + forward only; + forwarders {192.168.2.3;}; +}; +server 192.168.2.3 { + edns yes; +}; +.... diff --git a/code/readme-windows.txt b/code/readme-windows.txt new file mode 100644 index 0000000..615e9dd --- /dev/null +++ b/code/readme-windows.txt @@ -0,0 +1,61 @@ +Pro DNS and BIND 10 +=================== +a.k.a. Pro DNS and BIND 2nd edition +ISBN 978-1-4302-3048-9 +By Ron Aitchison +Web site http://www.netwidget.net/books/apress/dns +email: ron.aitchison@netwidget.net + +CHANGE LOG: + +2.0 - February 20th 2011 +a. initial version + + + +INTRODUCTION: + +The various example files used in the book are provided as text files in the format +and order they appear in the book. All files are formatted in UNIX format (lines +terminate with a single LF) and will generally not display correctly using a windows +text editor e.g. notepad. BIND will however accept either the UNIX standard (single LF) +or the Windows standard (CR+LF) when reading either the named.conf or zone files. +The supplied files will therefore work with BIND running on either UNIX or windows. + +SUPPLIED FILES: + +The files supplied are either complete or fragments (snippets) as they appear in the +book. Only multiple line examples are provided. The following are not included: + + a. single line examples + b. command lines + c. responses to commands + d. syntax definitions + e. the SDB API code fragments (only the complete file is provided) + +FILE NAMING CONVENTION: + +Files are organised under each chapter and have the following name format: + FCCXXTQ.txt + +Where: + F - fixed character F + + CC - two digit chapter number + + XX - sequence number of the file as it appears in the chapter + + T - single character describing the file type may be: + Z - zone file + N - named.conf + C - C source file + H - C header file + R - rc.conf (BSD) + A - httpd.conf (apache) + D - rndc.conf + S - shell script + + Q - single character file qualifer may be: + P - snippet, fragment or partial file + F - full file + E - edited file (removed base-64 material but file otherwise complete) \ No newline at end of file diff --git a/code/readme.txt b/code/readme.txt new file mode 100644 index 0000000..afb4f95 --- /dev/null +++ b/code/readme.txt @@ -0,0 +1,59 @@ +Pro DNS and BIND 10 +=================== +a.k.a. Pro DNS and BIND 2nd edition +ISBN 978-1-4302-3048-9 +By Ron Aitchison +Web site http://www.netwidget.net/books/apress/dns +email: ron.aitchison@netwidget.net + +CHANGE LOG: + +2.0 - February 20th 2011 +a. initial version + +INTRODUCTION: + +The various example files used in the book are provided as text files in the format +and order they appear in the book. All files are formatted in UNIX format (lines +terminate with a single LF) and will generally not display correctly using a windows +text editor e.g. notepad. BIND will however accept either the UNIX standard (single LF) +or the Windows standard (CR+LF) when reading either the named.conf or zone files. +The supplied files will therefore work with BIND running on either UNIX or windows. + +SUPPLIED FILES: + +The files supplied are either complete or fragments (snippets) as they appear in the +book. Only multiple line examples are provided. The following are not included: + + a. single line examples + b. command lines + c. responses to commands + d. syntax definitions + e. the SDB API code fragments (only the complete file is provided) + +FILE NAMING CONVENTION: + +Files are organised under each chapter and have the following name format: + FCCXXTQ.txt + +Where: + F - fixed character F + + CC - two digit chapter number + + XX - sequence number of the file as it appears in the chapter + + T - single character describing the file type may be: + Z - zone file + N - named.conf + C - C source file + H - C header file + R - rc.conf (BSD) + A - httpd.conf (apache) + D - rndc.conf + S - shell script + + Q - single character file qualifer may be: + P - snippet, fragment or partial file + F - full file + E - edited file (removed base-64 material but file otherwise complete) \ No newline at end of file diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..f6005ad --- /dev/null +++ b/contributing.md @@ -0,0 +1,14 @@ +# Contributing to Apress Source Code + +Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers. + +## How to Contribute + +1. Make sure you have a GitHub account. +2. Fork the repository for the relevant book. +3. Create a new branch on which to make your change, e.g. +`git checkout -b my_code_contribution` +4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted. +5. Submit a pull request. + +Thank you for your contribution! \ No newline at end of file