Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Apress committed Oct 16, 2016
0 parents commit d3c2301
Show file tree
Hide file tree
Showing 254 changed files with 4,813 additions and 0 deletions.
Binary file added 9781430230489.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,27 @@
Freeware License, some rights reserved

Copyright (c) 2011 Ron Aitchison

Permission is hereby granted, free of charge, to anyone obtaining a copy
of this software and associated documentation files (the "Software"),
to work with the Software within the limits of freeware distribution and fair use.
This includes the rights to use, copy, and modify the Software for personal use.
Users are also allowed and encouraged to submit corrections and modifications
to the Software for the benefit of other users.

It is not allowed to reuse, modify, or redistribute the Software for
commercial use in any way, or for a user�s educational materials such as books
or blog articles without prior permission from the copyright holder.

The above copyright notice and this permission notice need to be included
in all copies or substantial portions of the software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


15 changes: 15 additions & 0 deletions README.md
@@ -0,0 +1,15 @@
#Apress Source Code

This repository accompanies [*Pro DNS and BIND 10*](http://www.apress.com/9781430230489) by Ron Aitchison (Apress, 2011).

![Cover image](9781430230489.jpg)

Download the files as a zip using the green button, or clone the repository to your machine using Git.

##Releases

Release v1.0 corresponds to the code in the published book, without corrections or updates.

##Contributions

See the file Contributing.md for more information on how you can contribute to this repository.
28 changes: 28 additions & 0 deletions code/chapter01/F0101ZF.txt
@@ -0,0 +1,28 @@
; IPv4 zone file for example.com
$TTL 2d ; default TTL for zone
$ORIGIN example.com.
; Start of Authority record defining the key characteristics of the zone (domain)
@ IN SOA ns1.example.com. hostmaster.example.com. (
2010080800 ; sn = serial number
12h ; refresh
15m ; retry = refresh retry
3w ; expiry
2h ; nx = nxdomain ttl
)
; name servers Resource Records for the domain
IN NS ns1.example.com.
; the second name servers is
; external to this zone (domain).
IN NS ns2.example.net.
; mail server Resource Records 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

33 changes: 33 additions & 0 deletions code/chapter02/F0201ZF.txt
@@ -0,0 +1,33 @@
; IPv4 zone file for example.com
$TTL 2d ; default TTL for zone
$ORIGIN example.com. ; base domain-name
; Start of Authority record RR defining the key characteristics
; of the zone (domain)
@ IN SOA ns1.example.com. hostmaster.example.com. (
2003080800 ; se = serial number
12h ; retry = refresh retry
15m ; ret = update retry
3w ; ex = expiry
3h ; nx = nxdomain ttl
)
; name servers RRs 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)
; value 10 in this case denotes it is the most preferred
3w IN MX 10 mail.example.com.
; the second mail server has lower preference (20) and is
; external to the zone (domain)
IN MX 20 mail.example.net.
; domain hosts includes NS and MX records RRs defined previously
; plus any others required
ns1 IN A 192.168.254.2
mail IN A 192.168.254.4
; web and publically visible host called joe
joe IN A 192.168.254.6
www IN A 192.168.254.7
; aliases ftp (ftp server) to an external location
ftp IN CNAME ftp.example.net.

8 changes: 8 additions & 0 deletions code/chapter02/F0202ZS.txt
@@ -0,0 +1,8 @@
@ IN SOA ns1.example.com. hostmaster.example.com. (
2003080800 ; sn = serial number
3h ; refresh time
15m ; retry = refresh retry
3w ; expiry
3h ; nx = nxdomain ttl
)

12 changes: 12 additions & 0 deletions code/chapter02/F0203ZS.txt
@@ -0,0 +1,12 @@
; fragment from example - does not use substitution
$TTL 2d ; default TTL for zone
$ORIGIN example.com.
; Start of Authority RR defining the key characteristics of the zone (domain)
@ IN SOA ns1.example.com. hostmaster.example.com. (
2003080800 ; se = serial number
12h ; ret = refresh retry
15m ; ret = update retry
3w ; ex = expiry
2h ; nx = nxdomain ttl
)

12 changes: 12 additions & 0 deletions code/chapter02/F0204ZS.txt
@@ -0,0 +1,12 @@
; fragment rewritten to use $ORIGIN substitution
$TTL 2d ; default TTL for zone
$ORIGIN example.com.
; Start of Authority RR defining the key characteristics of the zone (domain)
@ IN SOA ns1 hostmaster (
2003080800 ; se = serial number
12h ; ref = refresh
15m ; ret = refresh retry
3w ; ex = expiry
2h ; nx = nxdomain ttl
)

6 changes: 6 additions & 0 deletions code/chapter02/F0205ZS.txt
@@ -0,0 +1,6 @@
; name servers RR for the domain
IN NS ns1.example.com.
; the second name server is
; external to this zone (domain).
IN NS ns2.example.net.

6 changes: 6 additions & 0 deletions code/chapter02/F0206ZS.txt
@@ -0,0 +1,6 @@
; mail server RRs for the zone (domain)
3w IN MX 10 mail.example.com.
; the second mail server is
; external to the zone (domain)
IN MX 20 mail.example.net.

5 changes: 5 additions & 0 deletions code/chapter02/F0207ZS.txt
@@ -0,0 +1,5 @@
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

6 changes: 6 additions & 0 deletions code/chapter02/F0208ZS.txt
@@ -0,0 +1,6 @@
ns1 IN A 192.168.254.2
mail IN A 192.168.254.4
joe IN A 192.168.254.6
; this A RR has the same IPv4 address as ns1 above
www IN A 192.168.254.2

4 changes: 4 additions & 0 deletions code/chapter02/F0209ZS.txt
@@ -0,0 +1,4 @@
www IN A 192.168.254.2
IN A 192.168.254.7
IN A 192.168.254.8

4 changes: 4 additions & 0 deletions code/chapter02/F0210ZS.txt
@@ -0,0 +1,4 @@
ftp IN CNAME bill
www IN CNAME bill
bill IN 192.168.254.21

5 changes: 5 additions & 0 deletions code/chapter02/F0211ZS.txt
@@ -0,0 +1,5 @@
ns1 IN A 192.168.254.2
mail IN A 192.168.254.3
joe IN CNAME www.example.com.
www IN CNAME mail.example.com.

4 changes: 4 additions & 0 deletions code/chapter02/F0212ZS.txt
@@ -0,0 +1,4 @@
IN MX mail.example.com.
mail IN CNAME www.example.com.
www IN A 192.168.254.7

4 changes: 4 additions & 0 deletions code/chapter02/F0213ZS.txt
@@ -0,0 +1,4 @@
IN MX mail.example.com.
mail IN A 192.168.254.7
www IN CNAME mail.example.com.

5 changes: 5 additions & 0 deletions code/chapter02/F0214ZS.txt
@@ -0,0 +1,5 @@
; define an IP that resolves to example.com
IN A 192.168.254.7
; alias www.example.com to example.com
www IN CNAME example.com.

25 changes: 25 additions & 0 deletions code/chapter03/F0301ZS.txt
@@ -0,0 +1,25 @@
; simple reverse mapping zone file for example.com
$TTL 2d ; default TTL for zone
$ORIGIN 254.168.192.IN-ADDR.ARPA.
; Start of Authority (SOA) record defining the key characteristics of the zone (domain)
@ IN SOA ns1.example.com. hostmaster.example.com. (
2003080800 ; sn = serial number
12h ; refresh
15m ; retry
3w ; expiry
2h ; nxdomain ttl
)
; name servers Resource Records for the domain
IN NS ns1.example.com.
; the second name servers is
; external to this zone (domain).
IN NS ns2.anotherdomain.com.
; PTR RR maps an IPv4 address to a host name
2 IN PTR ns1.example.com.
.....
4 IN PTR mail.example.com.
.....
16 IN PTR joe.example.com.
17 IN PTR www.example.com.
....

6 changes: 6 additions & 0 deletions code/chapter03/F0302ZS.txt
@@ -0,0 +1,6 @@
2 IN PTR ns1.example.com.
.....
4 IN PTR mail.example.com.
.....
16 IN PTR joe.example.com.
17 IN PTR www.example.com.
3 changes: 3 additions & 0 deletions code/chapter03/F0303ZS.txt
@@ -0,0 +1,3 @@
ns1 IN A 192.168.254.2
; this A RR has the same IPv4 address as ns1 above
www IN A 192.168.254.2
2 changes: 2 additions & 0 deletions code/chapter03/F0304ZS.txt
@@ -0,0 +1,2 @@
ns1 IN A 192.168.254.2
www IN CNAME ns1.example.com.
3 changes: 3 additions & 0 deletions code/chapter03/F0305ZS.txt
@@ -0,0 +1,3 @@
mail IN A 192.168.254.4
; this A RR has the same IPv4 address as mail above
www IN A 192.168.254.4
2 changes: 2 additions & 0 deletions code/chapter03/F0306ZS.txt
@@ -0,0 +1,2 @@
mail IN A 192.168.254.4
www IN CNAME mail.example.com.
2 changes: 2 additions & 0 deletions code/chapter03/F0307ZS.txt
@@ -0,0 +1,2 @@
; the IN-ADDR.ARPA zone file defines mail not www
4 IN PTR mail.example.com.
2 changes: 2 additions & 0 deletions code/chapter03/F0308ZS.txt
@@ -0,0 +1,2 @@
www IN A 192.168.254.4
ftp IN CNAME mail.example.com.
7 changes: 7 additions & 0 deletions code/chapter03/F0309ZS.txt
@@ -0,0 +1,7 @@
@ IN SOA ns1.example.com. hostmaster.example.com. (
2005080803 ; sn = serial number
3h ; refresh time
15m ; retry = refresh retry
3w ; expiry
3h ; nx = nxdomain ttl
)
7 changes: 7 additions & 0 deletions code/chapter03/F0310ZS.txt
@@ -0,0 +1,7 @@
@ IN SOA ns1.example.com. hostmaster.example.com. (
2003090700 ; sn = serial number
3h ; refresh time
15m ; retry = refresh retry
3w ; expiry
3h ; nx = nxdomain ttl
)
6 changes: 6 additions & 0 deletions code/chapter04/F0401NS.txt
@@ -0,0 +1,6 @@
// example.com fragment from named.conf
// defines this server as a zone master for example.com
zone "example.com" in{
type master;
file "master.example.com";
};
8 changes: 8 additions & 0 deletions code/chapter04/F0402NS.txt
@@ -0,0 +1,8 @@
// example.com fragment from named.conf
// defines this server as a zone slave
zone "example.com" in{
type slave;
file "slave.example.com";
masters {192.168.23.17;};
};

15 changes: 15 additions & 0 deletions code/chapter04/F0403NS.txt
@@ -0,0 +1,15 @@
// options clause fragment of named.conf
// recursion yes is the default and may be omitted
options {
recursion yes;
allow-recursion {10.2/16;192.168.2/24;}; // limits (closes) recursion
};
// zone sectionclause
....
// the DOT indicates the root domain = all domains
zone "." IN {
type hint;
file "root.servers";
};


11 changes: 11 additions & 0 deletions code/chapter04/F0404NS.txt
@@ -0,0 +1,11 @@
// options clause fragment of named.conf
// forwarders can have multiple choices
options {
forwarders {10.0.0.1; 10.0.0.2;};
forward only;
};
// zone file sectionsclauses
....



10 changes: 10 additions & 0 deletions code/chapter04/F0405NS.txt
@@ -0,0 +1,10 @@
// zone clause fragment of named.conf
zone "example.com" IN {
type forward;
forwarders {10.0.0.1; 10.0.0.2;};
forward only;
};




18 changes: 18 additions & 0 deletions code/chapter04/F0406ZF.txt
@@ -0,0 +1,18 @@
; public zone master file
; provides minimal public visibility of external services
example.com. IN SOA ns1.example.com. hostmaster.example.com. (
2003080800 ; se = serial number
12h ; ref = refresh
15m ; ret = update retry
3w ; ex = expiry
3h ; min = minimum
)
IN NS ns1.example.com.
IN NS ns2.example.com.
IN MX 10 mail.example.com.
IN MX 20 mail.example.net.
ns1 IN A 192.168.254.1
ns1 IN A 192.168.254.2
mail IN A 192.168.254.3
www IN A 192.168.254.4
ftp IN A 192.168.254.5
30 changes: 30 additions & 0 deletions code/chapter04/F0407ZF.txt
@@ -0,0 +1,30 @@
; private zone master file used by stealth server(s)
; provides public and private services and hosts
example.com. IN SOA ns3.example.com. hostmaster.example.com. (
2010121500 ; sn = serial number
12h ; ref = refresh
15m ; retry = refresh retry
3w ; ex = expiry
3h ; nx = nxdomain ttl
)
IN NS ns3.example.com.
IN NS ns4.example.com.
IN NS 10 mail.example.com.
IN MX 20 mail.anotherdomain.com.
; public hosts
mail IN A 192.168.254.3
www IN A 192.168.254.4
ftp IN A 192.168.254.5
; private hosts
joe IN A 192.168.254.6
bill IN A 192.168.254.7
fred IN A 192.168.254.8
ns3 IN A 192.168.254.9
ns4 IN A 192.168.254.10
accounting IN A 192.168.254.28
payroll IN A 192.168.254.29





7 changes: 7 additions & 0 deletions code/chapter04/F0408NS.txt
@@ -0,0 +1,7 @@
// options section clause fragment of named.conf
// recursion no = effectively inhibits caching
options {
recursion no;
};
// zone file sectionsclauses
....

0 comments on commit d3c2301

Please sign in to comment.