ipv4.dns" command to set it. 2. Open the resolv.conf file and set the nameserver value to change the dns."> How to configure dns in centos-CentOS-php.cn

How to configure dns in centos

Release: 2020-04-02 16:23:19
Original
14915 people have browsed it

How to configure dns in centos

How to configure dns in centos:

Recommended related video tutorials:linux video tutorial

1. Use new commands Run the tool nmcli to set up

#Display the current network connection

#nmcli connection show NAME UUID TYPE DEVICE eno1 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet eno1
Copy after login

#Modify the DNS server corresponding to the current network connection. The network connection here can be identified by name or UUID

#nmcli con mod eno1 ipv4.dns "114.114.114.114 8.8.8.8"
Copy after login

#Put dns configuration into effect

#nmcli con up eno1
Copy after login

2. Use the traditional method to manually modify /etc/resolv.conf

Modify the /etc/NetworkManager/NetworkManager.conf file and add "dns" to the main section =none” option:

[main] plugins=ifcfg-rh dns=none
Copy after login

NetworkManager reloads the modified configuration

# systemctl restart NetworkManager.service
Copy after login

Manually modify /etc/resolv.conf

nameserver 114.114.114.114 nameserver 8.8.8.8
Copy after login

Recommended tutorial:centos tutorial

The above is the detailed content of How to configure dns in centos. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!