Portál AbcLinuxu, 4. prosince 2025 07:47
Řešení dotazu:
Potřebuju nějkým způspobem upravit bind ať nejdříve se podíva do hosts než začne sám překladat.
To není moc dobrý nápad. Pokud potřebujete, aby BIND různým klientům (typicky venku/vevnitř) odpovídal různě, použijte views. Případně to prostě přesměrujte.
// 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";
view "external" {
match-clients { any; };
recursion no;
// 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";
};
};
view "internal" {
match-clients { localnets; };
recursion yes; /* this is the default */
zone "se-mi.net" {
type master;
file "named.se-mi.net.lan";
allow-transfer { any; };
};
};
$ORIGIN se-mi.net.
$TTL 1d
@ IN SOA 10.0.0.1 admin.se-mi.net. (
2010082900 ; Serial yyyymmddnn
3h ; Refresh After 3 hours
1h ; Retry Retry after 1 hour
1h ; Expire after 1 week 1w
1h) ; Minimum negative caching of 1 hour
@ IN NS ns.se-mi.net.
@ 3600 IN MX 10 mail.se-mi.net.
@ 3600 IN A 10.0.0.1
ns 3600 IN A 10.0.0.1
mail 3600 IN A 10.0.0.7
gw-se-mi 3600 IN A 10.0.0.1
; lan data
;wks1 3600 IN A 192.168.1.5
;wks2 3600 IN A 192.168.1.5
;ks3 3600 IN A 192.168.1.5
match-clients { localnets; };acl localnets {10.0.0.0/16; 192.168.1.5/24;};match-clients {10.0.0.0/16; 192.168.1.5/24;};
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.