Вы находитесь на странице: 1из 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64

: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

Copyright 2009 ..

djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


- 500 IP,
. 192.168.1.15 mail.example.com
. , ( IP
) - IP, :
1.
IP,
500 .
2.
DNS DNS IP ,
500 , IP
.

1 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

djbdns + A pache2 + php5 + mysql-server

vi /etc/apt/sources.list

deb http://mirror.yandex.ru/debian lenny main contrib non-free

aptitude update

2 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

aptitude install djbdns apache2 php5 php5-cli mysql-server-5.0

djbdns:

mkdir /var/lib/djbdns

tinydns dnscache:

adduser --no-create-home --disabled-login -c "DJBDNS dnscache user" --shell /bin/false


dnscache

adduser --no-create-home --disabled-login -c "DJBDNS dnslog user" --shell /bin/false dnslog

3 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

adduser --no-create-home --disabled-login -c "DJBDNS tinydns user" --shell /bin/false tinydns

DNS resolver ,
dnscache IP- 192.168.1.27 eth0:

dnscache-conf dnscache dnslog /var/lib/djbdns/dnscache 192.168.1.27

dnscache 192.168.1.0/24:

touch /var/lib/djbdns/dnscache/root/ip/192.168.1

dnscache /etc/service:

ln -s /var/lib/djbdns/dnscache /etc/service

4 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

svc -d /etc/service/dnscache

svc -u /etc/service/dnscache

svc -t /etc/service/dnscache

5 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

svstat /etc/service/dnscache

, 7 :

/etc/service/dnscache: up (pid 8453) 7 seconds

dnscache:

/etc/resolv.conf:

cp /etc/resolv.conf /etc/resolv.conf-original

/etc/resolv.conf :

6 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

echo "nameserver 192.168.1.27" > /etc/resolv.conf

"split horizon" tinydns

Tinydns IP- loopback- 127.0.0.1:

tinydns-conf tinydns dnslog /var/lib/djbdns/tinydns 127.0.0.1

tinydns /etc/service:

ln -s /var/lib/djbdns/tinydns /etc/service

svstat /etc/service/tinydns

7 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

, dnscache ,

tinydns example.com (
example.com
). :

echo 127.0.0.1 > /var/lib/djbdns/dnscache/root/servers/example.com

echo 127.0.0.1 > /var/lib/djbdns/dnscache/root/servers/192.168.1.in-addr.arpa

svc -d /etc/service/dnscache

svc -u /etc/service/dnscache

(reverse lookups)
tinydns.

TinyDNS Web Manager:

8 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

TinyDNS Web Manager:

wget http://www.threadaweb.com/opensource/TinyDNSManager-0.70.tar

tar -xvf TinyDNSManager-0.70.tar

web :

mv TinyDNSManager /var/www/dns

web dns.php index.php

cd /var/www/dns && mv dns.php index.php

9 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

mysql:

, root mysql-server:

mysqladmin -u root -p create tinydns

,
root mysql-server:

mysql -p

GRANT SELECT, INSERT, UPDATE, DELETE ON tinydns.* TO 'tinydns'@'localhost'


IDENTIFIED BY 'pass_tinydns';

FLUSH PRIVILEGES;

10 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

USE tinydns;

mysql -uroot -p tinydns < /var/www/dns/structure.sql

TinyDNS Web Manager:

vi /var/www/dns/index.php

...

11 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

$local_file = "/web/sites/domain/temp/data";

$ns1 = "ns1.yourdomain.com";

$ns2 = "ns2.yourdomain.com";

$nsadmin = "support.yourdomain.com"; // This is the contact email address must have a period
instead of a @ symbol

$site_name = "Your Company";

$admin_user = "admin";

$admin_pass = "pass";

$db_name = "dns_config";

$db_user = "dnsuser";

$db_pass = "dnspass";

$db_host = "localhost";

12 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

$page_name = "dns.php";

...

...

$local_file = "/var/www/dns/temp/data";

$ns1 = "ns1.example.com";

$ns2 = "ns2.example.com";

$nsadmin = "forum.example.com"; // This is the contact email address must have a period
instead of a @ symbol

$site_name = "PFU";

$admin_user = "admin";

$admin_pass = "pass";

$db_name = "tinydns";

13 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

$db_user = "tinydns";

$db_pass = "pass_tinydns";

$db_host = "localhost";

$page_name = "index.php";

admin pass

/var/www/dns/temp:
mkdir -p /var/www/dns/temp/

web :

14 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

chown -R www-data:www-data /var/www/dns/

http://192.168.1.27/dns

login admin

Pass pass

Add Domain Domain Name: example.com, Domain IP: 192.168.1.119


Add Domain

Records for example.com

Add New: A NS MX TXT Delete example.com

SOA Records:

SOA example.com ns1.example.com Edit

15 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

NS Records:

NS example.com ns1.example.com Edit Delete

NS example.com ns2.example.com Edit Delete

MX Records:

MX example.com mail.example.com Edit Delete

TXT Records:

TXT example.com v=spf1 ip4:72.3.157.0/24 -all Edit Delete

A Records: Order by Name IP

A+PTR mail.example.com 192.168.1.119 Edit Delete

A+PTR www.example.com 192.168.1.119 Edit Delete

A example.com 192.168.1.119 Edit Delete

16 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

A ftp.example.com 192.168.1.119 Edit Delete

C-Name Records:

: A ftp.example.com 192.168.1.119 Edit Delete : A ftp.example.com 192.168.1.110


Edit Delete

: A+PTR mail.example.com 192.168.1.119 Edit Delete : A+PTR mail.example.com


192.168.1.15 Edit Delete



tinydns:

vi dns_update.php

#!/usr/local/bin/php -f

17 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

#!/usr/bin/php -f

...

...

// Database connection info

$db_host = "localhost";

$db_name = "dns_config";

$db_user = "dbuser";

$db_pass = "dbpass";

18 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

// Check for updates every x number of seconds

$delay = "60";

// Set this to "yes" if you are running 2 ns servers on the same machine, otherwise set it to "no"

$second_ns = "yes";

// The directory and data file for the first ns server

$NS1_data_file = "/etc/tinydns1/root/data";

$NS1_root_directory = "/etc/tinydns1/root";

// The directory and data file for the second ns server (ONLY FILL OUT IF $second_ns = "yes"!)

$NS2_data_file = "/etc/tinydns2/root/data";

$NS2_root_directory = "/etc/tinydns2/root";

...

19 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

...

// Database connection info

$db_host = "localhost";

$db_name = "tinydns";

$db_user = "tinydns";

$db_pass = "pass_tinydns";

// Check for updates every x number of seconds

$delay = "60";

// Set this to "yes" if you are running 2 ns servers on the same machine, otherwise set it to "no"

$second_ns = "no";

20 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

// The directory and data file for the first ns server

$NS1_data_file = "/var/lib/djbdns/tinydns/root/data";

$NS1_root_directory = "/var/lib/djbdns/tinydns/root";

// The directory and data file for the second ns server (ONLY FILL OUT IF $second_ns = "yes"!)

$NS2_data_file = "/etc/tinydns2/root/data";

$NS2_root_directory = "/etc/tinydns2/root";

...


mkdir /etc/tinydns

21 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

root :

mv dns_update.php /etc/tinydns/

chown root:root /etc/tinydns/dns_update.php

chmod +x /etc/tinydns/dns_update.php

vi /etc/rc.local

.....

/etc/tinydns/dns_update.php > /dev/null &

exit 0

Apache2:

vi /etc/apache2/apache2.conf

22 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

<Directory "/var/www/dns/">

AllowOverride All

</Directory>

web :
/etc/init.d/apache2 restart

.htaccess:
vi /var/www/dns/.htaccess

23 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

AuthName "Password please!!!"

AuthType Basic

AuthUserFile /var/www/dns/.htpasswd

require valid-user

admin, 2
:
htpasswd -c /var/www/dns/.htpasswd admin

:
rm /var/www/dns/structure.sql

. .

24 / 25

Install djbdns(dnscache, tinydns) + TinyDNS Web Manager debian lenny amd64


: sergldom
02.10.2009 14:57 - 05.10.2009 07:45

http://lithium.opennet.ru/

http://www.threadaweb.com/tinydns.php

25 / 25