1.基本配置
成都創(chuàng)新互聯(lián)專(zhuān)注于企業(yè)成都全網(wǎng)營(yíng)銷(xiāo)推廣、網(wǎng)站重做改版、察布查爾錫伯網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、HTML5建站、商城系統(tǒng)網(wǎng)站開(kāi)發(fā)、集團(tuán)公司官網(wǎng)建設(shè)、外貿(mào)網(wǎng)站制作、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁(yè)設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性?xún)r(jià)比高,為察布查爾錫伯等各大城市提供網(wǎng)站開(kāi)發(fā)制作服務(wù)。
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
nmcli connection add con-name in ifname ens33 ipv4.addresses 192.168.1.10/24 type ethernet ipv4.method manual(內(nèi)網(wǎng)網(wǎng)卡)
nmcli connection add con-name out ifname ens38 ipv4.addresses 192.168.2.10/24 type ethernet ipv4.method manual(外網(wǎng)網(wǎng)卡)
2.配置簡(jiǎn)單DNS服務(wù)器
yum install -y bind bind-utils
2.1修改主配置文件
vim /etc/named.conf(修改該文件)
listen-on port 53 { any; };
allow-query { any; };
zone "fengxiaoli41.com" IN {
type master;
file "fengxiaoli41.com.lan";
allow-update {none;};
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "1.168.192.lan";
allow-update {none;};
};
2.2編輯正解區(qū)域
cd /var/named/
cp named.localhost fengxiaoli41.com.lan
vim fengxiaoli41.com.lan
$TTL 665
@IN SOAfengxiaoli41.com. 123@qq.com (
2017062900; serial
3600; refresh
1800; retry
604800; expire
665 ); minimum
@IN NSfengxiaoli41.com.
fengxiaoli41.com. IN A 192.168.1.10
www.fengxiaoli41.com. IN CNAME fengxiaoli41.com.
client.fengxiaoli41.com. IN A 192.168.1.200
@ IN NS slave.fengxiaoli41.com.
slave.fengxiaoli41.com. IN A 192.168.1.100
2.3編輯反解區(qū)域
cp fengxiaoli41.com.lan 1.168.192.lan
vim 1.168.192.lan
$TTL 665
@IN SOAfengxiaoli41.com. 123@qq.com (
2017062900; serial
3600; refresh
1800; retry
604800; expire
665 ); minimum
@IN NSfengxiaoli41.com.
10 IN PTR fengxiaoli41.com.
200 IN PTR client.fengxiaoli.com.
100 IN PTR slave.fengxiaoli.com.
chown named:named fengxiaoli41.com.lan
chown named:named 1.168.192.lan
2.4重啟服務(wù)并測(cè)試
systemctl restart named
systemctl status named
dig fengxiaoli41.com
3.配置chroot環(huán)境
yum install -y bind-chroot
/usr/libexec/setup-named-chroot.sh /var/named/chroot/ on
systemctl stop named.service
systemctl disabled named
systemctl enable named-chroot.service
systemctl start named-chroot
dig fengxiaoli41.com
如果dns只為內(nèi)網(wǎng)提供解析到此可以結(jié)束。
4.配置分離解析的dns(與2,3步獨(dú)立)
4.1修改主配置文件
vim /etc/named.conf
listen-on port 53 { any; };
allow-query { any; };
acl in {192.168.1.0/24;};
acl out { ! 192.168.1.0/24; any;};
view "internal"{
match-clients { in; localhost;};
zone "." IN {
type hint;
file "named.ca";
};
zone "fengxiaoli41.com" IN {
type master;
file "fengxiaoli41.com.lan";
allow-update {none;};
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "1.168.192.lan";
allow-update {none;};
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
};
注意所有區(qū)域都要包含在view里
view "external"{
match-clients {out;};
zone "." IN {
type hint;
file "named.ca";
};
zone "fengxiaoli41.com" IN {
type master;
file "fengxiaoli41.com.wan";
allow-update {none;};
};
zone "2.168.192.in-addr.arpa" IN {
type master;
file "2.168.192.wan";
allow-update {none;};
};
};
cd /var/named/chroot/var/named/
4.2編輯內(nèi)網(wǎng)正解反解區(qū)域
vim fengxiaoli41.com.lan
$TTL 665
@IN SOAfengxiaoli41.com. 123@qq.com (
2017062900; serial
3600; refresh
1800; retry
604800; expire
665 ); minimum
@IN NSfengxiaoli41.com.
fengxiaoli41.com. IN A 192.168.1.10
www.fengxiaoli41.com. IN CNAME fengxiaoli41.com.
client.fengxiaoli41.com. IN A 192.168.1.200
@ IN NS slave.fengxiaoli41.com.
slave.fengxiaoli41.com. IN A 192.168.1.100
vim 1.168.192.lan
$TTL 665
@IN SOAfengxiaoli41.com. 123@qq.com (
2017062900; serial
3600; refresh
1800; retry
604800; expire
665 ); minimum
@IN NSfengxiaoli41.com.
10 IN PTR fengxiaoli41.com.
200 IN PTR client.fengxiaoli.com.
100 IN PTR slave.fengxiaoli.com.
4.3編輯外圍正解反解區(qū)域
vim fengxiaoli41.com.wan
$TTL 665
@IN SOAfengxiaoli41.com. 123@qq.com (
2017062900; serial
3600; refresh
1800; retry
604800; expire
665 ); minimum
@IN NSfengxiaoli41.com.
fengxiaoli41.com. IN A 192.168.2.10
vim 2.168.192.wan
$TTL 665
@IN SOAfengxiaoli41.com. 123@qq.com (
2017062900; serial
3600; refresh
1800; retry
604800; expire
665 ); minimum
@IN NSfengxiaoli41.com.
10IN PTR fengxiaoli41.com.
4.4設(shè)置權(quán)限重啟服務(wù)
chown named:named -R /var/named/chroot/var/named/*
systemctl restart named-chroot
5.主從服務(wù)器配置(在2或者4的基礎(chǔ)上配置)
5.1主服務(wù)器配置
vim /etc/named.conf
allow-transfer { 192.168.1.0/24;};
cd /var/named/chroot/var/named/
vim fengxiaoli41.com.lan
@ IN NS slave.fengxiaoli41.com.
slave.fengxiaoli41.com. IN A 192.168.1.100
vim 1.168.192.lan
100 IN PTR slave.fengxiaoli.com.
5.2從服務(wù)器配置(注意firewalld和selinux)
nmcli connection add con-name in ifname ens33 ipv4.addresses 192.168.1.100/24 type ethernet ipv4.method manual
yum install -y bind-utils bind
vim /etc/named.conf
listen-on port 53 { any; };
allow-query { any; };
zone "fengxiaoli41.com" IN {
type slave;
masters { 192.168.1.10; };
file "slaves/fengxiaoli.com.lan";
};
zone "1.168.192.in-addr.arpa" IN {
type slave;
masters { 192.168.1.10; };
file "slaves/1.168.192.lan";
};
systemctl restart named
ll /var/named/slaves/
網(wǎng)頁(yè)題目:redhat7.3dns服務(wù)器配置
網(wǎng)站鏈接:http://vcdvsql.cn/article28/pdesjp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、網(wǎng)站設(shè)計(jì)、靜態(tài)網(wǎng)站、服務(wù)器托管、網(wǎng)站策劃、網(wǎng)站導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)