From b60e9546c299dc16c404356a07b5bebf20c854cd Mon Sep 17 00:00:00 2001 From: "jeremy.thomas" Date: Mon, 3 Feb 2025 11:09:48 +0100 Subject: [PATCH] Ajout des configuration du dns2 --- sisr1/tp02-dns/dns2/db.sio-jt.lan | 18 ++++++++++++++++++ sisr1/tp02-dns/dns2/db.sio-jt.lan.rev | 15 +++++++++++++++ sisr1/tp02-dns/dns2/hostname | 1 + sisr1/tp02-dns/dns2/hosts | 7 +++++++ sisr1/tp02-dns/dns2/interfaces | 19 +++++++++++++++++++ sisr1/tp02-dns/dns2/named.conf.local | 25 +++++++++++++++++++++++++ sisr1/tp02-dns/dns2/named.conf.options | 24 ++++++++++++++++++++++++ 7 files changed, 109 insertions(+) create mode 100644 sisr1/tp02-dns/dns2/db.sio-jt.lan create mode 100644 sisr1/tp02-dns/dns2/db.sio-jt.lan.rev create mode 100644 sisr1/tp02-dns/dns2/hostname create mode 100644 sisr1/tp02-dns/dns2/hosts create mode 100644 sisr1/tp02-dns/dns2/interfaces create mode 100644 sisr1/tp02-dns/dns2/named.conf.local create mode 100644 sisr1/tp02-dns/dns2/named.conf.options diff --git a/sisr1/tp02-dns/dns2/db.sio-jt.lan b/sisr1/tp02-dns/dns2/db.sio-jt.lan new file mode 100644 index 0000000..ea77d73 --- /dev/null +++ b/sisr1/tp02-dns/dns2/db.sio-jt.lan @@ -0,0 +1,18 @@ +$ORIGIN . +$TTL 604800 ; 1 week +sio-jt.lan IN SOA dns1-jt.sio-jt.lan. root.dns1.sio-jt.lan. ( + 2 ; serial + 604800 ; refresh (1 week) + 86400 ; retry (1 day) + 2419200 ; expire (4 weeks) + 604800 ; minimum (1 week) + ) + NS dns1-jt.sio-jt.lan. + NS dns2-jt.sio-jt.lan. + NS localhost. +$ORIGIN sio-jt.lan. +deb-dhcp-jt A 192.168.0.140 +dhcp CNAME deb-dhcp-jt +dns CNAME dns1 +dns1-jt A 192.168.0.141 +dns2-jt A 192.168.0.142 diff --git a/sisr1/tp02-dns/dns2/db.sio-jt.lan.rev b/sisr1/tp02-dns/dns2/db.sio-jt.lan.rev new file mode 100644 index 0000000..802f675 --- /dev/null +++ b/sisr1/tp02-dns/dns2/db.sio-jt.lan.rev @@ -0,0 +1,15 @@ +$ORIGIN . +$TTL 604800 ; 1 week +0.168.192.in-addr.arpa IN SOA dns1-jt.sio-jt.lan. root.dns1-jt.sio-jt.lan. ( + 2 ; serial + 604800 ; refresh (1 week) + 86400 ; retry (1 day) + 2419200 ; expire (4 weeks) + 604800 ; minimum (1 week) + ) + NS dns1-jt.sio-jt.lan. + NS dns2-jt.sio-jt.lan. +$ORIGIN 0.168.192.in-addr.arpa. +140 PTR deb-dhcp-jt.sio-jt.lan. +141 PTR dns1-jt.sio-jt.lan. +142 PTR dns2-jt.sio-jt.lan. diff --git a/sisr1/tp02-dns/dns2/hostname b/sisr1/tp02-dns/dns2/hostname new file mode 100644 index 0000000..024f2ed --- /dev/null +++ b/sisr1/tp02-dns/dns2/hostname @@ -0,0 +1 @@ +dns2-jt diff --git a/sisr1/tp02-dns/dns2/hosts b/sisr1/tp02-dns/dns2/hosts new file mode 100644 index 0000000..2f95e1f --- /dev/null +++ b/sisr1/tp02-dns/dns2/hosts @@ -0,0 +1,7 @@ +127.0.0.1 localhost +127.0.1.1 dns2-jt.sio-jt.lan dns2-jt + +# 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/sisr1/tp02-dns/dns2/interfaces b/sisr1/tp02-dns/dns2/interfaces new file mode 100644 index 0000000..6addc79 --- /dev/null +++ b/sisr1/tp02-dns/dns2/interfaces @@ -0,0 +1,19 @@ +# 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 dhcp + +# Assignation static IP adresse +auto enp0s3 +iface enp0s3 inet static + address 192.168.0.142/24 + gateway 192.168.0.1 + diff --git a/sisr1/tp02-dns/dns2/named.conf.local b/sisr1/tp02-dns/dns2/named.conf.local new file mode 100644 index 0000000..fd594fc --- /dev/null +++ b/sisr1/tp02-dns/dns2/named.conf.local @@ -0,0 +1,25 @@ +// +// Do any local configuration here +// + +// zone directe + zone "sio-jt.lan" { + type slave; + file "/etc/bind/db.sio-jt.lan"; + masters { 192.168.0.141; }; + masterfile-format text; + }; + + // zone inverse + zone "0.168.192.in-addr.arpa" { + type slave; + notify no; + file "/etc/bind/db.sio-jt.lan.rev"; + masters { 192.168.0.141; }; + masterfile-format text; + }; + +// Consider adding the 1918 zones here, if they are not used in your +// organization +//include "/etc/bind/zones.rfc1918"; + diff --git a/sisr1/tp02-dns/dns2/named.conf.options b/sisr1/tp02-dns/dns2/named.conf.options new file mode 100644 index 0000000..66c4f64 --- /dev/null +++ b/sisr1/tp02-dns/dns2/named.conf.options @@ -0,0 +1,24 @@ +options { + directory "/var/cache/bind"; + + // If there is a firewall between you and nameservers you want + // to talk to, you may need to fix the firewall to allow multiple + // ports to talk. See http://www.kb.cert.org/vuls/id/800113 + + // If your ISP provided one or more IP addresses for stable + // nameservers, you probably want to use them as forwarders. + // Uncomment the following block, and insert the addresses replacing + // the all-0's placeholder. + + forwarders { + 10.121.38.7; //ici forwarder 1 + }; + + //======================================================================== + // If BIND logs error messages about the root key being expired, + // you will need to update your keys. See https://www.isc.org/bind-keys + //======================================================================== + dnssec-validation no; + + listen-on-v6 { any; }; +};