Mikrotik split-dns:他们做到了

自 RoS(在稳定版 10 中)的开发人员添加允许您根据特殊规则重定向 DNS 请求的功能以来不到 6.47 年。 如果之前需要在防火墙中使用第 7 层规则来规避,现在可以简单而优雅地完成:

/ip dns static
add forward-to=192.168.88.3 regexp=".*\.test1\.localdomain" type=FWD
add forward-to=192.168.88.56 regexp=".*\.test2\.localdomain" type=FWD

我的快乐没有界限!

这对我们有什么威胁?

至少,我们摆脱了像这样的奇怪的 NAT 结构:


/ip firewall layer7-protocol
add comment="DNS Nat contoso.com" name=contoso.com regexp="\x07contoso\x03com"
/ip firewall mangle
add action=mark-packet chain=prerouting comment="mark dns contoso.com" dst-address-type=local dst-port=53 in-interface-list=DNSMASQ layer7-protocol=contoso.com new-packet-mark=dns-contoso.com passthrough=yes protocol=udp
add action=mark-packet chain=prerouting comment="mark dns contoso.com" dst-address-type=local dst-port=53 in-interface-list=DNSMASQ layer7-protocol=contoso.com new-packet-mark=dns-contoso.com passthrough=yes protocol=tcp
/ip firewall nat
add action=dst-nat chain=dstnat comment="DST-NAT dns contoso.com" dst-port=53 in-interface-list=DNSMASQ packet-mark=dns-contoso.com protocol=udp to-addresses=192.0.2.15
add action=dst-nat chain=dstnat comment="DST-NAT dns contoso.com" dst-port=53 in-interface-list=DNSMASQ packet-mark=dns-contoso.com protocol=tcp to-addresses=192.0.2.15
add action=masquerade chain=srcnat comment="mask dns contoso.com" dst-port=53 packet-mark=dns-contoso.com protocol=udp
add action=masquerade chain=srcnat comment="mask dns contoso.com" dst-port=53 packet-mark=dns-contoso.com protocol=tcp

这还不是全部,现在您可以注册多个转发器,这将有助于进行 dns 故障转移。
智能 DNS 处理将使开始将 ipv6 引入公司网络成为可能。 在此之前,我没有这样做,原因是我需要将许多 dns 名称解析为本地地址,而在 ipv6 中,如果没有相当大的拐杖,这是无法完成的。

来源: habr.com