首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在resolvconf.conf中指定多个DNS?

如何在resolvconf.conf中指定多个DNS?
EN

Unix & Linux用户
提问于 2018-05-03 03:12:16
回答 1查看 8.6K关注 0票数 5

我正试图在使用“when -u”运行时,使when在/etc/surv.conf中添加两个额外的名称服务器。我的/etc/resolvconf.conf文件如下:

代码语言:javascript
复制
# Configuration for resolvconf(8)
# See resolvconf.conf(5) for details

resolv_conf=/etc/resolv.conf
# If you run a local name server, you should uncomment the below line and
# configure your subscribers configuration files below.
name_servers=1.1.1.1 1.0.0.1

# Mirror the Debian package defaults for the below resolvers
# so that resolvconf integrates seemlessly.
dnsmasq_resolv=/var/run/dnsmasq/resolv.conf
pdnsd_conf=/etc/pdnsd.conf
unbound_conf=/var/cache/unbound/resolvconf_resolvers.conf

当我运行命令“when -u”时,问题就出现了,这是我得到的输出:

代码语言:javascript
复制
/sbin/resolvconf: 7: /etc/resolvconf.conf: 1.0.0.1: not found
/sbin/resolvconf: 7: /etc/resolvconf.conf: 1.0.0.1: not found
/sbin/resolvconf: 7: /etc/resolvconf.conf: 1.0.0.1: not found
/sbin/resolvconf: 7: /etc/resolvconf.conf: 1.0.0.1: not found
/sbin/resolvconf: 7: /etc/resolvconf.conf: 1.0.0.1: not found
/sbin/resolvconf: 7: /etc/resolvconf.conf: 1.0.0.1: not found

如果我只在name_servers行中指定一个DNS,它就能正常工作。我还试图用"“包装DNS定义,但它仍然不接受它们。我在手册中找不到关于正确语法的任何东西。

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2018-05-03 04:55:11

/sbin/resolvconf实际上是一个shell脚本,配置文件只是源脚本,所以您需要的语法与shell脚本相同:

代码语言:javascript
复制
name_servers="1.1.1.1 1.0.0.1"
票数 9
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/441440

复制
相关文章

相似问题

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