1 (01.05.2011 11:15:24 отредактировано Kettler)

Выложу свои конфиги может кому пригодятся  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.1

cat /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.1

cat /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,

Ищу дополнительный заработок (удалёнка).
Пьянка без секса – признак алкоголизма.

2

Я бы логи вот так снял бы.... Проще читать

logging {
        channel query_logging {
                file "data/named_querylog"
                        versions 20 size 200M;
                print-time yes;
                severity dynamic;
        };
        channel security {
                file "data/named_security"
                        versions 10 size 50M;
                print-time yes;
                severity dynamic;
        };
        channel resolver {
                file "data/named_resolver"
                        versions 2 size 50M;
                print-time yes;
                severity dynamic;
        };
        channel network {
                file "data/named_network"
                        versions 2 size 50M;
                print-time yes;
                severity dynamic;
        };
        channel xfer {
                file "data/named_xfer"
                        versions 2 size 50M;
                print-time yes;
                severity dynamic;
        };
        channel client {
                file "data/named_client"
                        versions 2 size 50M;
                print-time yes;
                severity dynamic;
        };
        category queries { query_logging; };
        category security { security; };
        category resolver { resolver; };
        category network { network; };
        category xfer-in { xfer; };
        category xfer-out { xfer; };
        category client { client; };

        channel syslog_errors {
                syslog user;
                severity error;
        };
        category default { syslog_errors;  };

        category lame-servers { null; };
        category security { null; };
};
MX 23.6 Libretto x86_64
Чем больше я работаю админом, тем больше понимаю, насколько волшебна фраза - "Нет технической возможности!"

3

Ещё бы man найти нормальный

Ищу дополнительный заработок (удалёнка).
Пьянка без секса – признак алкоголизма.

4

Наконецто настроил связку --=XliN=-- помнил как я мучался с этим)) Вообщем в ходе следственных экспериментов выявил важную особенность, для того чтобы создавались файлы  *.jnl так же вносились записи в зоны DNS
нужно создать каталог в него положить файлы зон и назначить владельца bind этого каталога, иначе bind не будет иметь полномочия для внесения изменений

 Консоль:
chown -R bind:bind /var/named/dynamic/

просто назначить владельца bind на файлы зон не достаточно, по крайней мере в моем случае. Так что может кому пригодиться имейте в виду и такую особенность)