本示例介绍了如何设置典型的 DDNS 配置。
假设:
以下假设适用于此 DDNS 配置示例:
存在一个服务器,负责处理 SP 所在网络的 DNS 和 DHCP。
SP 网络地址为 192.168.1.0。
DHCP/DNS 服务器地址为 192.168.1.2。
从 192.168.1.100 到 192.168.1.199 之间的 IP 地址用作地址池,为 SP 和其他客户机提供地址。
域名为 example.com。
不存在现有的 DNS 或 DHCP 配置。如果存在,请参考本示例中的 .conf 文件对现有配置进行更新。
可以使用此处提供的以下步骤和样例文件,进行特定于站点的修改后设置您自己的 DDNS 配置。
安装 dnsutils 软件包后可以访问 dig、nslookup 以及其他有用工具。
options {
directory "/var/cache/bind";
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
// 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";
};
// additions to named.conf to support DDNS updates from dhcp server
key server.example.com {
algorithm HMAC-MD5;
secret "your-key-from-step-2-here"
};
zone "example.com" {
type master;
file "/etc/bind/db.example.com";
allow-update { key server.example.com; };
};
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.example.rev";
allow-update { key server.example.com; };
};
空区域文件的名称应为 /etc/bind/db.example.com 和 /etc/bind/db.example.rev。
复制分发包中提供的 db.empty 文件即可;DNS 服务器将自动更新这些文件。
ddns-update-style interim;
ddns-updates on;
server-identifier server;
ddns-domainname "example.com.";
ignore client-updates;
key server.example.com {
algorithm hmac-md5;
secret your-key-from-step-2-here;
}
zone example.com. {
primary 127.0.0.1;
key server.example.com;
}
zone 1.168.192.in-addr.arpa. {
primary 127.0.0.1;
key server.example.com;
}
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.199;
option domain-name-servers 192.168.1.2;
}
这些服务器处于运行状态后,当已配置 DHCP 的任何新 Oracle ILOM SP 开机时,可使用这些 ILOM SP 的主机名自动访问这些 ILOM SP。如有必要,请使用日志文件、dig、nslookup 以及其他实用程序进行调试。
有关本示例中使用的 Linux DHCP 和 DNS 服务器的更多信息,请参见 Internet Systems Consortium Web 站点,网址为:http://www.isc.org/