位置: 编程技术 - 正文
推荐整理分享CentOS 7实现DNS+DHCP动态更新详解(centos 7 dns),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:centos7.6 dns配置,centos7 dns设置,centos 7 dns,centos7 dns设置,centos 7 dns,centos7.2配置dns,centos7 dns设置,centos7.6 dns配置,内容如对您有帮助,希望把文章链接给更多的朋友!
windows域里有一个功能,dhcp把新分发的ip数据发给DNS服务器,这样只要知道一个人的电脑名字就可以很方便的远程。
linux当然也能很好的实现类似的功能。man 5 dhcpd.conf 有详细描述。
昨天运维帮组织线下的沙龙,又拍云的运维总监邵海杨先生分享了一句“千金难买早知道”。是啊,就在实现动态更新的功能上,在网上找了不少博客,照着做又遇到各种问题,最后不不知道到底什么原理实现的。早知道认真看一下man,问题早解决了,对实现的原理也理解得深些。所以,在这个信息爆炸的时代,很多时候真的互联网没有让人更聪明,反而大量的信息经常把人淹没了。技术,还是需要静下心来去钻研的。
dhcp和dns的基本配置资料比较完善,此处不再赘述。有心的朋友认真看一下man 5 dhcpd.conf,瞧一眼下面配置中标红的部分,相信就能搞定了。
另外分享一个dns chroot的流程,先安装 bind,调通named,然后再安装bind-chroot
执行/usr/libexec/setup-named-chroot.sh /var/named/chroot on
停用named,启用named-chroot即可
systemctl disabled named ; systemctl stop named
systemctl enable named-chroot;systemctl start named-chroot
[root@pxe ~]# cat /etc/dhcp/dhcpd.conf
ddns-update-style interim;
ddns-updates on;
do-forward-updates on;
allow client-updates;
allow bootp;
allow booting;
#allow client-updates;
option space Cisco_LWAPP_AP;
option Cisco_LWAPP_AP.server-address code = array of ip-address;
option space pxelinux;
option pxelinux.magic code = string;
option pxelinux.configfile code = text;
option pxelinux.pathprefix code = text;
option pxelinux.reboottime code = unsigned integer ;
option architecture-type code = unsigned integer ;
subnet ..1.0 netmask ...0 {
authoritative;
option routers ..1.1;
option subnet-mask ...0;
option broadcast-address ..1.;
option domain-name "it.lab";
option domain-name-servers ..1.;
range dynamic-bootp ..1. ..1.;
key SEC_DDNS {
algorithm hmac-md5;
secret 7ObhTIhKeDFMR2SbbS5s8A==;
};
ddns-domainname "it.lab";
zone it.lab.{
primary ..1.;
key SEC_DDNS;
}
zone 1...in-addr.arpa.{
primary ..1.;
key SEC_DDNS;
}
default-lease-time ;
max-lease-time ;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server ..1.;
if option architecture-type = : {
filename "uefi/syslinux.efi"; }
else {
filename "bios/pxelinux.0"; }
#filename "pxelinux.0"; }
}
}
[root@pxe ~]# cat /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
listen-on port { .0.0.1;..1.; };
listen-on-v6 port { ::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;};
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP within your network would greatly
reduce such attack surface
*/
recursion no;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc.zones";
include "/etc/named.root.key";
key SEC_DDNS {
algorithm hmac-md5;
secret 7ObhTIhKeDFMR2SbbS5s8A==;
};
zone "it.lab" IN {
type master;
file "it.lab.forward";
allow-update { key SEC_DDNS ; };
};
zone "1...in-addr.arpa" IN {
type master;
file "1...reverse";
allow-update { key SEC_DDNS ; };
};
centos7下解压文件命令(zip)详解 1.压缩文件夹为zip文件[root@cgls]#zip-rmydata.zipmydata2.把mydata.zip解压到mydatabak目录里面[root@cgls]#unzipmydata.zip-dmydatabak3.mydata文件夹和mydata.txt压缩成为mydata.zi
centos如何安装桌面快捷方式?centos安装桌面快捷方式的教程 1、右击Desktop,点击CreateLauncher。2、直接输入或者Browse浏览Command:可执行命令路径和快捷方式的Name,点击OK,完成。3、查看并启动,OK。4、查看该启动器
centos7如何快速启动应用程序? 刚从windows转linux系统,一般都需要通过图形界面过渡一下。随着安装的软件增多,尤其是一些编程用的IDE,比如JB家的软件,每次都要cdxx/xx/xx/bin,然后
标签: centos 7 dns
本文链接地址:https://www.jiuchutong.com/biancheng/362112.html 转载请保留说明!友情链接: 武汉网站建设