Mikrotik split-dns: ทำได้แล้ว

น้อยกว่า 10 ปีต่อมา ผู้พัฒนา RoS (ในเวอร์ชันเสถียร 6.47) ได้เพิ่มฟังก์ชันการทำงานที่ให้คุณเปลี่ยนเส้นทางคำขอ DNS ตามกฎพิเศษ หากก่อนหน้านี้จำเป็นต้องหลบเลี่ยงกฎ Layer-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

ยังไม่หมดเพียงเท่านี้ คุณสามารถลงทะเบียน Forwarder ได้หลายตัว ซึ่งจะช่วยให้ DNS ล้มเหลว
การประมวลผล DNS อัจฉริยะจะทำให้สามารถเริ่มแนะนำ ipv6 เข้าสู่เครือข่ายของบริษัทได้ ก่อนหน้านั้นฉันไม่ได้ทำสิ่งนี้ เหตุผลก็คือฉันต้องแก้ไขชื่อ DNS จำนวนหนึ่งเป็นที่อยู่ในท้องถิ่น และใน ipv6 สิ่งนี้ไม่สามารถทำได้หากไม่มีไม้ค้ำที่ค่อนข้างใหญ่

ที่มา: will.com