深圳企业网站建设开发费用,有没有专门做本子的网站,市场营销案例,响应式网站好还是自适应网站好域名解析被干扰的有点严重#xff0c;直接使用谷歌dns服务器来解析ip 第一、永久修改DNS方法
1、修改 /etc/systemd/resolved.conf 文件
vi /etc/systemd/resolved.conf这里我们可以看到这些参数#xff1a;
# 指定 DNS 服务器#xff0c;以空白分隔#xff0c;支持 IP… 域名解析被干扰的有点严重直接使用谷歌dns服务器来解析ip 第一、永久修改DNS方法
1、修改 /etc/systemd/resolved.conf 文件
vi /etc/systemd/resolved.conf这里我们可以看到这些参数
# 指定 DNS 服务器以空白分隔支持 IPv4 或 IPv6 位置
DNS8.8.8.8 114.114.114.114
# 备用 DNS 服务器
FallbackDNS8.8.8.8
# 设置搜索域名
Domainsdomain.com
# 设置 LLMNR 是否激活可用的选项有 yes、no、resolve
LLMNRyes
# 设置 MulticastDNS 是否激活可用的选项有 yes、no、resolve
MulticastDNSyes
# 设置 DNSSEC 是否激活可用的选项有 yes、no、allow-downgrade
DNSSECyes
# 设置缓存是否激活可用的选项有 yes、no、no-negative
Cacheno-negative
根据需要修改 resolved.conf 文件中的DNS然后保存。 我的配置是
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details[Resolve]
DNS8.8.8.8 114.114.114.114
FallbackDNS8.8.4.4
#Domains
#LLMNRno
#MulticastDNSno
#DNSSECno
Cacheno
#DNSStubListeneryes2、重启 systemd-resolved 服务
systemctl restart systemd-resolved3、设置开机启动 systemd-resolved 服务
systemctl enable systemd-resolved4、备份 systemd-resolved 托管文件 resolv.conf
mv /etc/resolv.conf /etc/resolv.conf.bak重新生成。
ln -s /run/systemd/resolve/resolv.conf /etc/第二、临时修改DNS方法
如果我们临时使用的话也可以临时修改DNS。
修改下面文件
vi /etc/resolv.conf加入想要修改的DNS
nameserver 8.8.8.8
nameserver 8.8.4.4如果多个DNS就一行一个修改之后保存退出即可此方法修改后即刻生效但重启后失效。
清理现有dns缓存
sudo systemd-resolve --flush-caches
sudo systemctl restart systemd-resolved
查看现在的dns cat /etc/resolv.conf