[SOLVED] IPv6 - Advertise router as DNS - dynamic IPv6 prefix

Hello,

for few years I have problems with mikrotik using them with IPv6 in LAN. Problem is I am using mikrotik router as DNS server (I know it is not ideal and there are some problems with some aplications - mainly with DNSSEC not being validated by router => no AD flag in responses… But for my personal usage it is “OK”).

Unfortunately when I am using IPv6 SLAAC (IPv6 => ND), there is no easy option to advertise my router as DNS for IPv6 devices (so when device has IPv6 support, which is most of them, local names resolution does not work).

I found an option here: http://forum.mikrotik.com/t/ipv6-advertise-router-as-dns/118071/1
But this also has a problem. My IPv6 prefix is dynamic and it changes from time to time. So there is no static IPv6 DNS address to assign using

/ipv6 nd set X advertise-dns=yes dns=

.
Is there any easy way to convince router to advertise it’s current IPv6 address on the interface where ND is defined?

You can advertise LL address fe80::whateveritis/64 which is not dynamic

Since everyone says “do not use local link adressess” I am not using them at all.

Anyway, solution came to my mind this morning out of nowhere. Of course it is script run by scheduler.
If anyone has same problem, here is the script:

:local DynamicPool "VDSL-IPv6";
:local NDinterface "vlan666";

:local IPv6Public [/ipv6/address/get [find from-pool=$DynamicPool] address];
:set IPv6Public [:pick $IPv6Public 0 [:find $IPv6Public "/"]]

:local IPv6DNS [/ipv6/nd/get [find interface=$NDinterface] dns];

:if ($IPv6Public != $IPv6DNS) do={
  /ipv6/nd/set dns=$IPv6Public [find interface=$NDinterface];
}

Hi,
another solution could be to assign also ULA prefix (fd00:…) to your interface.
Then you simply add this ULA address in RA messages.