So I managed to get it working.
You need to do few additional things though, to get it to redirect properly and to fool the clients.
This is my down script
{
/ip dns static remove [/ip dns static find where name~“your hotspot fqdn”];
/ip dns cache flush ;
/ip dns static disable [/ip dns static find where comment~“CORRECTION”];
/ip dns static enable [/ip dns static find where comment~“MAINTENANCE”];
/ip hotspot profile set [/ip hotspot profile find where html-directory~“flash/hotspot”] html-directory=“flash/maintenancePage”;
/ip hotspot active remove [/ip hotspot active find];
:log warning “Internet down, showing maintenance page”
;}
&
This is up script
{
/ip dns static disable [/ip dns static find where comment~“MAINTENANCE”];
/ip dns static enable [/ip dns static find where comment~“CORRECTION”];
/ip dns cache flush ;
/ip hotspot profile set [/ip hotspot profile find where html-directory~“flash/maintenancePage”] html-directory=“flash/hotspot”;
/ip hotspot profile set [/ip hotspot profile find where html-directory~“flash/hotspot”] dns-name=“www. Your hotpot fqfn”;
/ip hotspot profile set [/ip hotspot profile find where html-directory~“flash/hotspot”] dns-name=“your site fqdn”;
:log warning “Internet up, showing normal hotspot page”
;}
And be sure to add a static dns entry for your site at priority
As attached screenshot with “comments as written” using regex entry.
Yes agreed some of the above is redundant and unnecessary but i do it anyway to be super safe.
Essentially the static dns gives priority to static entry over dynamic ones so when we add a static entry to fool dns (when internet is down) it effects the hotspot static entry too, making it impossible to use another ip other than hotpot ip to fool clients as when we add a different ip the pages do not redirect.
Adding these entries helps to successfully fake dns to a non working ip while still making sure hotspot ip works as intended.