Portál AbcLinuxu, 9. listopadu 2025 08:50
/etc/resolv.conf obhospodaruje lokalni preklad adres.
resolvconf, tak ten by to spachat mohl. Zkuste se treba podivat do /var/run/bind/named.options, jestli tam neni sekce forwarders s povedomymi ip adresami...
/var/run/bind/named.options nemam. Nevim, jestli koukam na spravne misto, ale v /etc/bind/named.conf.local mam:
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you might need to uncomment the query-source
// directive below. Previous versions of BIND always asked
// questions using port 53, but BIND 8.1 and later use an unprivileged
// port by default.
// query-source address * port 53;
// 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 {
// 0.0.0.0;
// };
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
je tam skoro vsechno zakomentovane, tak nevim...
/etc/bind/named.conf.options
Soubor: named.conf
// 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 "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";
............
Soubor: named.conf.local
//
// 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 "neco.loc" {
type master;
file "/etc/bind/zones/master/neco.loc.db";
};
zone "10.0.10.IN-ADDR.ARPA" {
type master;
file "/etc/bind/zones/master/10.0.10.rev";
};
............
Soubor: 10.0.10.rev
$TTL 1w ;
$ORIGIN 10.0.10.IN-ADDR.ARPA.
@ IN SOA server.neco.loc. root.neco.loc. (
2008011201
10800
1800
1209600
604800 )
IN NS server.neco.loc.
1 IN PTR server.neco.loc.
2 IN PTR pavel-pc.neco.loc.
3 IN PTR petra-pc.neco.loc.
5 IN PTR pavel-spa.neco.loc.
6 IN PTR petra-spa.neco.loc.
7 IN PTR kamera-kancl.neco.loc.
.............
Soubor: neco.loc.db
$TTL 1w
@ IN SOA server.neco.loc. root.neco.loc. (
2008011201 ; Serial
10800 ; Refresh
1800 ; Retry
604800 ; Expire
900 ) ; Default TTL
; Nameservery
IN NS server.neco.loc.
; Mailservery
IN MX 10 mail.neco.loc.
; Hosts
server IN A 10.0.10.1
mail IN CNAME server
pop3 IN CNAME server
smtp IN CNAME server
pavel-pc IN A 10.0.10.2
petra-pc IN A 10.0.10.3
pavel-spa IN A 10.0.10.5
petra-spa IN A 10.0.10.6
kamera-kancl IN A 10.0.10.7
..........
Soubor: named.conf.options
// If there is a firewall between you and nameservers you want
// to talk to, you might need to uncomment the query-source
// directive below. Previous versions of BIND always asked
// questions using port 53, but BIND 8.1 and later use an unprivileged
// port by default.
// query-source address * port 53;
// 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 {
// 0.0.0.0;
// };
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
.............
Soubor: resolv.conf search neco.loc nameserver 127.0.0.1..............
Soubor: hostname server..............
Soubor: host.conf order hosts, bind multi on.............. NEUSPOKOJIVY VYSLEDEK JE ZDE:
server:/etc# nslookup server.neco.loc Server: 10.0.10.1 Address: 10.0.10.1#53 ** server can't find server.neco.loc: SERVFAILProsim Vas, kde tedy delam chybu? Pokud Vas zajima jeste nejaky soubor, pastnu ho sem.. diky
server:/etc/bind/zones/master# named-checkzone neco.loc /etc/bind/zones/master/neco.loc.db zone neco.loc/IN: loaded serial 2008011201 OK server:/etc/bind/zones/master# named-checkzone 10.0.10.in-addr.arpa /etc/bind/zones/master/10.0.10.rev zone 10.0.10.in-addr.arpa/IN: loaded serial 2008011201 OK
/etc/hosts mam:
127.0.0.1 localhost 10.0.10.1 server.neco.loc server
/etc/bind/zones/ ; /etc/bind/zones/master/ ; /etc/bind/zones/master/10.0.10.rev a /etc/bind/zones/master/neco.loc.db ? Podle toho navodu jsem vytvoril i skupinu bind a uzivatele bind. Diky
$TTL 1w
@ IN SOA server.neco.loc. root.neco.loc. (
2008011201 ; Serial
10800 ; Refresh
1800 ; Retry
604800 ; Expire
900 ) ; Default TTL
; Nameservery
IN NS server.neco.loc.
; Mailservery
IN MX 10 mail.neco.loc.
; Hosts
server IN A 10.0.10.1
mail IN A 10.0.10.1
pop3 IN CNAME server
smtp IN CNAME server
pavel-pc IN A 10.0.10.2
petra-pc IN A 10.0.10.3
pavel-spa IN A 10.0.10.5
petra-spa IN A 10.0.10.6
kamera-kancl IN A 10.0.10.7
Predpokladam, ze takovou vec, jako reloadnout po zmene konfiguraku binda, jste udelal. Pokud to nebude fungovat, pastnete se vystup prikazu dig server.neco.loc. (tecka na konci!).
Uzivatel a skupina bind by se meli vytvaret pri instalaci bindu, je divne, jestli jste je musel dodelavat rucne. Prava dejte stejna, jako maji /etc/bind a /etc/bind/named.conf, tzn 0755 pro adresare a 644 pro soubory.
. Tak bud nechat nainstalovaný Bind nebo na DHCP nastavit, aby přidělovat DNS co máte od ISP. Jinak Bind má v konfiguraci na Debianu kořenové DNS defaultně nastavené, proto vám to jede bez konfigurace hned po instalaci.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.