0

I am trying to implement captive portal with dnsmasq. In dnsmasq config address=/#/10.42.0.1 doesn't work, so I have to use ugly:

address=/com/10.42.0.1
address=/uk/10.42.0.1
address=/org/10.42.0.1
address=/gov/10.42.0.1 ...

This redirects all listed domains fine, if in browser you go anywhere, however captive portal browser doesn't pop up by itself (checked no mac win and linux), and there is problem if site redirects to https (like facebook), my portal page is http only.

So how should it be setup correcltly to replace all domain names or even just make browser pop up with captive portal page?

UPD: acording to man page:

--address=/#/1.2.3.4 will always return 1.2.3.4 for any query not answered from /etc/hosts or DHCP and not sent to an upstream nameserver by a more specific --server directive.

So how can I make sure there is no upstream hosts for the NetworkManager - dnsmasq?

anarxz
  • 176
  • 4
  • Why do you want to roll your own? – vidarlo Jan 23 '22 at 18:28
  • @vidarlo I use NetworkManager as hotspot, it uses it's own dnsmasq plugin, so i assumed it will be the easiest way to setup captive portal - with dns redirect. – user453575457 Jan 23 '22 at 18:37
  • What is your end goal here? Just redirect everyone to one page, or to actually provide internet access once authenticated? – vidarlo Jan 23 '22 at 18:39
  • @vidarlo redirect to one page, but ideally webbrowser with page should pop up when connected to hotspot. Now i got redirected not immediately on connect to wifi, but only hwen browser is opened by user. With internet access after auth i got no problem – user453575457 Jan 23 '22 at 18:43

0 Answers0