Community discussions

MikroTik App
 
gammy69er
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Sun May 18, 2014 3:01 am

DNS Variables for Scripting (looking for)

Wed Feb 09, 2022 4:06 am

So - I like to have use-peer-dns - however not all connectiuons are created equal and have some sites with ADSL and Satellite (Satellite FAST - but Latency is huge - DSL Slow - but lower latency)

Was considering building a script to check which connection has "Primary DNS" at any given time - and then maybe playing with a way to shuffle them about (Satellite drop and reconnect seems to do the trick - but i have no way to monitor yet)

So - in "/ip dhcp-client print detail" there is a field that shows up as "primary-dns=x.x.x.x" - and presume this is the same for secondary - however for the life of me, cannot find a similar feild for "/interface pppoe-client" or "/ppp profile" (although wasn't expecting it there). This can be used to check against details from "/ip dns get dynamic-servers" - or that is the plan

Does anyone know where/how PPPoE Client hands off it's DNS to "/ip dns".
TBH, can probably just work with the one that I have - but being able to check for a positive and a negative results makes for... better... checks... bah - idk.

To anyone whom replies - cheers in advance.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: DNS Variables for Scripting (looking for)

Wed Feb 09, 2022 2:08 pm

I wouldn't worry about primary and secondary, because those are just misleading names, system uses all resolvers "randomly", if one fails, it moves to next one and keeps using that. And it doesn't have to really fail, it's enough if it doesn't respond quickly enough.

Who is online

Users browsing this forum: No registered users and 27 guests