From 052057411fab5b3f4ad869c1a02f62afaffc41eb Mon Sep 17 00:00:00 2001 From: root Date: Thu, 24 Jun 2021 14:44:16 +0200 Subject: [PATCH] ajout 02-tpdns --- sio1/tp/02-tpdns/ns1/db.detete.lan | 18 +++++++++++ sio1/tp/02-tpdns/ns1/db.detete.lan.rev | 18 +++++++++++ sio1/tp/02-tpdns/ns1/db.detete.lan.save | 18 +++++++++++ sio1/tp/02-tpdns/ns1/db.detete.lan.save.1 | 18 +++++++++++ sio1/tp/02-tpdns/ns1/hostname | 1 + sio1/tp/02-tpdns/ns1/hosts | 7 +++++ sio1/tp/02-tpdns/ns1/interfaces | 14 +++++++++ sio1/tp/02-tpdns/ns1/named.conf | 11 +++++++ sio1/tp/02-tpdns/ns1/named.conf.default-zones | 30 +++++++++++++++++++ sio1/tp/02-tpdns/ns1/named.conf.local | 10 +++++++ sio1/tp/02-tpdns/ns1/named.conf.options | 11 +++++++ sio1/tp/02-tpdns/ns1/resolv.conf | 3 ++ 12 files changed, 159 insertions(+) create mode 100644 sio1/tp/02-tpdns/ns1/db.detete.lan create mode 100644 sio1/tp/02-tpdns/ns1/db.detete.lan.rev create mode 100644 sio1/tp/02-tpdns/ns1/db.detete.lan.save create mode 100644 sio1/tp/02-tpdns/ns1/db.detete.lan.save.1 create mode 100644 sio1/tp/02-tpdns/ns1/hostname create mode 100644 sio1/tp/02-tpdns/ns1/hosts create mode 100644 sio1/tp/02-tpdns/ns1/interfaces create mode 100644 sio1/tp/02-tpdns/ns1/named.conf create mode 100644 sio1/tp/02-tpdns/ns1/named.conf.default-zones create mode 100644 sio1/tp/02-tpdns/ns1/named.conf.local create mode 100644 sio1/tp/02-tpdns/ns1/named.conf.options create mode 100644 sio1/tp/02-tpdns/ns1/resolv.conf diff --git a/sio1/tp/02-tpdns/ns1/db.detete.lan b/sio1/tp/02-tpdns/ns1/db.detete.lan new file mode 100644 index 0000000..4a34105 --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/db.detete.lan @@ -0,0 +1,18 @@ +; +; BIND data file for local loopback interface +; +$TTL 604800 +@ IN SOA ns1.detete.lan. root.ns1.detete.lan. ( + 2021062300 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; + NS ns1.detete.lan. + NS ns2.detete.lan. +ns1.detete.lan. A 192.168.1.60 +ns2.detete.lan. A 192.168.1.59 +xp1.detete.lan. A 192.168.1.61 +xp2.detete.lan. A 192.168.1.62 +WWW CNAME xp2 diff --git a/sio1/tp/02-tpdns/ns1/db.detete.lan.rev b/sio1/tp/02-tpdns/ns1/db.detete.lan.rev new file mode 100644 index 0000000..de5d71e --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/db.detete.lan.rev @@ -0,0 +1,18 @@ +; +; BIND reverse data file for local loopback interface +; +$TTL 604800 +@ IN SOA ns1.detete.lan. root.detete.lan. ( + 3 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; + + NS ns1.detete.lan. + NS ns2.detete.lan. +60 IN PTR ns1.detete.lan. +59 IN PTR ns2.detete.lan. +61 IN PTR xp1.detete.lan. +62 IN PTR xp2.detete.lan. diff --git a/sio1/tp/02-tpdns/ns1/db.detete.lan.save b/sio1/tp/02-tpdns/ns1/db.detete.lan.save new file mode 100644 index 0000000..84545ec --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/db.detete.lan.save @@ -0,0 +1,18 @@ +; +; BIND data file for local loopback interface +; +$TTL 604800 +@ IN SOA ns1.detete.lan. root.ns1.detete.lan ( + 3 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; + NS ns1.detete.lan. + NS ns2.detete.lan. +ns1.detete.lan. A 192.168.1.60 +ns2.detete.lan. A 192.168.1.59 +xp1.detete.lan. A 192.168.1.61 +xp2.detete.lan. A 192.168.1.62 +WWW CNAME xp2 diff --git a/sio1/tp/02-tpdns/ns1/db.detete.lan.save.1 b/sio1/tp/02-tpdns/ns1/db.detete.lan.save.1 new file mode 100644 index 0000000..4a34105 --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/db.detete.lan.save.1 @@ -0,0 +1,18 @@ +; +; BIND data file for local loopback interface +; +$TTL 604800 +@ IN SOA ns1.detete.lan. root.ns1.detete.lan. ( + 2021062300 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; + NS ns1.detete.lan. + NS ns2.detete.lan. +ns1.detete.lan. A 192.168.1.60 +ns2.detete.lan. A 192.168.1.59 +xp1.detete.lan. A 192.168.1.61 +xp2.detete.lan. A 192.168.1.62 +WWW CNAME xp2 diff --git a/sio1/tp/02-tpdns/ns1/hostname b/sio1/tp/02-tpdns/ns1/hostname new file mode 100644 index 0000000..015bf65 --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/hostname @@ -0,0 +1 @@ +ns1.detete.lan diff --git a/sio1/tp/02-tpdns/ns1/hosts b/sio1/tp/02-tpdns/ns1/hosts new file mode 100644 index 0000000..36ca417 --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/hosts @@ -0,0 +1,7 @@ +127.0.0.1 localhost +127.0.1.1 ns1.detete.lan ns1 + +# The following lines are desirable for IPv6 capable hosts +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters diff --git a/sio1/tp/02-tpdns/ns1/interfaces b/sio1/tp/02-tpdns/ns1/interfaces new file mode 100644 index 0000000..be67d61 --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/interfaces @@ -0,0 +1,14 @@ +# This file describes the network interfaces available on your system +# and how to activate them. For more information, see interfaces(5). + +source /etc/network/interfaces.d/* + +# The loopback network interface +auto lo +iface lo inet loopback + +# The primary network interface +allow-hotplug enp0s3 +iface enp0s3 inet static + address 192.168.1.60/24 + gateway 192.168.1.254 diff --git a/sio1/tp/02-tpdns/ns1/named.conf b/sio1/tp/02-tpdns/ns1/named.conf new file mode 100644 index 0000000..880786a --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/named.conf @@ -0,0 +1,11 @@ +// This is the primary configuration file for the BIND DNS server named. +// +// Please read /usr/share/doc/bind9/README.Debian.gz for information on the +// structure of BIND configuration files in Debian, *BEFORE* you customize +// this configuration file. +// +// If you are just adding zones, please do that in /etc/bind/named.conf.local + +include "/etc/bind/named.conf.options"; +include "/etc/bind/named.conf.local"; +include "/etc/bind/named.conf.default-zones"; diff --git a/sio1/tp/02-tpdns/ns1/named.conf.default-zones b/sio1/tp/02-tpdns/ns1/named.conf.default-zones new file mode 100644 index 0000000..1a85ad3 --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/named.conf.default-zones @@ -0,0 +1,30 @@ +// prime the server with knowledge of the root servers +zone "." { + type hint; + file "/usr/share/dns/root.hints"; +}; + +// be authoritative for the localhost forward and reverse zones, and for +// broadcast zones as per RFC 1912 + +zone "localhost" { + type master; + file "/etc/bind/db.local"; +}; + +zone "127.in-addr.arpa" { + type master; + file "/etc/bind/db.127"; +}; + +zone "0.in-addr.arpa" { + type master; + file "/etc/bind/db.0"; +}; + +zone "255.in-addr.arpa" { + type master; + file "/etc/bind/db.255"; +}; + + diff --git a/sio1/tp/02-tpdns/ns1/named.conf.local b/sio1/tp/02-tpdns/ns1/named.conf.local new file mode 100644 index 0000000..c2fe9fc --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/named.conf.local @@ -0,0 +1,10 @@ +zone "detete.lan" { + type master; + file "/etc/bind/db.detete.lan"; +}; + +zone "1.168.192.in-addr.arpa" { + type master; + notify no; + file "/etc/bind/db.detete.lan.rev"; +}; diff --git a/sio1/tp/02-tpdns/ns1/named.conf.options b/sio1/tp/02-tpdns/ns1/named.conf.options new file mode 100644 index 0000000..bd32ae5 --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/named.conf.options @@ -0,0 +1,11 @@ +options { + directory "/var/cache/bind"; + + forwarders { + 192.168.1.254; + }; + + dnssec-validation auto; + + listen-on-v6 { any; }; +}; diff --git a/sio1/tp/02-tpdns/ns1/resolv.conf b/sio1/tp/02-tpdns/ns1/resolv.conf new file mode 100644 index 0000000..a3c8258 --- /dev/null +++ b/sio1/tp/02-tpdns/ns1/resolv.conf @@ -0,0 +1,3 @@ +domain detete.lan +search detete.lan +nameserver 127.0.0.1