Nuk ka kaluar as 10 vjet që zhvilluesit e RoS (në stable 6.47) shtuan funksionalitetin që lejon redirektimin e kërkesave DNS sipas rregullave të veçanta. Nëse dikur duhej të merreshim me rregullat e Layer-7 në firewall, tani kjo bëhet thjesht dhe me elegancë:
/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
Lumturia ime nuk ka kufij!
ĂfarĂ« rreziku na sjell kjo?
Së paku, ne do të çlirohemi nga struktura të çuditshme me NAT si kjo:
/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
Dhe kjo nuk është e gjitha, tani mund të shkruajmë disa serverësh redirigjime, që do të ndihmojnë në krijimin e DNS failover.
Përpunimi inteligjent i DNS do të japë mundësinë për të filluar zbatimin e ipv6 në rrjetin e kompanisë. Deri tani nuk e kisha bërë këtë, arsyeja ishte se duhet të lejoja një sërë emrash DNS në adresat lokale, dhe në ipv6 kjo nuk mund të bëhej pa disa zgjidhje të mëdha.
Burimi: habr.com
