: sergldom
02.10.2009 14:57 - 05.10.2009 07:45
Copyright 2009 ..
- 500 IP,
. 192.168.1.15 mail.example.com
. , ( IP
) - IP, :
1.
IP,
500 .
2.
DNS DNS IP ,
500 , IP
.
1 / 25
vi /etc/apt/sources.list
aptitude update
2 / 25
djbdns:
mkdir /var/lib/djbdns
tinydns dnscache:
3 / 25
DNS resolver ,
dnscache IP- 192.168.1.27 eth0:
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
svc -d /etc/service/dnscache
svc -u /etc/service/dnscache
svc -t /etc/service/dnscache
5 / 25
svstat /etc/service/dnscache
, 7 :
dnscache:
/etc/resolv.conf:
cp /etc/resolv.conf /etc/resolv.conf-original
/etc/resolv.conf :
6 / 25
tinydns /etc/service:
ln -s /var/lib/djbdns/tinydns /etc/service
svstat /etc/service/tinydns
7 / 25
, dnscache ,
tinydns example.com (
example.com
). :
svc -d /etc/service/dnscache
svc -u /etc/service/dnscache
(reverse lookups)
tinydns.
8 / 25
wget http://www.threadaweb.com/opensource/TinyDNSManager-0.70.tar
web :
mv TinyDNSManager /var/www/dns
9 / 25
mysql:
, root mysql-server:
,
root mysql-server:
mysql -p
FLUSH PRIVILEGES;
10 / 25
USE tinydns;
vi /var/www/dns/index.php
...
11 / 25
$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
$admin_user = "admin";
$admin_pass = "pass";
$db_name = "dns_config";
$db_user = "dnsuser";
$db_pass = "dnspass";
$db_host = "localhost";
12 / 25
$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
$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
http://192.168.1.27/dns
login admin
Pass pass
SOA Records:
15 / 25
NS Records:
MX Records:
TXT Records:
16 / 25
C-Name Records:
tinydns:
vi dns_update.php
#!/usr/local/bin/php -f
17 / 25
#!/usr/bin/php -f
...
...
$db_host = "localhost";
$db_name = "dns_config";
$db_user = "dbuser";
$db_pass = "dbpass";
18 / 25
$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";
$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
...
$db_host = "localhost";
$db_name = "tinydns";
$db_user = "tinydns";
$db_pass = "pass_tinydns";
$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
$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
root :
mv dns_update.php /etc/tinydns/
chmod +x /etc/tinydns/dns_update.php
vi /etc/rc.local
.....
exit 0
Apache2:
vi /etc/apache2/apache2.conf
22 / 25
<Directory "/var/www/dns/">
AllowOverride All
</Directory>
web :
/etc/init.d/apache2 restart
.htaccess:
vi /var/www/dns/.htaccess
23 / 25
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
http://lithium.opennet.ru/
http://www.threadaweb.com/tinydns.php
25 / 25