在dnsmasq中禁用dhcp服务

我只想使用dnsmasq转发所有的DNS请求到谷歌的DNS服务器,并禁用DHCP …

我怎样才能达到这个结果?

    dnsmasq默认禁用dhcp服务器。 要启用它,你必须在/etc/dnsmasq.conf取消注释与dhcp相关的行

    将所有请求转发到208.67.222.222,这足以在/etc/resolv.conf添加(而不用触及dnsmasqconfiguration):

     nameserver 127.0.0.1 # In order to configure dnsmasq to act as cache for the host on which it # is running, put [as the first line] "nameserver 127.0.0.1" in /etc/resolv.conf to force # local processes to send queries to dnsmasq. [...] # dnsmasq is smart enough to ignore this line and forward all queries appropriately, # while all other applications will send all their queries to dnsmasq. nameserver 208.67.222.222 

    而已 :)

    只需在dnsmasq.conf文件中注释掉与dhcp相关的行,然后重新启动dnsmasq即可。