首先先克隆一个虚拟机并完成ip地址的修改
nmcli connection modify ens160 ipv4.addresses 192.168 .209.128/24
nmcli connection modify ens160 ipv4.method manual
nmcli connection modify ens160 connection.autoconnect yes
nmcli connection up ens160
nmcli connection modify ens160 ipv4.dns 192.168 .209.136
nmcli connection up ens160
配置解析文件
[ root@localhost ~]
重启named服务
[ root@localhost ~]
查看DNS
[ root@localhost ~]
IP4.DNS[ 1 ] : 192.168 .209.136
在服务器上做测试
[ root@client ~]
; << >> DiG 9.16 .23-RH << >> -t A www.baidu.com
; ; global options: +cmd
; ; Got answer:
; ; ->> HEADER<<- opcode: QUERY, status: NOERROR, id: 286
; ; flags: qr rd ra; QUERY: 1 , ANSWER: 3 , AUTHORITY: 0 , ADDITIONAL: 1
; ; OPT PSEUDOSECTION:
; EDNS: version: 0 , flags:; udp: 1232
; COOKIE: 09dac7443d8d2c2701000000668946c0c241b650e0e7c86d ( good)
; ; QUESTION SECTION:
; www.baidu.com. IN A
; ; ANSWER SECTION:
www.baidu.com. 1200 IN CNAME www.a.shifen.com.
www.a.shifen.com. 120 IN A 36.155 .132.3
www.a.shifen.com. 120 IN A 36.155 .132.76
; ; Query time: 4437 msec
; ; SERVER: 192.168 .209.136
; ; WHEN: Sat Jul 06 21 :29:36 CST 2024
; ; MSG SIZE rcvd: 132