debian,ubuntu,linux,howtos,manuals,notes,manpages

bind9 in a Vserver

February 15, 2009
By

ns0.cipar.net (192.168.1.17)

This will be the resolving nameserver available to the local network, and the authoritive for the domains.
http://www.debian-administration.org/articles/355

Installation

newvserver --vsroot /VSERVERS --hostname ns0 --domain cipar.net --ip 192.168.1.17/24 --dist etch --mirror http://192.168.1.12:3142/debian.apt-get.eu/debian  --interface dummy0 
Your current time zone is set to Unknown
Do you want to change that? [n]:

Enter for default
 Enable shadow passwords?
<Yes> 
enter the root password
Create a normal user account now?
 <No>    
Choose software to install:
<Ok> 

some problems with bind9 in a vserver can be solved by setting the CAPS

nano /etc/vservers/ns0/bcapabilities
CAP_SYS_RESOURCE
vserver ns0 start
vserver ns0 enter
nano /etc/apt/sources.list
deb http://192.168.1.12:3142/security.debian.org/ etch/updates main contrib
deb http://192.168.1.12:3142/ftp.nl.debian.org/debian/ etch main contrib non-free
apt-get update
apt-get upgrade

http://manpages.songshu.org/manpages/lenny/en/man8/named.8.html

apt-get install bind9 dnsutils

To set up the external part we do as follows:

nano /etc/bind/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";
acl internals {
    127.0.0.0/8;
    192.168.1.0/24;
    192.168.0.0/24;
};
//acl slaves {
//    195.234.42.0/24;    // XName
//    193.218.105.144/28; // XName
//    193.24.212.232/29;  // XName
//};

view "internal" {
    match-clients { internals; };
        recursion yes;
        zone "cipar.net" {
        type master;
        file "/etc/bind/db.cipar.net";
        };
// 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 "external" {
//    match-clients { any; };
//    recursion no;
//    zone "songshu.org" {
//    type master;
//    file "/etc/bind/external/db.songshu.org";
//    allow-transfer { slaves; };
//};
nano /etc/bind/db.example.com
; example.com
$TTL    604800
@       IN      SOA     ns1.example.com. root.example.com. (
                     2006020201 ; Serial
                         604800 ; Refresh
                          86400 ; Retry
                        2419200 ; Expire
                         604800); Negative Cache TTL
;
@       IN      NS      ns1
        IN      MX      10 mail
        IN      A       192.0.2.1
ns1     IN      A       192.0.2.1
mail    IN      A       192.0.2.128 ; We have our mail server somewhere else.
www     IN      A       192.0.2.1
client1 IN      A       192.0.2.201 ; We connect to client1 very often.

Tags: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*