标签:网卡 ipa amp bootproto soa file 主dns hint port
一. 主DNS服务部署vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.1.30
NETMASK=255.255.255.0
DNS1=192.168.1.30
DNS2=192.168.1.40
/etc/init.d/network restar
vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=ns1.duanyufei.org
mount /dev/sr0 /mnt/
vim /etc/yum.repos.d/CentOS-Base.repo
[local]
name=local
baseurl=file:///mnt
enabled=1
gpgcheck=0
yum –y install bind bind-utils
vim /etc/named.conf
options {
listen-on port 53 { 192.168.1.30; };
directory "/var/named";
allow-query {localhost;};
dnssec-enable no;
dnssec-validation no;
zone "duanyufei.org" IN {
type master;
file "duanyufei.org.zone";
allow-transfer {192.168.1.40;};
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "192.168.1.arpa";
allow-transfer {192.168.1.40;};
};
cp /var/named/named.empty /var/named/duanyufei.org.zone
vim /var/named/duanyufei.org.zone
$TTL 86400
@ IN SOA duanyufei.org. admin.duanyufei.org.(管理员邮箱) (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS ns1.duanyufei.org. //主DNS从DNS服务器的主机名
IN NS ns2.duanyufei.org.
ns1 IN A 192.168.1.30 //DNS服务器对应的IP地址
ns2 IN A 192.168.1.40
www IN A 192.168.1.100 //www.duanyufei.org对应的IP
ftp IN CNAME www
cp /var/named/duanyufei.org.zone /var/named/192.168.1.arpa
vim /var/named/192.168.1.arpa
$TTL 86400
@ IN SOA duanyufei.org. admin.duanyufei.org.(管理员邮箱) (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS ns1.duanyufei.org.
IN NS ns2.duanyufei.org.
10 IN PTR ns1.duanyufei.org.
20 IN PTR ns2.duanyufei.org.
100 IN PTR www.duanyufei.org.
ftp IN CNAME www
chown named:named /var/named/192.168.1.arpa /var/named/duanyufei.org.zone
/etc/init.d/named start && chkconfig --level 35 named on
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.1.40
NETMASK=255.255.255.0
DNS1=192.168.1.40
DNS2=192.168.1.30
/etc/init.d/network restart
vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=ns2.duanyufei.org
yum -y install bind bind-utils
scp root@192.168.1.30:/etc/named.conf /etc/
vim /etc/named.conf
options {
listen-on port 53 { 192.168.1.40; };
directory "/var/named";
zone "duanyufei.org" IN {
type slave;
file "slaves/duanyufei.org.zone";
masters {192.168.1.30;};
};
zone "1.168.192.in-addr.arpa" IN {
type slave;
file "slaves/192.168.1.arpa";
masters {192.168.1.30;};
};
/etc/init.d/named start && chkconfig --level 35 named on
ll /var/named/slaves/
一块网卡vmnet1、首选DNS 192.168.1.30、 备用DNS 192.168.1.40
cmd --> nslookup duanyufei.org
两块网卡,第一块网卡为桥接,第二块vmnet1
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp
vim /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.1.254
NETMASK=255.255.255.0
/etc/init.d/network restart
vim /etc/sysctl.conf
7 net.ipv4.ip_forward = 1 (开启路由转发)
sysctl -p
iptables -t nat -I POSTROUTING -s 192.168.1.0/24 -j SNAT --to-source 192.168.20.186(换为桥接获取的IP //允许192.168.1.0上网) 编辑iptables防护墙规则
mount /dev/sr0 /mnt/
yum -y install bind bind-utils
cp /etc/named.conf /etc/named.conf.bak
vim /etc/named.conf
options {
listen-on port 53 { 192.168.1.254; };
directory "/var/named";
allow-query {any;};
forwarders {114.114.114.114;8.8.8.8;};
dnssec-enable no;
dnssec-validation no;
zone "." IN {
type hint;
file "named.ca";
/etc/init.d/named start && chkconfig --level 35 named on
一块网卡vmnet1、网关192.168.1.254、首选DNS 192.168.1.254
标签:网卡 ipa amp bootproto soa file 主dns hint port
原文地址:http://blog.51cto.com/14013608/2298607