Dnsmasq 和 resolv.conf 是什么关系?

2015-01-26 09:54:01 +08:00
 hzqim
dnsmasq 监听了 53 端口,应该就是系统的默认 DNS server,resolv.conf 是否只用于指定系统的上游 DNS server?
如果我在 dnsmasq.conf 里指定了server=127.0.0.1#5353 (chinadns),那么是否可以无视 resolv.conf 的设定了?

一句话就是dnsmasq和resolv.conf的优先级或依附关系是怎样的?

谢谢指点。
5471 次点击
所在节点    问与答
4 条回复
chon
2015-01-26 10:14:16 +08:00
Dnsmasq可以提供DNS服务,而resolv.conf是Linux中DNS的配置文件,二者没有关系。
letitbesqzr
2015-01-26 10:35:22 +08:00
应该来说是指dnsmasq如果没有指定上游dns server 就会默认去使用resolv.conf里指定的
Oishi
2015-01-26 11:03:56 +08:00
dnsmasq配置文件中由选项可以控制是否使用resolv.conf

# If you don't want dnsmasq to read /etc/resolv.conf or any other
# file, getting its servers from this file instead (see below), then
# uncomment this.
#no-resolv
princelai
2015-01-26 11:10:34 +08:00
一般情况下resolv.conf = resolv.conf.auto,不解析就是no-resolv,应该只是一个官方Dns

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/165451

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX