linux服务器修改dns_更改DNS服务器的终极指南

linux服务器修改dns

linux服务器修改dns

There are many reasons you might want to use a third-party DNS server, from parental controls and security features to speed and reliability improvements. You can change the DNS server for your entire home network on your router, or set it individually on a PC, Mac, iPhone, iPad, Android device, Chromebook, or many other devices.

从家长控制和安全功能到提高速度和可靠性, 您可能要使用第三方DNS服务器的原因有很多。 您可以在路由器上更改整个家庭网络的DNS服务器,也可以在PC,Mac,iPhone,iPad,Android设备,Chromebook或许多其他设备上分别进行设置。

在路由器上 (On Your Router)

If you want to change the DNS server for your entire home network, you’ll need to do it on your router. All the devices on your network—PCs, smartphones, tablets, game consoles, smart speakers, TV streaming boxes, Wi-Fi enabled light bulbs, and anything else you can think of—acquire their DNS server setting from the router unless you go out of your way to change it on the device. By default, your router uses your Internet service provider’s DNS servers. If you change the DNS server on your router, every other device on your network will use it.

如果要更改整个家庭网络的DNS服务器 ,则需要在路由器上进行操作。 网络上的所有设备(如PC,智能手机,平板电脑,游戏机,智能扬声器,电视流媒体盒,支持Wi-Fi的灯泡以及您能想到的其他任何设备)都将从路由器获取其DNS服务器设置,除非您外出在设备上进行更改的方式。 默认情况下,路由器使用Internet服务提供商的DNS服务器。 如果更改路由器上的DNS服务器,则网络上的所有其他设备都将使用它。

Really, if you want to use a third-party DNS server on your devices, we recommend you just change it on your router. It’s a single setting and, if you change your mind and want to change your DNS server later, you can change the setting in one place.

确实,如果您想在设备上使用第三方DNS服务器,我们建议您仅在路由器上进行更改。 这是一项设置,如果您改变主意并希望稍后更改DNS服务器,则可以在一个位置更改该设置。

To do this, access your router’s web interface. The exact steps you need to take will vary depending on your router. If you’re not sure how to do this, you’ll probably want to check the manual or online documentation for your specific model of router. It will show you the instructions for accessing the web interface and any default username and password combination you’ll need to sign in, if you’ve never changed it.

为此,请访问路由器的Web界面 。 您需要采取的确切步骤会因您的路由器而异。 如果不确定如何执行此操作,则可能需要查看特定型号路由器的手册或在线文档。 如果您从未更改过,它将向您显示访问Web界面的说明以及登录所需的任何默认用户名和密码组合。

Once in the web interface, you’ll probably find a DNS server option on one of the pages. Change this and the setting will affect your entire network. The option may be under LAN or DHCP server settings, as the DNS server is provided via the DHCP protocol to devices that connect to your router.

进入网络界面后,您可能会在其中一个页面上找到DNS服务器选项。 更改此设置,设置将影响您的整个网络。 该选项可能在LAN或DHCP服务器设置下,因为DNS服务器是通过DHCP协议提供给连接到路由器的设备的。

If you’re having trouble finding the option, check your router’s manual or perform a Google search for your model of router and “change DNS server”.

如果您找不到该选项,请查看路由器的手册或在Google上搜索您的路由器型号并“更改DNS服务器”。

You can instead override the automatic DNS server provided from your router and set a custom DNS server on individual devices, if you like—here’s how do do that on each platform.

相反,您可以覆盖路由器提供的自动DNS服务器,并根据需要在各个设备上设置自定义DNS服务器-这是在每个平台上执行的操作。

在Windows PC上 (On a Windows PC)

On Windows, you can change this option from the Control Panel. This option isn’t yet part of the new Settings app on Windows 10.

在Windows上,可以从控制面板更改此选项。 此选项尚未成为Windows 10上新的“设置”应用程序的一部分。

Head to Control Panel > Network and Internet > Network and Sharing Center > Change adapter settings.

转到控制面板>网络和Internet>网络和共享中心>更改适配器设置。

Right-click the network connection you want to configure and select “Properties”. This option must be changed separately for each connection you want to change it for. This means that, if you have a computer with both Wi-Fi and wired Ethernet connections, you’d have to change it for both your Wi-Fi and Ethernet adapters if you wanted to change the DNS server for both.

右键单击要配置的网络连接,然后选择“属性”。 必须为您要为其更改的每个连接分别更改此选项。 这意味着,如果您有一台同时具有Wi-Fi和有线以太网连接的计算机,则想同时为它们的DNS服务器进行更改,则必须同时为Wi-Fi和以太网适配器进行更改。

Select “Internet Protocol Version 4 (TCIP/IPv4)” in the list and click “Properties”.

在列表中选择“ Internet协议版本4(TCIP / IPv4)”,然后单击“属性”。

Select “Use the following DNS server addresses, enter the addresses of the DNS servers you want to use, and click “OK”.

选择“使用以下DNS服务器地址,输入要使用的DNS服务器的地址,然后单击”确定”。

If you want to set a custom DNS server for IPv6 connections as well, select “Internet Protocol Version 6 (TCIP/IPv6)”, click “Properties”, and enter the IPv6 addresses as well. Click “OK” when you’re done.

如果还要为IPv6连接设置自定义DNS服务器,请选择“ Internet协议版本6(TCIP / IPv6)”,单击“属性”,然后也输入IPv6地址。 完成后,单击“确定”。

After you change your DNS server on a Windows PC, you may need to flush your DNS cache to ensure Windows is using the records from your new DNS server and not cached results from your previous one.

在Windows PC上更改DNS服务器后,可能需要刷新DNS缓存,以确保Windows使用的是新DNS服务器中的记录,而不是上一台DNS中的记录。

在Android手机或平板电脑上 (On an Android Phone or Tablet)

Android allows you to change your DNS server, but not system-wide. Each individual Wi-FI network you connect to has its own settings. If you want to use the same DNS server everywhere, you’ll have to change it for each Wi-Fi network you connect to.

Android允许您更改DNS服务器,但不能更改系统范围的DNS服务器。 您连接到的每个单独的Wi-FI网络都有其自己的设置。 如果要在各处使用同一DNS服务器,则必须为连接到的每个Wi-Fi网络更改它。

To change your DNS server, head to Settings > Wi-Fi, long-press the network you’re connected to, and tap “Modify Network”.

要更改DNS服务器,请转到“设置”>“ Wi-Fi”,长按您连接的网络,然后点按“修改网络”。

To change DNS settings, tap the “IP settings” box and change it to “Static” instead of the default DHCP. Depending on your device, you may need to check an “Advanced” box to see this setting.

要更改DNS设置,请点击“ IP设置”框,然后将其更改为“静态”,而不是默认的DHCP。 根据您的设备,您可能需要选中“高级”框才能看到此设置。

Leave the IP server setting here alone, as this is automatically acquired from the DHCP server. Enter your preferred primary and secondary DNS servers in the “DNS 1” and “DNS 2” settings and then save your settings.

将IP服务器设置保留在此处,因为这是从DHCP服务器自动获取的。 在“ DNS 1”和“ DNS 2”设置中输入首选的首选和备用DNS服务器,然后保存设置。

在iPhone或iPad上 (On an iPhone or iPad)

Apple’s iOS allows you to change your DNS server, but you can’t set a preferred DNS server system-wide. You can only change an individual Wi-Fi network’s DNS server to your custom setting, so you’ll have to do this for each Wi-Fi network you use.

Apple的iOS允许您更改DNS服务器,但无法在系统范围内设置首选的DNS服务器。 您只能将单个Wi-Fi网络的DNS服务器更改为自定义设置,因此您必须为使用的每个Wi-Fi网络执行此操作。

To change your DNS server on an iPhone or iPad, head to Settings > Wi-Fi and tap the “i” button to the right of the Wi-Fi network you want to configure. Scroll down and tap the “Configure DNS” option under DNS.

要在iPhone或iPad上更改DNS服务器,请转至“设置”>“ Wi-Fi”,然后点击要配置的Wi-Fi网络右侧的“ i”按钮。 向下滚动并点击DNS下的“配置DNS”选项。

Tap “Manual” and remove any DNS server addresses you don’t want to use from the list by tapping the red minus sign. Tap the green plus sign and type any DNS server addresses you want to use. You can enter both IPv4 and IPv6 addresses in this list. Tap “Save” when you’re done.

点击“手动”,然后通过点击红色减号从列表中删除您不想使用的任何DNS服务器地址。 点击绿色加号,然后键入要使用的任何DNS服务器地址。 您可以在此列表中输入IPv4和IPv6地址。 完成后,点击“保存”。

You can always tap “Automatic” here again to restore the default DNS server settings for the network.

您随时可以再次在此处点击“自动”以恢复网络的默认DNS服务器设置。

在Mac上 (On a Mac)

To change the DNS server on your Mac, head to System Preferences > Network. Select the network adapter you want to change the DNS server, like “Wi-Fi”, on the left, and then click the “Advanced” button.

在Mac上更改DNS服务器,请转到系统偏好设置>网络。 在左侧选择要更改DNS服务器的网络适配器,例如“ Wi-Fi”,然后单击“高级”按钮。

Click over to the “DNS” tab and use the DNS Servers box to configure your desired DNS servers. Click the “+” button at the bottom and add IPv4 or IPv6 server addresses to the list. Click “OK” when you’re done.

单击“ DNS”选项卡,然后使用“ DNS服务器”框配置所需的DNS服务器。 单击底部的“ +”按钮,然后将IPv4或IPv6服务器地址添加到列表中。 完成后,单击“确定”。

If things don’t work as expected after changing your DNS server, you can reset your DNS cache to ensure macOS is using the new DNS server’s records and not cached results from a previous DNS server.

如果在更改DNS服务器后事情没有按预期进行,则可以重置DNS缓存以确保macOS使用的是新DNS服务器的记录,而不是先前DNS服务器的缓存结果。

在Chromebook上 (On a Chromebook)

This option is built into Chrome OS, too. But, as on iPhones, iPads, and Android devices, you can only change the DNS server for one network at a time. You’ll have to change it for each Wi-Fi network you connect to if you want to use it everywhere.

该选项也内置在Chrome操作系统中。 但是,就像在iPhone,iPad和Android设备上一样,您一次只能更改一个网络的DNS服务器。 如果要在任何地方使用它,则必须为连接的每个Wi-Fi网络更改它。

On a Chromebook, head to Settings > Wi-Fi and click the name of the Wi-Fi network you’re connected to.

在Chromebook上,转到“设置”>“ Wi-Fi”,然后单击您所连接的Wi-Fi网络的名称。

Click the “Network” header to expand it and locate the “Name servers” section. Click the “Automatic name servers” box and set it to either “Google name servers” if you want to use the Google Public DNS servers, or click “Custom name servers” if you want to enter custom DNS servers.

单击“网络”标题以将其展开,然后找到“名称服务器”部分。 如果要使用Google Public DNS服务器,请单击“自动名称服务器”框并将其设置为“ Google名称服务器”,如果要输入自定义DNS服务器,则单击“自定义名称服务器”。

Enter the DNS servers you want to use in the boxes here. You’ll have to repeat this step for each separate Wi-Fi network you connect to, if you want to use the DNS servers on different Wi-Fi networks.

在此处的框中输入要使用的DNS服务器。 如果要在不同Wi-Fi网络上使用DNS服务器,则必须对连接到的每个独立Wi-Fi网络重复此步骤。



Other devices may have their own built-in options for setting their own DNS server. Look under network connection settings on the device to see if an option to set custom DNS servers is available.

其他设备可能具有自己的内置选项来设置自己的DNS服务器。 在设备的网络连接设置下查看,以查看设置自定义DNS服务器的选项是否可用。

Image Credit: Casezy idea/Shutterstock.com

图片来源: Casezy idea /Shutterstock.com

翻译自: https://www.howtogeek.com/167533/the-ultimate-guide-to-changing-your-dns-server/

linux服务器修改dns

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值