Bind 9 ustawienie i konfiguracja - serwer DNS

Konfiguracja serwerów, usług, itp.
Barti
Posty: 71
Rejestracja: 17 stycznia 2009, 16:55

Bind 9 ustawienie i konfiguracja - serwer DNS

Post autor: Barti »

Postępowałem według poradnika http://debian.linux.pl/viewtopic.php?t=3267 błędów nie było i tu zaczyna się problem nadal nie działa mi serwer dns.
Wpisy wyglądają tak:

/etc/bin/named.conf.local

Kod: Zaznacz cały

// 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";

// prime the server with knowledge of the root servers
zone "." {
	type hint;
	file "/etc/bind/db.root";
};

// 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 "allemuza.pl" IN { 
    type master; 
    file "/etc/bind/db.allemuza.pl"; 
    allow-query { allemuza.pl; }; 
};


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";
};

// zone "com" { type delegation-only; };
// zone "net" { type delegation-only; };

// From the release notes:
//  Because many of our users are uncomfortable receiving undelegated answers
//  from root or top level domains, other than a few for whom that behaviour
//  has been trusted and expected for quite some length of time, we have now
//  introduced the "root-delegations-only" feature which applies delegation-only
//  logic to all top level domains, and to the root domain.  An exception list
//  should be specified, including "MUSEUM" and "DE", and any other top level
//  domains from whom undelegated responses are expected and trusted.
// root-delegation-only exclude { "DE"; "MUSEUM"; };

include "/etc/bind/named.conf.local";
No i plik strefy /etc/bind/db.siec.domowa (zmienilem nazwe siec.domowa na allemuza.pl)

Kod: Zaznacz cały

$TTL    604800 
@       IN      SOA     stacjonarny.allemuza.pl root.stacjonarny.allemuza.pl ( 
            1             ; Serial 
            604800            ; Refresh 
            86400             ; Retry 
            2419200         ; Expire 
            604800 )           ; Negative Cache TTL 

    IN    NS    dns1.allemuza.pl 
    IN    NS    dns2.allemuza.pl
    IN    MX    10    smtp.allemuza.pl

@            IN    A    87.98.157.166 

stacjonarny        IN    A    87.98.157.166 
dns1            IN    A    87.98.157.166 
smtp            IN    A    87.98.157.166 

dns2            IN    A    87.98.157.166
/etc/bin/named.conf.local

Kod: Zaznacz cały

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "allemuza.pl" IN { 
    type master; 
    file "/etc/bind/db.allemuza.pl"; 
    allow-query { allemuza.pl; }; 
}; 

zone "0.168.192.IN-ADDR.ARPA" IN { 
    type master; 
    file "/etc/bind/db.192"; 
    allow-query { allemuza.pl; }; 
};

/etc/bind/db.192 (ten plik utworzyłem)

Kod: Zaznacz cały

$TTL    600 
0.168.192.IN-ADDR.ARPA.   IN      SOA     stacjonarny.allemuza.pl    root.stacjonarny.allemuza.pl ( 
            1              ; serial 
                        12h             ; refresh 
                        1h              ; retry 
                        2w              ; expire 
                        1h              ; default_ttl 
                        ) 

            IN      NS      dns1.allemuza.pl 
            IN      NS      dns2.allemuza.pl 

1    IN      PTR     stacjonarny.allemuza.pl 
2    IN    PTR    dns2.allemuza.pl  
Jak tak zrobiłem to co teraz aby działała mi domena allemuza.pl, którą mam na domenomania.pl?
Awatar użytkownika
grzesiek
Junior Member
Posty: 932
Rejestracja: 06 stycznia 2008, 10:41
Lokalizacja: Białystok

Post autor: grzesiek »

Hy... a co ty w ogóle chcesz osiągnąć?
Po pierwsze, tak na szybki rzut oka to w named.conf.local masz:

Kod: Zaznacz cały

zone "allemuza.pl" IN {
    type master;
    file "/etc/bind/db.allemuza.pl"; 
a plik strefy to db.siec.domowa eeee?

Masz wykupioną domenę allemuza.pl i chcesz stacjonarny.allemuza.pl wskazywał na 87.98.157.166? To musisz ustawić w panelu domenomania.pl, że stacjonarny.allemuza.pl to 87.98.157.166 i (bo chyba o to Ci chodzi) slave DNS tej twojej domeny to twój komp?
Barti
Posty: 71
Rejestracja: 17 stycznia 2009, 16:55

Post autor: Barti »

Czytałeś to co napisałem w nawiasie ;p
No i plik strefy /etc/bind/db.siec.domowa (zmieniłem nazwę siec.domowa na allemuza.pl).

A z tym drugim o co ci chodzi ,,slave dns''? Przepraszam ale jakoś tego mi się nie udało jeszcze zrobić dobrze.

[Dodano: 2009-03-06, 21:40]
Mam domenę allemuza wykupioną w innym hostingu chcę aby mój serwer 87.98.157.166 był widoczny na domenie allemuza.pl, w tym celu trzeba dodać adres serwera dns do panelu z domeną. Jak mam to dokładnie ustawić, o to mi chodzi?
Awatar użytkownika
grzesiek
Junior Member
Posty: 932
Rejestracja: 06 stycznia 2008, 10:41
Lokalizacja: Białystok

Post autor: grzesiek »

Przepraszam ;-) pisałem, że tak na szybki rzut oka.

Chcesz przenieść obsługę swojej domeny na własny serwer? Musisz więc tam rekord NS zmienić na swój IP. Z ty, że to nie koniec bajki ;-) bo aby na swoim kompie mieć serwer DNS widziany przez cały świat twój usługodawca połączenia musi Ci to udostępnić poprzez specjalny wpis w swoim DNS - tzw. translacji odwrotnej i rekord PTR.
Barti
Posty: 71
Rejestracja: 17 stycznia 2009, 16:55

Post autor: Barti »

Mów bardziej po polsku ;p Czytałem, że muszę mieć na swoim serwerze, który mam z ovh. Serwery dns dajmy na to dns1.nazwa strony i dns2.nazwa strony. I jak je zrobiłem przez instalację binda 9 to jak dodać te adresy do panelu domeny u innego usługodawcy aby wskazywała na mój serwer?
Barti
Posty: 71
Rejestracja: 17 stycznia 2009, 16:55

Post autor: Barti »

Ty jak zwykle się masz o coś problemy no ale co zrobić modyfikacje do pisowni masz wgraną to twoja praca łatwa :)

Po prostu chce żebym nie musiał wpisywać za każdym razem adresu ip mojego serwera tylko wchodzić przez domenę którą mam kupioną i teraz co mam zainstalować jeszcze i jak ustawić to bind9 aby działało dobrze.
Awatar użytkownika
grzesiek
Junior Member
Posty: 932
Rejestracja: 06 stycznia 2008, 10:41
Lokalizacja: Białystok

Post autor: grzesiek »

Do tego nie jest Ci potrzebny bind tylko rekord stacjonarny.allemuza.pl A 87.98.157.166 w domenomania.pl
Barti
Posty: 71
Rejestracja: 17 stycznia 2009, 16:55

Post autor: Barti »

Zainstalowalem to z poradnika http://linux.justinhartman.com/DNS_Inst ... sing_BIND9

allemuza.pl.db

Kod: Zaznacz cały

; 
; BIND data file for allemuza.pl 
; 
$TTL    604800 
@       IN      SOA     allemuza.pl. info.allemuza.pl. ( 
                            2009003509         ; Serial 
                                  7200         ; Refresh 
                                   120         ; Retry 
                               2419200         ; Expire 
                                604800)        ; Default TTL 
; 
@       IN      NS      ns1.r20175.ovh.net. 
@       IN      NS      ns2.r20175.ovh.net. 
allemuza.pl.    IN      MX      10      mail.allemuza.pl. 
allemuza.pl.    IN      A      87.98.157.166 
www                     IN      CNAME   allemuza.pl. 
mail                    IN      A       87.98.157.166 
ftp                     IN      CNAME   allemuza,pl. 
allemuza.pl.            IN      TXT     "v=spf1 ip4:87.98.157.166 a mx ~all" 
mail                    IN      TXT     "v=spf1 a -all" 


87.98.157.rev

Kod: Zaznacz cały

$TTL 1d ; 
$ORIGIN 254.168.192.IN-ADDR.ARPA. 
@       IN      SOA     ns1.r20175.ovh.net.   info.r20175.ovh.net. ( 
                                       2009031501 
                                       7200 
                                       120 
                                       2419200 
                                       604800 
) 
        IN      NS      ns1.r20175.ovh.net. 
        IN      NS      ns2.r20175.ovh.net. 
1       IN      PTR     ns1.sdns1.ovh.net. 
2       IN      PTR     ns2.sdns1.ovh.net. 

named.conf.local

Kod: Zaznacz cały

zone "allemuza.pl" { 
       type master; 
       file "/etc/bind/zones/master/allemuza.pl.db"; 
}; 

zone "87.98.157.IN-ADDR.ARPA" { 
       type master; 
       file "/etc/bind/zones/master/87.98.157.rev"; 
}; 

wykonalem

Kod: Zaznacz cały

r20175:~# /etc/init.d/bind9 restart 
Stopping domain name service...: bindrndc: connection to remote host closed 
This may indicate that the remote server is using an older version of 
the command protocol, this host is not authorized to connect, 
or the key is invalid. 
 failed! 
Starting domain name service...: bind. 

Kod: Zaznacz cały

r20175:~# nslookup ns1.r20175.ovh.net 
Server:         127.0.0.1 
Address:        127.0.0.1#53 

** server can't find ns1.r20175.ovh.net: NXDOMAIN


[ Dodano: 2009-03-09, 13:30 ]
a i nie wykonalem tego

Kod: Zaznacz cały

Bind now has its own dir with space for .pid files and config files. In order to keep things clear we made a symlink back to /etc/. 

Now edit /etc/init.d/sysklogd to allow logging of bind activity. Replace this: 
SYSLOGD=""

With this: 
SYSLOGD="-a /var/lib/named/dev/log"
w tym pliku nie mam SYSLOGD=""
ODPOWIEDZ