首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在最近的一次升级之后,我无法清除DNS缓存

在最近的一次升级之后,我无法清除DNS缓存
EN

Ask Ubuntu用户
提问于 2021-03-05 21:44:51
回答 1查看 2.5K关注 0票数 5

我最近更改了一个网站的NS记录,当我发现使用https://toolbox.googleapps.com/apps/dig/#NS/这样的在线工具时,我可以看到它指向了正确的位置。即使我的手机在同一个wifi网络上--它会转到正确的网站,但在我的Ubuntu20.04上,它仍然会转到以前的站点,并且没有正确地指向新的站点。

在过去,我使用以下命令清除缓存,但这不再有效:

代码语言:javascript
运行
复制
sudo /etc/init.d/nscd restart

我已经找到了一些类似的帖子,并尝试了许多答案或评论中的解决方案,但到目前为止对我没有任何作用。

这是我在3~4小时前更改的问题域的响应:

代码语言:javascript
运行
复制
nslookup the-domain-name.org
Server:     127.0.0.53
Address:    127.0.0.53#53

Non-authoritative answer:
Name:   the-domain-name.org
Address: xx.xx.xx.xx (INCORRECT_IP, points to the DNS provider)
Name:   the-domain-name.org
Address: xx.xx.xx.xx (I am not sure if this IP is correct or not)

当我查看/etc/resolv.conf文件内部时,它有以下内容:

代码语言:javascript
运行
复制
  GNU nano 4.8                    /etc/resolv.conf                              
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0 trust-ad
search local

如何解决这个问题,以及刷新/刷新缓存的正确方法是什么?有人刚刚说到谷歌的DNS,怎么做呢?

编辑:更新,

我不得不将另一个域移到新的IP上,同样的问题再次发生。我尝试了这篇文章中的所有内容,但没有一篇对我有用:https://www.linuxuprising.com/2019/07/how-to-flush-dns-cache-on-linux-for.html

摘要:

挖掘-域A<显示不正确(旧的) IP>

挖掘-域A @8.8.8.8 <显示正确的(新) IP>

查找-域<显示不正确的(旧) address>

查找-域8.8.8.8 <显示正确的(新) address>

在任何浏览器中,chrome,Firefox,Brave,我都能看到老网站。

EN

回答 1

Ask Ubuntu用户

发布于 2021-03-05 22:38:22

resolvectl flush-caches

它可以取决于您是在使用systemd-network还是network-manager。看起来您的resolv.conf是指向127.0.0.53的,它是systemd-resolved绑定到的回送地址。它维护自己的缓存,可以使用resolvectl进行控制。使用systemd-resolved是20.04中的默认设置(如果使用systemd-networkd),但不是以前的LTS版本。

上游DNS服务器也可以缓存结果。如果希望具体查询DNS服务器,则可以使用命令nslookup the-domain-name.org the-dns-serverdig the-domain-name.org @the-dns-server。例如,要查询谷歌流行的quad8服务器,这些命令中的任何一个都能工作。

代码语言:javascript
运行
复制
nslookup example.com 8.8.8.8
dig example.com @8.8.8.8
票数 1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1321456

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档