Ubuntu 10.10下Dnsmasq和Named似有冲突

我用的服务器版的Ubuntu 10.10。

装了个dnsmasq。完了老起不来。sudo /etc/init.d/dnsmasq restart
之后
提示dnsmasq: failed to create listening socket: Address already in use [fail]

后来查英文文章,dnsmasq和其他dns解析服务都用53端口。

sudo netstat -anlp | grep -w LISTEN

一看53端口被named占用。但是我想本机又dnsmasq自己用,又起dns别的解析服务程序。 【LINUX公社  】

这就可以利用端口绑定。/etc/dnsmasq.conf这个文件中有说明。

# On systems which support it, dnsmasq binds the wildcard address,
# even when it is listening on only some interfaces. It then discards
# requests that it shouldn't reply to. This has the advantage of
# working even when interfaces come and go and change address. If you
# want dnsmasq to really bind only the interfaces it is listening on,
# uncomment this option. About the only time you may need this is when
# running another nameserver on the same machine.
bind-interfaces

这行bind-interfaces之前是有井号的,把井号去了,保存。重启dnsmasq,我为我本机的lo口多加了一个127.0.0.2的地址。完了监听地址也绑到127.0.0.2上去。省的他老提示我127.0.0.1的端口被占用。
listen-address=127.0.0.2
这样,把resolv.conf和dhclient.conf也相对的改了,后来就没事了。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wygdsg.html