network config
ifcfg-ens32
1 --static 2 TYPE=Ethernet 3 BOOTPROTO=static 4 DEFROUTE=yes 5 IPV4_FAILURE_FATAL=no 6 IPV6INIT=yes 7 IPV6_AUTOCONF=yes 8 IPV6_DEFROUTE=yes 9 IPV6_FAILURE_FATAL=no 10 NAME=ens32 11 UUID=62fdc2e9-3be7-4558-a846-f6ba391d8db7 12 ONBOOT=no 13 IPADDR=1.1.13.5 14 PREFIX=24 15 GATEWAY=1.1.13.2 16 DNS1=1.1.13.2 17 DOMAIN=1.1.13.3 18 HWADDR=00:0C:29:A0:B6:EC //must be same with the mac in $(ip add) 19 IPV6_PEERDNS=yes 20 IPV6_PEERROUTES=yes 21 22 --dhcp 23 HWADDR="00:0C:29:67:DB:91" 24 TYPE="Ethernet" 25 BOOTPROTO="dhcp" 26 DEFROUTE="yes" 27 PEERDNS="yes" 28 PEERROUTES="yes" 29 IPV4_FAILURE_FATAL="no" 30 IPV6INIT="yes" 31 IPV6_AUTOCONF="yes" 32 IPV6_DEFROUTE="yes" 33 IPV6_PEERDNS="yes" 34 IPV6_PEERROUTES="yes" 35 IPV6_FAILURE_FATAL="no" 36 NAME="ens32" 37 UUID="b394a05c-51c4-4dc6-adef-10463ae0287d" 38 ONBOOT="yes"
dns config
yum -y install bind bind-utils
add zone to named.conf
1 options { 2 directory "/var/named"; 3 forwarders {8.8.8.8;}; 4 }; 5 zone "voh.com" IN { 6 type master; 7 file "voh.com.zone"; 8 allow-update { none;}; 9 }; 10 11 zone "13.1.1.in-addr.arpa" IN { 12 type master; 13 file "13.1.1.in-addr.arpa"; 14 allow-update {none;}; 15 };
touch zone source file
1 [root@localhost named]# cat 13.1.1.in-addr.arpa 2 $TTL 1D 3 @ IN SOA www.voh.com. root.voh.com. ( 4 20141225; serial 5 1D ; refresh 6 1H ; retry 7 1W ; expire 8 3H ) ; minimum 9 10 11 NS www.voh.com. 12 2 IN PTR www.voh.com. 13 3 IN PTR dns.voh.com. 14 [root@localhost named]# cat voh.com.zone 15 $TTL 1D 16 @ IN SOA dns.voh.com. root.voh.com. ( 17 20141225; serial 18 1D ; refresh 19 1H ; retry 20 1W ; expire 21 3H ) ; minimum 22 23 24 @ IN NS dns.voh.com. 25 dns IN A 1.1.13.2 26 www IN A 1.1.13.3
commands service named restart|status -- named-checkzone voh.com.zone /var/name/voh.com.zone
problem in vmware :cant ...LSB error on vmware,modify the macs in ifcfg-ens32 to be same with that in $(ip add)
result:
1 [root@localhost named]# nslookup www.voh.com 2 Server: 1.1.13.6 3 Address: 1.1.13.6#53 4 5 Name: www.voh.com 6 Address: 1.1.13.3 7 8 [root@localhost named]# 9 [root@localhost named]# 10 [root@localhost named]# nslookup dns.voh.com 11 Server: 1.1.13.6 12 Address: 1.1.13.6#53 13 14 Name: dns.voh.com 15 Address: 1.1.13.2 16 17 [root@localhost named]# nslookup 1.1.13.3 18 Server: 1.1.13.6 19 Address: 1.1.13.6#53 20 21 3.13.1.1.in-addr.arpa name = dns.voh.com. 22 23 [root@localhost named]# nslookup 1.1.13.2 24 Server: 1.1.13.6 25 Address: 1.1.13.6#53 26 27 2.13.1.1.in-addr.arpa name = www.voh.com. 28 29 [root@localhost named]#