Mikrotik 分割 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