CENTOS下配置DNS
第一步 安裝bind
rpm -qa bind*
想省事可以直接yum -y install bind*,還有一個一定要安裝的是 yum -y install caching-nameserver,不然不能做後面的配置工作。bing 預設是安裝在/var/named/chroot/下面。
首先要配置的是name.conf,
進入etc目錄下
用命令cp -p named.caching-nameserver.conf named.conf 引數-p的作用是把許可權也一起復制
修改後的檔案為:
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";
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";
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
// randomization
// query-source port 53;
// query-source-v6 port 53;
allow-query { any; };
allow-query-cache { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
allow-query-cache { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
第二步,配置zone
在named.rfc1912.zones檔案下新增幾行:
zone "dba11g.cn" IN {
type master;
file "dba11g.zone";
};
zone "75.168.192.in-addr.arpa" IN {
type master;
file "192.168.75.local";
};
type master;
file "dba11g.zone";
};
zone "75.168.192.in-addr.arpa" IN {
type master;
file "192.168.75.local";
};
進入/var/named/chroot/var/named目錄
新增192.168.75.local和dba11g.zone檔案:
192.168.75.local內容如下:
$ttl 600
@ IN SOA master.dba11g.cn. root.dba11g.cn.(
1997022700 ; Serial
600 ; Refresh
120 ; Retry
600 ; Expire
600 ) ; Negative Cache TTL
IN NS master.dba11g.cn.
IN MX 5 dba11g.cn.
rac1 IN A 192.168.75.42
rac2 IN A 192.168.75.43
rac1-vip IN A 192.168.75.45
rac2-vip IN A 192.168.75.47
rac1-priv IN A 192.168.75.46
rac1-priv IN A 192.168.75.48
scan IN A 192.168.75.50
@ IN SOA master.dba11g.cn. root.dba11g.cn.(
1997022700 ; Serial
600 ; Refresh
120 ; Retry
600 ; Expire
600 ) ; Negative Cache TTL
IN NS master.dba11g.cn.
IN MX 5 dba11g.cn.
rac1 IN A 192.168.75.42
rac2 IN A 192.168.75.43
rac1-vip IN A 192.168.75.45
rac2-vip IN A 192.168.75.47
rac1-priv IN A 192.168.75.46
rac1-priv IN A 192.168.75.48
scan IN A 192.168.75.50
dba11g.zone檔案內容如下:
$TTL 600
@ IN SOA master.dba11g.cn. root.dba11g.cn.(
1997022700;
600;
120;
600;
600 );
@ IN NS master.dba11g.cn.
65 IN PTR scan.dba11g.com.
@ IN SOA master.dba11g.cn. root.dba11g.cn.(
1997022700;
600;
120;
600;
600 );
@ IN NS master.dba11g.cn.
65 IN PTR scan.dba11g.com.
然後啟動
# service named start
啟動 named:[確定]
啟動 named:[確定]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8183550/viewspace-686982/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Centos 6 DNS 配置 解決 Unknown hostCentOSDNS
- Centos7系統配置DNS服務CentOSDNS
- RHEL8&CentOS8配置IP地址和DNSCentOSDNS
- Centos8 編輯本地DNS解析配置檔案CentOSDNS
- Centos 7 新增dnsCentOSDNS
- CentOS下Ant環境配置CentOS
- CentOS下tomcat安裝配置CentOSTomcat
- Centos下DNS+NamedManager高可用部署方案完整記錄CentOSDNS
- Linux CentOS 7 下 Redis 的配置LinuxCentOSRedis
- centos nginx下配置免費httpsCentOSNginxHTTP
- Centos7.6下安裝配置JenkinsCentOSJenkins
- CentOS 8.2下VNC安裝與配置CentOSVNC
- centos7下cobbler安裝配置CentOS
- Centos7下Samba伺服器配置。CentOSSamba伺服器
- 解說CentOS 7下ActiveMQ安裝配置CentOSMQ
- Centos7下安裝配置elasticsearch 6.3.1CentOSElasticsearch
- CentOS 下 Nginx 配置 Let’ s Encrypt 證書CentOSNginx
- centos7搭建DNS伺服器CentOSDNS伺服器
- Centos7下安裝配置MySQL5.7CentOSMySql
- CentOS 下多版本 PHP 的安裝與配置CentOSPHP
- CentOS7 下 Nginx 的安裝和配置CentOSNginx
- CentOS6下mysql的安裝與配置CentOSMySql
- Linux(CentOS 7)VMWare下配置遠端登入LinuxCentOS
- CentOS7下配置redis主從關係CentOSRedis
- CentOS 7伺服器下Nginx安裝配置CentOS伺服器Nginx
- CentOS7下RabbitMQ服務安裝配置CentOSMQ
- CentOS 下 MySQL 5.6 基於 RPM 的下載、安裝、配置CentOSMySql
- Linux系統下如何配置DNS?這些你肯定不知道!LinuxDNS
- win10系統下dns配置錯誤的修復方法Win10DNS
- 配置Ubuntu DNS伺服器UbuntuDNS伺服器
- CentOS7下Firewall防火牆配置用法詳解CentOS防火牆
- CentOS7下RabbitMQ3.7安裝與配置CentOSMQ
- docker hub 下載centos配置ssh遠端登陸DockerCentOS
- centos配置shadowsocksCentOS
- 《生產環境下Hadoop大叢集安裝與配置+DNS+NFS》HadoopDNSNFS
- Centos7下配置PHP + MySQL + Nginx開發環境CentOSPHPMySqlNginx開發環境
- centos下配置nginx遇到的一些基本的坑CentOSNginx
- CentOS.7下安裝配置FTP和SFTP服務CentOSFTP
- CentOS7.2下安裝配置Node.js和YarnCentOSNode.jsYarn