you need a local dns
add 2 zones into local DNS (bind server too resolves on UAMLISTEN IP, Port UDP 53)
Example:
HS_UAMLISTEN=10.10.10.1
HS_DNS1=10.10.10.1
Windows 10 and above use http://www.msftconnecttest.com/connecttest.txt
Windows 8.1 and earlier versions use http://www.msftncsi.com/ncsi.txt
zone: msftncsi.com
www IN A 190.46.255.40 (or any public IP)
zone: msftconnecttest.com
www IN A 13.107.4.52 (or any public IP)
Another and best option, uses RPZ (Response Policy Zones)
in local zone:
response-policy { zone "rpz"; } qname-wait-recurse no;
zone "rpz" {
type master;
file "/etc/bind/db.rpz";
};
file db.rpz:
www.msftconnecttest.com IN A 13.107.4.52
www.msftncsi.com IN A 190.46.255.40
190.46.255.40 and 13.107.4.52 are the real IP addresses of each URL. It does not matter that you do not have internet, since coovachilli before login always responds to TCP ports 80 for any IP (not dropped on a Firewall or IPTABLES)
In this way the DNS resolves the hosts and the browser redirects the page.
Windows 10 it works perfect.
For Android devices:
connectivitycheck.gstatic.com IN A 216.58.222.163
connectivitycheck.android.com IN A 216.58.222.174
clients1.google.com IN A 216.58.222.174
clients3.google.com IN A 216.58.222.174
I have scrips that check the status of the internet, so when there is no connection it redirects to an "internet temporarily out of service" page. The captive portal also has several interventions according to the needs of my clients.
https://github.com/coova/coova-chilli/issues/212