V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
hzqim
V2EX  ›  问与答

Dnsmasq 和 resolv.conf 是什么关系?

  •  
  •   hzqim · 2015-01-26 09:54:01 +08:00 · 5451 次点击
    这是一个创建于 3388 天前的主题,其中的信息可能已经有所发展或是发生改变。
    dnsmasq 监听了 53 端口,应该就是系统的默认 DNS server,resolv.conf 是否只用于指定系统的上游 DNS server?
    如果我在 dnsmasq.conf 里指定了server=127.0.0.1#5353 (chinadns),那么是否可以无视 resolv.conf 的设定了?

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

    谢谢指点。
    4 条回复    2015-01-26 11:10:34 +08:00
    chon
        1
    chon  
       2015-01-26 10:14:16 +08:00 via Android   ❤️ 1
    Dnsmasq可以提供DNS服务,而resolv.conf是Linux中DNS的配置文件,二者没有关系。
    letitbesqzr
        2
    letitbesqzr  
       2015-01-26 10:35:22 +08:00   ❤️ 1
    应该来说是指dnsmasq如果没有指定上游dns server 就会默认去使用resolv.conf里指定的
    Oishi
        3
    Oishi  
       2015-01-26 11:03:56 +08:00   ❤️ 1
    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
        4
    princelai  
       2015-01-26 11:10:34 +08:00   ❤️ 1
    一般情况下resolv.conf = resolv.conf.auto,不解析就是no-resolv,应该只是一个官方Dns
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5523 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 08:31 · PVG 16:31 · LAX 01:31 · JFK 04:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.