Pythontr

husonet | Tarih: 05.06.2011

debian squeeze ile güvenli bind kurulumu

`Bind` dns sunucu kurulumu CHROOT kullanarak güvenliği en üst seviyede yapacağız.

BIND9 Kurulumu
aptitude install bind9 dnsutils


Konfigurasyon ayarlarına başlayalım.
vim /etc/bind/named.conf.options 
options {
directory "/var/cache/bind";

auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};


Yetkili DNS Ayarları
vim /etc/bind/named.conf.local
zone "pythontr.com" {
type master;
file "/etc/bind/zones/pythontr.com.db";
};

zone "31.89.69.in-addr.arpa"{
type master;
file "/etc/bind/zones/rev.31.89.69.in-addr.arpa";
};



Alan Adı Ekleme
mkdir /etc/bind/zones
vim /etc/bind/zones/pythontr.com.db
;
; SOA
;
$TTL 1h
@ IN SOA ns1.pythontr.com. hostmaster.pythontr.com. (
0000000001 ; Serial number
1h ; Slave refresh
15m ; Slave retry
2w ; Slave expire
1h ; Negative Cache TTL
)
;
; Name Server Kayıtları
;
@ IN NS ns1.pythontr.com.
@ IN NS ns2.pythontr.com.
;
; Mail Kayıtları
;
@ IN MX 10 mail.pythontr.com.
;
; A Kayıtları
;
@ IN A 69.89.31.166
www IN A 69.89.31.166
ns1 IN A 69.89.31.166
ns2 IN A 69.89.31.166
mail IN A 69.89.31.166
destek IN A 69.89.31.166


TERS DNS
vim /etc/bind/zones/rev.31.89.69.in-addr.arpa

$TTL 1h
@ IN SOA ns1.pythontr.com. hostmaster.pythontr.com. (
0000000001;
1h;
15m;
2w;
1h
)

IN NS ns1.pythontr.com.
1 IN PTR pythontr.com.
2 IN PTR pythontr.com.
3 IN PTR pythontr.com.
4 IN PTR pythontr.com.


CHROOT AYARLARI
vim /etc/default/bind9
# run resolvconf?
RESOLVCONF=yes
# startup options for the server
OPTIONS="-u bind -t /var/lib/named"

mkdir -p /var/lib/named/etc
mkdir -p /var/lib/named/dev
mkdir -p /var/lib/named/var/cache/bind
mkdir -p /var/lib/named/var/run/bind/run

mv /etc/bind /var/lib/named/etc

ln -s /var/lib/named/etc/bind /etc/bind

mknod /var/lib/named/dev/null c 1 3
mknod /var/lib/named/dev/random c 1 8

vim /etc/init.d/sysklogd
SYSLOGD="-a /var/lib/named/dev/log"

/etc/init.d/sysklogd restart
/etc/init.d/bind9 restart

vim /etc/resolv.conf
nameserver 69.89.31.166


DNS Ayarlarını Kontrolü
dig @69.89.31.166 pythontr.com


; <<>> DiG 9.5.0-P2 <<>> @172.16.3.1 pythontr.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42726
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;pythontr.com. IN A

;; ANSWER SECTION:
pythontr.com. 3600 IN A 69.89.31.166

;; AUTHORITY SECTION:
pythontr.com. 3600 IN NS ns1.pythontr.com.
pythontr.com. 3600 IN NS ns2.pythontr.com.

;; ADDITIONAL SECTION:
ns1.pythontr.com. 3600 IN A 69.89.31.166
ns2.pythontr.com. 3600 IN A 69.89.31.166

;; Query time: 0 msec
;; SERVER: 172.16.3.1#53(172.16.3.1)
;; WHEN: Sun Mar 8 17:53:47 2009
;; MSG SIZE rcvd: 116


host 69.89.31.166

166.31.89.69.in-addr.arpa domain name pointer pythontr.com.


Eğer mail hizmetinizi Gmail’den alıyorsanız alanadı dosyamızda aşağıdaki yeri;

@               IN      MX      10      mail.pythontr.com.


Siliyorsunuz. Gmail’e ait bilgileri onun yerine ekliyorsunuz.
pythontr.com.		3600	IN	MX	3 alt2.aspmx.l.google.com.
pythontr.com. 3600 IN MX 5 aspmx2.googlemail.com.
pythontr.com. 3600 IN MX 5 aspmx3.googlemail.com.
pythontr.com. 3600 IN MX 1 aspmx.l.google.com.
pythontr.com. 3600 IN MX 3 alt1.aspmx.l.google.com.