本文共 3011 字,大约阅读时间需要 10 分钟。
#仅客户端vi /etc/sysconfig/network-scripts/ifcfg-eno16777736DNS1=192.168.1.100vi /etc/sysconfig/networkNETWORKING=yesHOSTNAME=lin01.example.localvi /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6vi /etc/resolv.confnameserver 192.168.1.100systemctl restart network.service#服务器端yum install bind bind-utilsservice named startcp /etc/named.conf /etc/named.conf.bakvim /etc/named.confoptions { listen-on port 53 { 127.0.0.1; 192.168.1.100; }; #need change 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 { localhost; 192.168.1.0/24;}; #need change recursion yes; 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.rfc1912.zones";include "/etc/named.root.key";#add followingzone "example.local" IN { type master; file "example.zone";};zone "1.168.192.in-addr.arpa" IN { type master; file "192.168.1.zone";cp /var/named/named.localhost /var/named/example.zonevim /var/named/example.zone$TTL 1D@ IN SOA lin01.example.local. root.example.local. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum@ IN NS lin01.example.local.@ IN A 192.168.1.100@ IN A 192.168.1.91@ IN A 192.168.1.92lin01 IN A 192.168.1.100lin10 IN A 192.168.1.91lin09 IN A 192.168.1.92cp /var/named/named.localhost /var/named/192.168.1.zonevim /var/named/192.168.1.zone$TTL 1D@ IN SOA lin01.example.local. root.example.local. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum@ IN NS lin01.example.local.@ IN PTR example.local.lin01 IN A 192.168.1.100lin09 IN A 192.168.1.92lin10 IN A 192.168.1.91100 IN PTR lin01.example.local.91 IN PTR lin10.example.local.92 IN PTR lin09.example.local.systemctl start named.servicesystemctl status named.servicesystemctl restart named.servicesystemctl enable named
转载于:https://blog.51cto.com/eafan/1708135