There Mikrotik hAP ac2. RouterOS 6.43. In the local network there is a machine Ubuntu Server 16.04 (hereinafter UbS16.04) and a TV (hereinafter LGSmartTV) that will be awakened via Wake-On-Lan (connection to the router via cable). Wake-on-lan works very well. Yesterday I installed Pi-Hole on UbS16.04. In Mikrotik I specified IP UbS16.04 as the address of the DNS-server. After that, the Wake-On-Lan team stopped waking both UbS16.04 and LGSmartTV. If you remove the use of an external static DNS-server in the Mikrotik settings and then overload it, the Wake-On-Lan command works.
UbS16.04 itself is turned on and off periodically, as needed, its services.
What I need.
UbS16.04 and LGSmartTV must be enabled via Wake-On-Lan. 24-hour UbS16.04 operation is not considered.
Mikrotik should switch to using the UbS16.04 as a DNS-server when it is turned on. Any method other than physical access to the router is considered.
P.S.
How to make that after turning on UbS16.04, Mikrotik began to use it as a DNS server?
Now I know one way - restart Mikrotik.
Not related to the WoL problem, but … the point above is not going to happen automatically.
DNS services are expected to be available (semi) permanently. Surely services have problems and due to that one configures more than one server. In case of DNS this means that RB (in this particular case) polls server #1 with a query and if it doesn’t receive an answer in due time, it’ll poll server #2 (if configured). At this point, ROS implementation will stop using server #1 as long as server #2 is returning answers. BTW, all configured servers are expected to give back same results so it’s not envisioned that client should poll a particular server every time and only use other servers as fall-back.
To return to the point quoted above: you can achieve what’s written by using some script … which would run periodically and check responsiveness of the primary DNS server (pi-hole on Ubuntu) and in case it stops responding, change DNS configuration on the RB (to use alternate DNS server). Afterwards it’d still check responsiveness of the primary DNS server and when it becomes responsive again, the script would change DNS configuration on RB (to use primary DNS server again).
Thank you very much. Now I understand how the choice of a DNS server works.
Who knows why stop working WOL, if Mikrotik is configured on a DNS-server from the LAN?
Even if the DNS-server is off.