ipv4.dns" command to set it. 2. Open the resolv.conf file and set the nameserver value to change the dns."/> ipv4.dns" command to set it. 2. Open the resolv.conf file and set the nameserver value to change the dns.">

Home >Operation and Maintenance >CentOS >How to configure dns in centos

How to configure dns in centos

尚
Original
2020-04-02 16:23:1915054browse

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

#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"

#Put dns configuration into effect

#nmcli con up eno1

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

NetworkManager reloads the modified configuration

# systemctl restart NetworkManager.service

Manually modify /etc/resolv.conf

nameserver 114.114.114.114
nameserver 8.8.8.8

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!

Statement:
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