network config

时间:2022-11-23 14:30:22

ifcfg-ens32

 --static
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ens32
UUID=62fdc2e9-3be7--a846-f6ba391d8db7
ONBOOT=no
IPADDR=1.1.13.5
PREFIX=
GATEWAY=1.1.13.2
DNS1=1.1.13.2
DOMAIN=1.1.13.3
HWADDR=:0C::A0:B6:EC //must be same with the mac in $(ip add)
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes --dhcp
HWADDR="00:0C:29:67:DB:91"
TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="ens32"
UUID="b394a05c-51c4-4dc6-adef-10463ae0287d"
ONBOOT="yes"

dns config

yum -y install bind bind-utils

add zone to named.conf

 options {
directory "/var/named";
forwarders {8.8.8.8;};
};
zone "voh.com" IN {
type master;
file "voh.com.zone";
allow-update { none;};
}; zone "13.1.1.in-addr.arpa" IN {
type master;
file "13.1.1.in-addr.arpa";
allow-update {none;};
};

touch zone source file

 [root@localhost named]# cat 13.1..in-addr.arpa
$TTL 1D
@ IN SOA www.voh.com. root.voh.com. (
; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum NS www.voh.com.
IN PTR www.voh.com.
IN PTR dns.voh.com.
[root@localhost named]# cat voh.com.zone
$TTL 1D
@ IN SOA dns.voh.com. root.voh.com. (
; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum @ IN NS dns.voh.com.
dns IN A 1.1.13.2
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:

 [root@localhost named]# nslookup www.voh.com
Server: 1.1.13.6
Address: 1.1.13.6# Name: www.voh.com
Address: 1.1.13.3 [root@localhost named]#
[root@localhost named]#
[root@localhost named]# nslookup dns.voh.com
Server: 1.1.13.6
Address: 1.1.13.6# Name: dns.voh.com
Address: 1.1.13.2 [root@localhost named]# nslookup 1.1.13.3
Server: 1.1.13.6
Address: 1.1.13.6# 3.13.1.1.in-addr.arpa name = dns.voh.com. [root@localhost named]# nslookup 1.1.13.2
Server: 1.1.13.6
Address: 1.1.13.6# 2.13.1.1.in-addr.arpa name = www.voh.com. [root@localhost named]#