首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    Linux学习之DNS+DHCP动态域名解析

    DNS用来做主机名和IP地址的解析 DHCP用来动态分配IP 这里要做的是,使DHCP在分配IP时,动态更新DNS的解析记录 服务器IP:192.168.0.202 客户端测试IP:192.168.0.240-250 1、DHCP [root@dd ~]# yum install dhcp.x86_64 -y [root@dd ~]# vim /etc/dhcp/dhcpd.conf 参考/usr/share/doc/dhcp*/dhcpd.conf.sample  option domain-name "example.com";  option domain-name-servers 192.168.0.202;  default-lease-time 600;  max-lease-time 7200;  log-facility local7;  subnet 192.168.0.0 netmask 255.255.255.0 {   range 192.168.0.240 192.168.0.250;   option routers 192.168.0.1;  } 最后需加入 ddns-update-style interim; update-conflict-detection false; key ddns {         algorithm hmac-md5;       secret MARnLjY0Har0LMmn8R/Biw==;       }; zone example.com. {  primary 192.168.0.202;  key ddns; } 测试DHCP,使用另外一台虚拟机test,ip为自动获取,OK 2、DNS [root@dd mnt]# yum install bind.x86_64 bind-chroot.x86_64 -y [root@dd mnt]# dnssec-keygen -a HMAC-MD5 -b 128 -n HOST ddns [root@dd named]# /etc/init.d/named start 在/var/named/chroot/etc下cp -p rndc.key ddns.key 更改ddns为 key "ddns" {         algorithm hmac-md5;         secret "MARnLjY0Har0LMmn8R/Biw=="; }; 更改named.conf 添加include "/etc/ddns.key"; options {     listen-on port 53 { any; }; 监听所有 // listen-on-v6 port 53 { ::1; };         directory "/var/named";         dump-file "/var/named/data/cache_dump.db";         statistics-file "/var/named/data/named_stats.txt";         memstatistics-file "/var/named/data/named_mem_stats.txt";         allow-query { any; }; 允许任何用户访问         recursion yes;         dnssec-enable yes;         dnssec-validation yes;         dnssec-lookaside auto;  /* Path to ISC DLV key */       bindkeys-file "/etc/named.iscdlv.key";

    01
    领券