手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux之配置安全的DDNS实例

[日期:2011-11-24] 来源:Linux社区  作者:ethnicitybeta [字体:大 中 小]

基于linux的社区版本CentOS 5.5

(前提已经配置好本机器的DNS以及DHCP,并且功能都可以实现)

1、创建密匙


[root@www ~]# dnssec-keygen -a HMAC-MD5 -b 128 -n USER wethnicity

[root@www ~]# ls

Kwethnicity.+157+25917.key          

Kwethnicity.+157+25917.private

 

[root@www ~]# cat Kwethnicity.+157+25917.key

wethnicity. IN KEY 0 3 157 ue5+atxpNY0QJQyccGeKJw==

密匙为“ue5+atxpNY0QJQyccGeKJw==”

 

2、dns部分的设置[root@www ~]# vi /var/named/chroot/etc/named.conf

 

options

{

        directory "/var/named"; // the default

        forwarders{202.102.240.65;};

};

key wethnicity {

        algorithm HMAC-MD5.SIG-ALG.REG.INT;

        secret ue5+atxpNY0QJQyccGeKJw==;

};

zone "ethnicity.com" {

        type master;

        file "named.ethnicity";

        allow-update { key wethnicity; };

};

3、DHCP部分的配置


[root@www ~]# vi /etc/dhcpd.conf

ddns-update-style none;

ignore client-updates;

option routers                  192.168.1.1;

option subnet-mask              255.255.255.0;

option domain-name              "ethnicity.com";

option domain-name-servers      192.168.1.192;

option time-offset              -18000; # Eastern Standard Time

default-lease-time 21600;

max-lease-time 43200;

 

shared-network mysuper {

subnet 192.168.1.0 netmask 255.255.255.0 {

 

        option domain-name-servers      192.168.1.192;

        range dynamic-bootp 192.168.1.0 192.168.1.254;

 

        host ns {

                hardware ethernet 00:24:8C:AE:20:5F;

                fixed-address 192.168.1.188;

        }

}

subnet 192.168.2.0 netmask 255.255.255.0 {


 

        option domain-name-servers      192.168.1.192;

        range dynamic-bootp 192.168.2.0 192.168.2.254;

}

key wethnicity {

        algorithm HMAC-MD5.SIG-ALG.REG.INT;

        secret ue5+atxpNY0QJQyccGeKJw==;

}

zone ethnicity.com. {

        primary 192.168.1.192;

        key wethnicity;

}

zone 1.168.192.in-addr.arpa. {

        primary 192.168.1.192;

        key wethnicity;

}

}

4、重启服务


[root@www ~]# /etc/init.d/named restart

[root@www ~]# /etc/init.d/dhcpd restart

5、测试

在windows操作系统自动获取ip和dns即可然后可以在linux主机上看到相关的租赁[root@www ~]# cat /var/lib/dhcpd/dhcpd.leases

相应的ip上看到Windows主机的名称。

linux
相关资讯       Linux服务器 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款