network-environment:
content:
content:
- 192.168.1.0/24 - home lan network
- 192.168.1.100 - router
- 192.168.1.251 - raspberry
- rpi-dns - hostname of the raspberry
- 208.67.220.220, 208.67.222.222 - opendns
Code:
sudo su
apt-get install bind9
Code:
cd /etc/bind
nano /etc/bind/db.home.lan
content:
Code:
; Use semicolons to add comments.
; Host-to-IP Address DNS Pointers for home.lan
; Note: The extra "." at the end of the domain names are important.
; The following parameters set when DNS records will expire, etc.
; Importantly, the serial number must always be iterated upward to prevent
; undesirable consequences. A good format to use is YYYYMMDDII where
; the II index is in case you make more that one change in the same day.
home.lan. IN SOA raspberry.home.lan. hostmaster.home.lan. (
2015120101 ; serial
8H ; refresh
4H ; retry
4W ; expire
1D ; minimum
)
; NS indicates that raspberry is the name server on home.lan
; MX indicates that raspberry is (also) the mail server on home.lan
home.lan. IN NS rpi-dns.home.lan.
home.lan. IN MX 10 rpi-dns.home.lan.
; Set the address for localhost.home.lan
localhost IN A 127.0.0.1
; Set the hostnames in alphabetical order
rpi-dns IN A 192.168.1.251
router IN A 192.168.1.100
Code:
nano /etc/bind/db.rev.1.168.192.in-addr.arpa
content:
Code:
; IP Address-to-Host DNS Pointers for the 192.168.1 subnet
@ IN SOA rpi-dns.home.lan. hostmaster.home.lan. (
2015120101 ; serial
8H ; refresh
4H ; retry
4W ; expire
1D ; minimum
)
; define the authoritative name server
IN NS rpi-dns.home.lan.
; our hosts, in numeric order
1 IN PTR router.home.lan.
31 IN PTR rpi-dns.home.lan.
Code:
nano /etc/bind/named.conf.options
Code:
forwarders {
208.67.222.222;
208.67.220.220;
};
Code:
nano /etc/bind/named.conf.local
Code:
zone "home.lan" IN {
type master;
file "/etc/bind/db.home.lan";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.rev.1.168.192.in-addr.arpa";
};
Zuletzt bearbeitet: