大网数据广告活动
服务器运维问答

Per-client DNS servers with DNSMasq

· 52CE 我爱测

I am running TomatoUSB with DNSMasq to provide DHCP and DNS services for my local network. What I would like to achieve is to provide alternative DNS servers for one or two specific clients on the network based on their IP or MAC…

问题原文

原帖链接 · Mike Hughes · CC BY-SA 3.0

I am running TomatoUSB with DNSMasq to provide DHCP and DNS services for my local network.

What I would like to achieve is to provide alternative DNS servers for one or two specific clients on the network based on their IP or MAC (These clients do not accept manual configuration of DNS servers).

It does not matter if this is DNS Masq using a different DNS server for these IPs or whether different DNS servers are delivered via DHCP.

社区高分解答

原帖链接 · Zoredache · CC BY-SA 4.0

Setup reservations for the specific hosts using the dhcp-host option. Use tag options to flag those for a special set of options.

This is completely un-tested, but I suspect your config might look something like this. Check the man page for full details.

dhcp-host=00:15:99:27:f8:98,set:specialhosts,192.168.32.20
dhcp-host=00:51:99:72:8f:89,set:specialhosts,192.168.32.21
dhcp-option=tag:specialhosts,option:dns-server,8.8.8.8,8.8.4.4

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-05-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。