Community discussions

MikroTik App
 
Angel0ne
just joined
Topic Author
Posts: 3
Joined: Tue Jan 08, 2019 11:25 am

Round Robin DNS for local host

Wed Dec 01, 2021 12:54 pm

Hi all,

is it possibile to implement a Round Robin DNS for local hostname in RouterOS? I have a local hostname that could be resolved with may LAN IPs, to give an example:

example.lan 10.10.0.1
example.lan 10.10.0.2
example.lan 10.10.0.3

I'm expecting that when a client performs a dns lookup through the Mikrotik it gets one of this IP in a round robin order.
Is it also possibile to test if an IP is alive (respond to an ICMP request like ping) before returning it to the client?

Many thanks for the support.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11442
Joined: Thu Mar 03, 2016 10:23 pm

Re: Round Robin DNS for local host

Wed Dec 01, 2021 6:13 pm

When single host has multiple A records (multiple IP addresses), then usual DNS servers will return all of them in query response, only order can be changed on subsequent queries. How are then used those multiple addresses is entirely up to client (both resolver library and application), some will only use first address on the list, some will try other addresses if connection fails when using first one, ...).
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Round Robin DNS for local host  [SOLVED]

Wed Dec 01, 2021 6:18 pm

Quick test says that RouterOS returns all defined addresses, so client is free to choose. And in case it uses the first one, you're still in luck, because RouterOS changes order of addresses in each response.

As for testing what's alive, that could be done using script, either a scheduled one where you'd ping addresses yourself, or you can use Tools->Netwatch, which would be simpler.
 
Angel0ne
just joined
Topic Author
Posts: 3
Joined: Tue Jan 08, 2019 11:25 am

Re: Round Robin DNS for local host

Wed Dec 01, 2021 9:02 pm

Many thanks for the answers and for having done some test on your router

Who is online

Users browsing this forum: Amazon [Bot], CGGXANNX, godel0914, toffline and 66 guests