[Comm] DDNS: что я сделал неправильно?
Eugene Prokopiev
=?iso-8859-1?q?john_=CE=C1_rmts=2Edonpac=2Eru?=
Вс Апр 4 16:43:08 MSD 2004
Здравствуйте!
Настроил DDNS так, как описано в
http://www.atmsk.ru/index.php?option=articles&task=viewarticle&artid=72
Вот настройки сервера:
# ls -l /var/lib/bind/etc/
total 36
-rw-r----- 1 root named 100 Apr 4 14:43 dhcp.key
-rw-r----- 1 root named 456 Apr 4 14:18 local.conf
-rw-r----- 1 root named 445 Apr 4 14:14 logging.conf
-rw-r----- 1 root named 322 Apr 4 14:16 named.conf
-rw-r----- 1 root named 447 Feb 10 2003 options.conf
-rw-r----- 1 root named 564 Feb 9 2003 rfc1912.conf
-rw-r----- 1 root named 1515 Feb 9 2003 rfc1918.conf
-rw-r----- 1 root named 108 Feb 9 2003 rndc.conf
-rw-r----- 1 root named 97 Apr 2 22:13 rndc.key
# cat /var/lib/bind/etc/named.conf
// This is the primary configuration file for the BIND DNS server named.
//
// If you are just adding zones, please do that in
/var/lib/bind/etc/local.conf
include "/etc/options.conf";
include "/etc/logging.conf";
include "/etc/rndc.conf";
include "/etc/dhcp.key";
include "/etc/rfc1912.conf";
include "/etc/local.conf";
# cat /var/lib/bind/etc/logging.conf
logging {
channel update_debug {
file "/var/update.log";
severity debug 3;
print-category yes;
print-severity yes;
print-time yes;
};
channel security_info {
file "/var/auth.log";
severity info;
print-category yes;
print-severity yes;
print-time yes;
};
category update { update_debug; };
category security { security_info; };
};
# cat /var/lib/bind/etc/dhcp.key
key DHCP_UPDATE {
algorithm HMAC-MD5.SIG-ALG.REG.INT;
secret "WOfB3kj8IhJK4OZ5s3zHeQ==";
};
# cat /var/lib/bind/etc/local.conf
// Consider adding the 1918 zones here, if they are not used in your
organization.
// include "/etc/rfc1918.conf";
// Add other zones here
zone "myserver.myprovider.ru" {
type master;
file "myserver.myprovider.ru-hosts";
forwarders {};
allow-update { key DHCP_UPDATE; };
};
zone "3.168.192.in-addr.arpa" {
type master;
file "myserver.myprovider.ru-reverse";
forwarders {};
allow-update { key DHCP_UPDATE; };
};
# ls -l /var/lib/bind/var
total 0
-rw-rw---- 1 root named 0 Apr 4 14:45 auth.log
-rw-rw---- 1 root named 0 Apr 4 14:45 update.log
# ls -l /var/lib/bind/zone/
total 28
-rw-r----- 1 root named 212 Feb 9 2003 127.in-addr.arpa
-rw-r----- 1 root named 309 Feb 9 2003 empty
-rw-rw---- 1 root named 287 Apr 4 14:49
myserver.myprovider.ru-hosts
-rw-rw---- 1 root named 206 Apr 4 14:52
myserver.myprovider.ru-reverse
-rw-r----- 1 root named 208 Feb 12 2003 localdomain
-rw-r----- 1 root named 178 Jan 13 2003 localhost
# cat /var/lib/bind/zone/myserver.myprovider.ru-hosts
$TTL 1D
@ IN SOA ns.myserver.myprovider.ru.
root.myserver.myprovider.ru. (
2003102202 ; serial
12H ; refresh
1H ; retry
1W ; expire
1H ; ncache
)
IN NS ns.myserver.myprovider.ru.
IN MX 10 mail.myserver.myprovider.ru.
@ IN A 192.168.1.1
ns IN A 192.168.1.1
mail IN A 192.168.1.1
# cat /var/lib/bind/zone/myserver.myprovider.ru-reverse
$TTL 1D
@ IN SOA myserver.myprovider.ru.
root.myserver.myprovider.ru. (
2003050603 ; serial
12H ; refresh
1H ; retry
1W ; expire
1H ; ncache
)
IN NS myserver.myprovider.ru.
1 IN PTR myserver.myprovider.ru.
# cat /etc/dhcpd.conf
# --- begin dynamic updates options
ddns-update-style interim;
ddns-updates on;
ddns-domainname "myserver.myprovider.ru";
ddns-rev-domainname "in-addr.arpa";
key DHCP_UPDATE {
algorithm HMAC-MD5.SIG-ALG.REG.INT;
secret "WOfB3kj8IhJK4OZ5s3zHeQ==";
# generated by /usr/sbin/dnssec-keygen -a HMAC-MD5 -b 128 -n USER
DHCP_UPDATE
}
zone myserver.myprovider.ru. {
primary 192.168.1.1;
key DHCP_UPDATE;
}
zone 3.168.192.in-addr.arpa. {
primary 192.168.1.1;
key DHCP_UPDATE;
}
# --- end dynamic updates options
# --- global options
option domain-name-servers 192.168.1.1;
option domain-name "myserver.myprovider.ru";
#option time-offset -5; # Eastern Standard Time
#option ntp-servers 192.168.3.1;
subnet 192.168.3.0 netmask 255.255.255.0 {
option routers 192.168.3.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.3.255;
#range dynamic-bootp 192.168.3.128 192.168.3.255;
default-lease-time 21600;
max-lease-time 43200;
host ns1 {
hardware ethernet 00:0C:29:84:99:5B;
fixed-address 192.168.3.4;
}
host ns2 {
hardware ethernet 00:0C:29:AC:39:0F;
fixed-address 192.168.3.9;
}
host ns3 {
hardware ethernet 00:0C:29:34:E9:39;
fixed-address 192.168.3.17;
}
}
Вот настройки клиента:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
DHCP_HOSTNAME=ns2
NETMASK=255.255.255.0
ONBOOT=yes
После service network restart на клиенте:
/var/log/messages на клиенте:
Apr 4 09:32:40 linuxbox network: Shutting down interface eth0: succeeded
Apr 4 09:32:40 linuxbox network: Setting network parameters: succeeded
Apr 4 09:32:41 linuxbox ifup: SIOCADDRT: Network is unreachable
Apr 4 09:32:41 linuxbox dhcpcd[886]: terminating on signal 1
Apr 4 09:32:41 linuxbox network: Bringing up interface lo: succeeded
Apr 4 09:32:41 linuxbox ifup: Determining IP information for eth0 via
dhcpcd...
Apr 4 09:32:41 linuxbox ifup: done.
Apr 4 09:32:41 linuxbox network: Bringing up interface eth0: succeeded
/var/log/messages на сервере:
Apr 4 16:32:38 myserver dhcpd: DHCPRELEASE of 192.168.3.9 from
00:0c:29:ac:39:0f via vmnet1 (not found)
Apr 4 16:32:39 myserver dhcpd: DHCPDISCOVER from 00:0c:29:ac:39:0f via
vmnet1
Apr 4 16:32:39 myserver dhcpd: DHCPOFFER on 192.168.3.9 to
00:0c:29:ac:39:0f via vmnet1
Apr 4 16:32:39 myserver dhcpd: DHCPDISCOVER from 00:0c:29:ac:39:0f via
vmnet1
Apr 4 16:32:39 myserver dhcpd: DHCPOFFER on 192.168.3.9 to
00:0c:29:ac:39:0f via vmnet1
Apr 4 16:32:39 myserver dhcpd: DHCPREQUEST for 192.168.3.9
(192.168.3.1) from 00:0c:29:ac:39:0f via vmnet1
Apr 4 16:32:39 myserver dhcpd: DHCPACK on 192.168.3.9 to
00:0c:29:ac:39:0f via vmnet1
Это тоже на сервере:
# ls -l /var/lib/bind/var
total 0
-rw-rw---- 1 root named 0 Apr 4 14:45 auth.log
-rw-rw---- 1 root named 0 Apr 4 14:45 update.log
Это результаты dns-запроса:
# nslookup -silent
> myserver.myprovider.ru
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: myserver.myprovider.ru
Address: 192.168.1.1
> ns2.myserver.myprovider.ru
Server: 127.0.0.1
Address: 127.0.0.1#53
** server can't find ns2.myserver.myprovider.ru: NXDOMAIN
Показать что-нибудь еще?
--
С уважением, Прокопьев Евгений
Подробная информация о списке рассылки community