如何理解/etc/resolv.conf的格式?
$ 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
search fios-router.homeManpage of /etc/ says说
不同的配置选项是:名称服务器名称服务器、IP地址、解析器应该查询的名称服务器的Internet地址.
那么,nameserver 127.0.0.53是否意味着我的本地机器正在运行一个IP地址为127.0.0.53的DNS服务器?我怎样才能知道它的过程?
domain Local domain name. Most queries for names within this domain can use short names relative to the local domain. If set to '.', the root domain is considered. If no domain entry is present, the domain is determined from the local hostname returned by gethostname(2); the domain part is taken to be everything after the first '.'. Finally, if the hostname does not contain a domain part, the root domain is assumed.
这部分是什么意思?上面的内容只是提到了哪些值可以设置为某一项,但并没有解释/etc/rupv.conf中的这个部分意味着什么。为什么我的/etc/ does没有这个部分?
search Search list for host-name lookup. The search list is normally determined from the local domain name; by default, it contains only the local domain name.
这部分是什么意思?search fios-router.home在我的/etc/rupv.conf中是什么意思?
谢谢。
发布于 2019-02-11 17:59:15
/etc/resolv.conf是DNS客户端的主要配置文件,因此它的存在并不意味着您正在运行DNS服务器。
它的主要目的是列出DNS服务器的IP地址,在您的示例中:
名称服务器127.0.0.53
nameserver的条目告诉主机要使用哪个DNS服务器。domain的条目(如果存在的话)告诉系统它在哪个域。这允许通过其主机名进行寻址。(回应评论:主机名是网络中计算机的名称。在许多系统上,您可以在命令提示符中看到主机名;如果没有,可以使用命令hostname找到它。)search类型的条目(如果存在的话)将允许来自不同域的计算机通过各自的主机名相互寻址。这个文件现在通常由NetworkManager (例如,在我的系统中,文件以注释“由NetworkManager生成”开始)或由systemd-resolved生成。
是向本地应用程序提供网络名称解析的系统服务。它实现了一个缓存和验证DNS/DNSSEC存根解析器,以及一个LLMNR和MulticastDNS解析器和响应程序。
另外,根据系统d-解析的手册的说法,地址127.0.0.53是“本地DNS存根侦听器”。在相关的Stack Exchange站点上,有一些关于如何更改此操作的问题,因为文件是/etc/resolv.conf是自动生成的。例如见
发布于 2019-02-11 17:54:35
是的,第一部分表示您的系统期望一个名称服务器正在侦听localhost,在本例中,特别是127.0.0.53。
第二部分是一个搜索路径,它被附加到不以句号(.)结尾的所有搜索中。例如,如果运行ssh blah,DNS将首先尝试查找blah,然后尝试查找blah.fios-router.home。
发布于 2019-02-11 17:52:21
search fios-router.home部分是最后一个可解析域,即您的路由器(iirc )。
127.0.0.53是名称服务器的IP地址,所以您的假设是正确的。
https://unix.stackexchange.com/questions/499993
复制相似问题