1、vi /etc/resolv.conf
增加以下内容:
nameserver DNSserver_ip_address1
nameserver DNSserver_ip_address2
如下:
[root@REDHATAS5 /]# cat /etc/resolv.conf
nameserver 192.168.88.1
2、测试DNS是否生效
[root@Develop-Server ~]# nslookup www.baidu.com
Server: 192.168.88.1
Address: 192.168.88.1#53
Non-authoritative answer:
www.baidu.com canonical name = www.a.shifen.com.
Name: www.a.shifen.com
Address: 119.75.217.56
Name: www.a.shifen.com
Address: 119.75.218.45