惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
C
Check Point Blog
J
Java Code Geeks
腾讯CDC
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
罗磊的独立博客
Last Week in AI
Last Week in AI
B
Blog
IT之家
IT之家
S
SegmentFault 最新的问题
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
博客园 - 聂微东
U
Unit 42
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
MyScale Blog
MyScale Blog

博客园 - 白马黑衣

网络安全3 - Easy RSA重新签发客户端证书 RHEL - 笔记本合盖不休眠 RHEL - yum cache JFrog Artifactory 系列6 --- 其他配置 Node.js - 配置npm Rocky Linux 升级失败 Nginx 系列2 --- 配置 Linux --- firewalld 2 - nfttables Apache HTTP Server 关闭SELinux RHEL - 设置hostname和IP地址 Linux --- 查看PID 判断端口是否已经被占用 Maven 常用命令 Jenkins 系列3 --- pipeline Git自签名证书的验证 iptables Jenkins 系列2 --- Node/Agent Jenkins 系列1 --- 安装与配置
Linux - DNS
白马黑衣 · 2023-12-10 · via 博客园 - 白马黑衣

一、概要

1. 环境

(1) CentOS 7

(2) Rocky Linux 9.1

(3) Rocky Linux 9.3

二、配置

1. 配置文件

(1) DNS的配置文件位于:

从CentOS7开始,该文件由NetworkManager维护,可直接修改,也可以通过nmcli命令来修改。

(2) NetworkManger服务

systemctl status NetworkManager
sudo systemctl start NetworkManager
sudo systemctl enable NetworkManager

(3) 查看DNS信息

a. 查看设备信息

b. 查看链接信息

nmcli connection show <Connection Name>

c. 查看DNS信息

nmcli connection show <Connection Name> | grep dns

(4) 修改链接的DNS服务器

sudo nmcli connection modify <Connection Name> ipv4.dns "192.168.28.1"

多个dns用逗号隔开。

(5) 应用配置

sudo nmcli dev reapply <Interface>