目标:创建区域huhaiqing.com
1、安装bind
yum install -y bind\* service named start
2、修改主配置/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 53 { any; }; listen-on-v6 port 53 { any; }; 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"; managed-keys-directory "/var/named/dynamic"; }; zone "." IN { type hint; file "named.ca"; }; zone "localhost." IN { type master; file "named.localhost"; }; zone "1.0.0.127.in-addr.arpa." IN { type master; file "named.loopback"; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; zone "huhaiqing.com." IN { type master; file "huhaiqing.com.hosts"; }; #include "/etc/named.rfc1912.zones"; include "/etc/named.root.key";
3、修改区域配置文件/var/named/huhaiqing.com.hosts
$TTL 86400 @ IN SOA zabbix.huhaiqing.com. admin.huhaiqing.com. ( 2016060901 1H 10M 7D 1D ) @IN NS zabbix zabbixIN A 10.13.106.11 ftpserverIN A 10.13.106.30 pythondevIN A 10.13.106.35
4、重启服务
service named restart
注意:
ping目标主机时,如果目标主机的格式为:xxx.huhaiqing.com,则ping xxx可以通,否则只能通过ping xxx.huhaiqing.com测试主机是否在线。
时间: 2024-11-08 07:02:31