Nimeserveri seadistamine BIND9 näitel: Difference between revisions
From ICO wiki test
Jump to navigationJump to search
| Line 62: | Line 62: | ||
// the all-0's placeholder. | // the all-0's placeholder. | ||
forwarders { | forwarders { | ||
192.168.145.2; | 192.168.145.2; | ||
}; | }; | ||
| Line 102: | Line 102: | ||
cp /etc/bind/db.local /etc/bind/db.koht.ee | cp /etc/bind/db.local /etc/bind/db.koht.ee | ||
cp /etc/bind/db.local /etc/bind/db.arendus.koht.ee | cp /etc/bind/db.local /etc/bind/db.arendus.koht.ee | ||
</pre> | |||
Nüüd muudame db.too.ee faili | |||
<pre> | |||
nano /etc/bind/db.too.ee | |||
</pre> | |||
Muudetud fail näeb välja järgmine: | |||
<pre> | |||
; | |||
; BIND data file for too.ee | |||
; | |||
$ORIGIN too.ee. | |||
$TTL 604800 | |||
@ IN SOA ns.too.ee. root.too.ee. ( | |||
3 ; Serial | |||
604800 ; Refresh | |||
86400 ; Retry | |||
2419200 ; Expire | |||
604800 ) ; Negative Cache TTL | |||
; | |||
too.ee. IN NS ns.too.ee. | |||
too.ee. IN MX mail.too.ee. | |||
too.ee. IN SPF "v=spf1 a mx -all" | |||
ns.too.ee. IN A 192.168.145.128 | |||
mail.too.ee. IN A 192.168.145.129 | |||
www.too.ee. IN A 192.168.145.130 | |||
too.ee. IN CNAME www.too.ee. | |||
</pre> | </pre> | ||
Revision as of 15:20, 16 November 2009
Autorid
- Tuuli Zahvatkin
- Nils Tammann
Viimase muutmise aeg
Sissejuhatus
Eeldused
- Peab olema installeeritud Ubuntu server 9.10
- Masinal kuhu konfigureeritakse DNS peab olema staatiline IP-aadress. Meie näite puhul on selleks:
IP aadress: 192.168.145.128 Võrgumask: 255.255.255.0 Vaikelüüs: 192.168.145.2 ISP DNS: 192.168.145.2
- Tulemüüris peab olema avatud tcp/udp port 53
Nõuded
- Konfigureerida kaks domeeni ja üks alamdomeen.
- Reverse peaks toimima.
- Domeeni teenindava meiliserveri mx kirjed ja spf kirjed peavad olema nimeserveri domeenides.
- Ilma www-ta aadressis peab saama veebisaidile ligi.
- Nimeserveri varundamine/taastamine.
- BIND serveri turvavead.
Installeerimine
BIND9 installeerimiseks sisestada järgmine käsk:
sudo -i apt-get install bind9
Seadistamine
Minna juurkasutajaks:
sudo -i
Algul tuleb muuta faili /etc/bind/named.conf.options
nano /etc/bind/named.conf.options
Kommentaar tuleb eemaldada forwarders eest ja sinna sulgude vahele kirjutada ISP DNS server. Muudetud fail peaks välja nägema järgmine:
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 {
192.168.145.2;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
Peale seda tuleb muuta /etc/bind/named.conf.local
nano /etc/bind/named.conf.local
Sellesse faili tuleb lisada järgmised tsoonid:
zone "145.168.192.in-addr.arpa" IN {
type master;
file "/etc/bind/db.145.168.192.in-addr.arpa";
};
zone "too.ee" IN {
type master;
file "/etc/bind/db.too.ee";
};
zone "koht.ee" IN {
type master;
file "/etc/bind/db.koht.ee";
};
zone "arendus.koht.ee" IN {
type master;
file "/etc/bind/db.arendus.koht.ee";
};
Eelnevalt loodud tsoonid viitavad failidele, mis neid tsoone kirjeldavad. Selleks et neid faile luua, võtame aluseks olemasoleva localhost tsooni faili ja kopeerime seda.
cp /etc/bind/db.127 /etc/bind/db.145.168.192.in-addr.arpa cp /etc/bind/db.local /etc/bind/db.too.ee cp /etc/bind/db.local /etc/bind/db.koht.ee cp /etc/bind/db.local /etc/bind/db.arendus.koht.ee
Nüüd muudame db.too.ee faili
nano /etc/bind/db.too.ee
Muudetud fail näeb välja järgmine:
;
; BIND data file for too.ee
;
$ORIGIN too.ee.
$TTL 604800
@ IN SOA ns.too.ee. root.too.ee. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
too.ee. IN NS ns.too.ee.
too.ee. IN MX mail.too.ee.
too.ee. IN SPF "v=spf1 a mx -all"
ns.too.ee. IN A 192.168.145.128
mail.too.ee. IN A 192.168.145.129
www.too.ee. IN A 192.168.145.130
too.ee. IN CNAME www.too.ee.