Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我喜欢运行我自己的名称服务器(BIND)的想法,但如果我这样做,我无法通过将它们放入 /etc/hosts 来阻止讨厌的网站
DNSMasq 能够引用 /etc/hosts 但不是指定“上游” dnsserver,我希望它能够在同一台机器上使用 BIND。但是,它们都需要使用相同的端口。
这可能吗?我在常规搜索中找不到任何关于此的内容。
我想另一种方法是在 VM 中运行另一个 Linux 实例并在那里运行 DNSMasq(比如说),但我不想这样做。
您可以将多个 IP 地址分配给同一个接口,或者使用
ip addr add <address>/32 dev eth0
或使用
ifconfig eth0:1 <address>
然后将一台服务器绑定到一个地址,另一台服务器绑定到第二个地址。查询哪个服务器现在取决于您的查询发送到的 IP 地址。
这些示例假设您的 eth 接口是 eth0。