Mikrotik split-dns: viņi to izdarīja

Nepagāja pat 10 gadi, kad RoS izstrādātāji (versijā 6.47) pievienoja funkcionalitāti, kas ļauj novirzīt DNS pieprasījumus atbilstoši īpašām pamatnostādnēm. Ja iepriekš nācās izlocīties ar Layer-7 noteikumiem ugunsmūrī, tad tagad tas tiek darīts vienkārši un eleganti:

/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

Manam laimē nav robežu!

Ko tas mums draud?

Vismaz mēs atbrīvojamies no dīvainajām NAT konstrukcijām, piemēram, šīs:


/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

Un tas vēl nav viss, tagad var norādīt vairākas serveriem pārsūtīšanas iespējas, kas palīdzēs izveidot dns failover.
Inteliģenta DNS apstrāde dos iespēju sākt ipv6 ieviešanu uzņēmuma tīklā. Iepriekš es to nedarīju, jo man bija jāatļauj vairāku dns nosaukumu atbilstība vietējiem adresēm, un ipv6 to nevarēja izdarīt bez diezgan lielām trūkumiem.

Avots: habr.com

Iegādājieties uzticamu tīmekļa hostingu ar DDoS aizsardzību, VPS VDS serveriem 🔥 Iegādājieties uzticamu tīmekļa hostingu ar DDoS aizsardzību, VPS VDS serveriem | ProHoster