DNS Conditional Forwarders With Mikrotik RouterOS
DNS Conditional Forwarders With Mikrotik RouterOS
co m
Should you wish to run multiple conditional f orwards, all you need to do is use the above 5 commands f or your other domains. See the below example f or using the same commands on the domain domain.com. You will notice that all I have changed is the domain name and the f orwarding IP address [admin@Rout erOS] > /ip rewall layer7-prot ocol add name=domain.com regexp=domain.com [admin@Rout erOS] > /ip rewall mangle add chain=prerout ing dst -address=10.0.0.254 layer7prot ocol=domain.com act ion=mark-connect ion new-connect ion-mark=domain.com-forward prot ocol=t cp dst -port =53 [admin@Rout erOS] > /ip rewall mangle add chain=prerout ing dst -address=10.0.0.254 layer7prot ocol=domain.com act ion=mark-connect ion new-connect ion-mark=domain.com-forward prot ocol=udp dst -port =53 [admin@Rout erOS] > /ip rewall nat add act ion=dst -nat chain=dst nat connect ionmark=domain.com-forward t o-addresses=10.0.4.11 [admin@Rout erOS] > /ip rewall nat add act ion=masquerade chain=srcnat connect ionmark=domain.com-forward
T hats it. You should now be able to communicate with any hostname within each of those domains. You can use ping/telnet or any other method of your chosing to verif y the settings. I have simply pinged one of my Yubikey servers in the example.com domain. [mac@localhost ~]$ ping ykval01.example.com PING ykval01.example.com (10.0.1.31) 56(84) byt es of dat a. 64 byt es from 10.0.1.31: icmp_seq=1 t t l=63 t ime=4.53 ms 64 byt es from 10.0.1.31: icmp_seq=2 t t l=63 t ime=4.53 ms 64 byt es from 10.0.1.31: icmp_seq=3 t t l=63 t ime=4.33 ms 64 byt es from 10.0.1.31: icmp_seq=4 t t l=63 t ime=4.34 ms ^C --- ykval01.example.com ping st at ist ics --4 packet s t ransmit t ed, 4 received, 0% packet loss, t ime 3004ms rt t min/avg/max/mdev = 4.332/4.436/4.538/0.129 ms [mac@localhost ~]$