我运行Ubuntu 16.04 LTS。
我希望将来自某些ip-range的DNS请求重定向到dnsmasq在port 1995上的另一个实例。为此,我在/etc/dnsmasq.conf文件中添加了以下行:
dhcp-range=set:red,10.10.10.11,10.10.10.222,255.255.255.0,12h
dhcp-option=tag:red,6,10.10.10.10:1995但是当我重新启动dnsmasq时,它无法告诉Bad IP address on line ...
我也试过
dhcp-option=tag:red,6,10.10.10.10#1995 这也失败了,因为Bad IP Address
现在,告诉我如何在dhcp-option中指定其他DNS服务器的端口号?
发布于 2017-12-03 11:02:16
说到这里,问题不在于dnsmasq,而在于DHCP协议本身。
选项6没有容纳任何端口的字段,只有4个字节/字节(32位) IPv4地址的序列。
3.8. Domain Name Server Option
The domain name server option specifies a list of Domain Name System
(STD 13, RFC 1035 [8]) name servers available to the client. Servers
SHOULD be listed in order of preference.
The code for the domain name server option is 6. The minimum length
for this option is 4 octets, and the length MUST always be a multiple
of 4.
Code Len Address 1 Address 2
+-----+-----+-----+-----+-----+-----+-----+-----+--
| 6 | n | a1 | a2 | a3 | a4 | a1 | a2 | ...
+-----+-----+-----+-----+-----+-----+-----+-----+--除非您正在更改总体方法,否则您将希望将不同的名称服务器放在不同的地址上,而不是在不同的端口上。
https://serverfault.com/questions/886318
复制相似问题