AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1097382
Accepted
mathtick
mathtick
Asked: 2018-12-01 02:44:36 +0800 CST2018-12-01 02:44:36 +0800 CST 2018-12-01 02:44:36 +0800 CST

为什么 resolv.conf 有错误的默认值,为什么总是先重新排序错误的名称?

  • 772

已经安装了 resolv.conf 并且它现在基本上将“好” ns 添加到列表中,但仅在最后。

127.0.0.53 (例如)在 github 上挂起和超时。我在同一网络上的笔记本电脑从未出现过此问题,并且似乎自动在 192.158.1.1 上接听。这只是运气吗?

想了解为什么这里的默认设置看起来如此糟糕吗?以及为什么这么多人需要手动干预。他们在其他系统上发现了什么?

编辑/更新:

$ ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Nov 30 10:27 /etc/resolv.conf -> ../run/resolvconf/resolv.conf


$ time nslookup github.com 192.168.1.1
Server:     192.168.1.1
Address:    192.168.1.1#53

Non-authoritative answer:
Name:   github.com
Address: 192.30.253.112
Name:   github.com
Address: 192.30.253.113


real    0m0.073s
user    0m0.006s
sys 0m0.005s

$ time nslookup github.com 127.0.0.53
Server:     127.0.0.53
Address:    127.0.0.53#53

Non-authoritative answer:
Name:   github.com
Address: 192.30.253.112
Name:   github.com
Address: 192.30.253.113
;; connection timed out; no servers could be reached


real    0m15.012s
user    0m0.008s
sys 0m0.004s

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53
nameserver 192.168.1.1

根据 chili555 的一些建议更新 2:

$ ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 37 Dec  1 15:45 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

$ nslookup github.com
Server:     127.0.0.53
Address:    127.0.0.53#53

** server can't find github.com: SERVFAIL

$ nslookup github.com 192.168.1.1
Server:     192.168.1.1
Address:    192.168.1.1#53

Non-authoritative answer:
Name:   github.com
Address: 192.30.253.112
Name:   github.com
Address: 192.30.253.113

$ cat /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 "systemd-resolve --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
wireless
  • 1 1 个回答
  • 320 Views

1 个回答

  • Voted
  1. Best Answer
    chili555
    2018-12-01T08:10:08+08:002018-12-01T08:10:08+08:00

    /etc/resolv.conf 中通常的名称服务器地址 127.0.0.53 一点也不“坏”。它反映 dnsmasq 正在您的系统上运行。

    https://help.ubuntu.com/community/Dnsmasq

    本地 DNS 缓存可以加快互联网浏览速度,因为用户的浏览器在查找计算机之前访问过的域名时不需要访问域名服务器。

    DNS 查找无法与此名称服务器一起工作的事实通常并不意味着名称服务器和底层 dnsmasq 系统有故障。它通常表明这是 resolvconf 系统中的另一个错误。

    /etc/resolv.conf 是符号链接吗?查看:

    ls -al /etc/resolv.conf
    

    它与什么相关联?理想情况下,它将是 /run/systemd/resolve/stub-resolv.conf。如果不是,我们需要纠正它。

    一旦我们找到有关您的系统的更多详细信息,我们将进行一些修改,并且我将进一步编辑此部分答案。

    编辑:我们在您的编辑中看到了这一点:

    $ ls -al /etc/resolv.conf
    lrwxrwxrwx 1 root root 29 Nov 30 10:27 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
    

    我们怀疑链接应该是我在上面发布的。请试试:

    sudo rm -f /etc/resolv.conf
    ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
    

    重新启动并测试。

    • 1

相关问题

  • 华为EC-1260(Tata Photon)USB上网设备如何通过家庭无线网络共享互联网?

  • 如何将 Ubuntu 设置为无线接入点?

  • 如何为 LG X130 上网本安装 relink 无线驱动程序

  • 无论用户是否登录,如何配置 WiFi 以在启动时登录 WPA?

  • 如何设置与 Eee PC 1005 的无线连接?[关闭]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve