linux服务器修改dns
DNS Servers are a very important part of the internet and computer networks. When DNS servers are down we can not use the internet in a easy manner. DNS servers provide the domain name to IP or vice versa resolution.
DNS服务器是Internet和计算机网络中非常重要的一部分。 当DNS服务器停机时,我们无法轻松地使用Internet。 DNS服务器将域名提供给IP,反之亦然。
视窗 (Windows)
Windows operating system family provides ipconfig
command for a general information-gathering tool. ipconfig command without any parameter will show base configuration about the network of the operating system. Just issue the following command into DOS command prompt. This will list all network configuration in detail with DNS related configuration.
Windows操作系统家族为常规的信息收集工具提供了ipconfig
命令。 不带任何参数的ipconfig命令将显示有关操作系统网络的基本配置。 只需在DOS命令提示符下发出以下命令即可。 这将详细列出所有网络配置以及与DNS相关的配置。
> ipconfig /all
There may be multiple DNS servers. In this example our DNS server is our default router.
可能有多个DNS服务器。 在此示例中,我们的DNS服务器是我们的默认路由器。
要设置DNS服务器,请使用“控制面板” (To set DNS server use Control Panel)
We will use a network interface configuration with the GUI.
我们将通过GUI使用网络接口配置。
打开网络与共享中心 (Open Network and Sharing Center)
打开网络适配器(Open Network Adapter)
打开属性(Open Properties)
打开本地连接属性(Open Local Area Connection Properties)
开放互联网协议版本 (Open Internet Protocol Version)
We can set from here preferred DNS Servers. Here is a list of popular DNS servers.
我们可以从此处设置首选的DNS服务器。 这是受欢迎的DNS服务器的列表。
- 8.8.8.8 8.8.8.8
- 2.2.4.4 2.2.4.4
- 2.2.2.2 2.2.2.2
Linux (Linux)
Linux provides alternative ways to get DNS server and set DNS server.
Linux提供了获取DNS服务器和设置DNS服务器的替代方法。
$ cat /etc/resolv.conf
The old friend resolv.conf is deprecated to edit by hand so a new way to set DNS servers in resolv.conf. But we can get DNS server with the cat command.
不建议老朋友resolv.conf手动编辑,因此是在resolv.conf中设置DNS服务器的新方法。 但是我们可以使用cat命令获取DNS服务器。
添加DNS服务器 (Add DNS Server)
We can add new DNS server to the resolv.conf
with interface configuration like below. Add related lines to the interface static IP configuration.
我们可以使用以下接口配置将新的DNS服务器添加到resolv.conf
中。 将相关行添加到接口静态IP配置。
dns-nameserver 8.8.8.8
翻译自: https://www.poftut.com/what-is-my-dns-server-and-hot-to-change-dns-server-for-windows-linux/
linux服务器修改dns