Выложу свои конфиги может кому пригодятся smile
===== Настройка DDNS+DHCP =====
apt-get install bind9 dhcp3-server
Давайте возьмём как пример example.com
cat /etc/bind/named.conf
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
controls {
inet 127.0.0.1 allow {localhost; } keys { "rndc-key"; };
};
include "/etc/bind/rndc.key";cat /etc/bind/named.conf.options
logging {
channel update_debug {
file "/etc/bind/named-update.log";
severity debug 3;
print-category yes;
print-severity yes;
print-time yes;
};
channel security_info {
file "/etc/bind/named-auth.log";
severity info;
print-category yes;
print-severity yes;
print-time yes;
};
category update { update_debug; };
category security { security_info; };
};
acl "corpnets" { 172.16.0.0/24; 127.0.0.1; 192.168.0.0/24;};
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 {
208.67.222.222;
208.67.220.220;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
allow-query { "corpnets"; };
};cat /etc/bind/named.conf.local
zone "example.com" {
type master;
file "/etc/bind/example.com.zone";
allow-update { key "rndc-key"; };
notify yes;
};
zone "0.16.172.in-addr.arpa" {
type master;
file "/etc/bind/0.16.172.in-addr.arpa.zone";
allow-update { key "rndc-key"; };
notify yes;
};cat /etc/bind/example.com.zone
$ORIGIN .
$TTL 86400 ; 1 day
example.com IN SOA example.com. root.example.com. (
51 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS server.example.com.
$ORIGIN example.com.
server A 172.16.0.1cat /etc/bind/0.16.172.in-addr.arpa.zone
$ORIGIN .
$TTL 86400 ; 1 day
0.16.172.in-addr.arpa IN SOA 0.16.172.in-addr.arpa. root.0.16.172.in-addr.arpa. (
51 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
604800 ; expire (1 week)
86400 ; minimum (1 day)
)
NS server.0.16.172.in-addr.arpa.
$ORIGIN 0.16.172.in-addr.arpa.
1 PTR server.example.com.
$TTL 10800 ; 3 hours
server A 172.16.0.1cat /etc/bind/rndc.key
key "rndc-key" {
algorithm hmac-md5;
secret "x64NWyCzBPF/hDTX8T3eEg==";
};cat /etc/dhcp3/dhcpd.conf
authoritative;
default-lease-time 600;
max-lease-time 7200;
option wpad-curl code 252 = text;
key "rndc-key" {
algorithm hmac-md5;
secret "x64NWyCzBPF/hDTX8T3eEg==";
};
server-identifier server;
ddns-domainname "example.com.";
ddns-rev-domainname "in-addr.arpa.";
ddns-update-style interim;
ddns-updates on;
ignore client-updates;
# This is the communication zone
zone example.com. {
primary 127.0.0.1;
key "rndc-key";
}
default-lease-time 21600; # 6 hours
max-lease-time 43200; # 12 hours
# Client configuration:
option domain-name "example.com.";
option ip-forwarding off;
subnet 172.16.0.0 netmask 255.255.255.0 {
option routers 172.16.0.1; #getway
option subnet-mask 255.255.255.0; #маска
option domain-name-servers 172.16.0.1; #DNS-сервера
option broadcast-address 172.16.0.255;
option wpad-curl "http://172.16.0.1:88/wpad.dat";
range 172.16.0.10 172.16.0.90; # Диапазон ip адресов
filename "hiren/pxelinux.0";
next-server 172.16.0.1;
allow unknown-clients;
zone 0.16.172.in-addr.arpa. {
primary 172.16.0.1;
key "rndc-key";
}
zone localdomain. {
primary 172.16.0.1;
key "rndc-key";
}
}В Ubuntu возникла пробела с правами apparmor
nano /etc/apparmor.d/usr.sbin.named
ищим
/etc/bind/** r, заменяем на /etc/bind/** rw,
Пьянка без секса – признак алкоголизма.
