Score:0

Force host to use alternate DNS servers on unresolvable queries with dnsmasq

gg flag

So here is the situation. I have an IOT device running a Digital Signage system. I am trying to set it up so that it hosts it's own WIFI network and a user can connect to that WIFI, enter an http address on their device and be routed to a Webserver that the IOT device is running. It is important to note that this IOT Device itself is not connected to the internet.

This works fine up until someone tries to use a phone, once they have connected to IOT device, they can no longer access any other websites, as in, once they are connected to the WIFI network, their 4g/5g is effectively broken. I suspect this is because dnsmasq is trying to resolve upstream but has no connection itself to any upstream servers. Is there a way that instead of this, it can bounce the query back to the device for it to try it's alternate servers?

Current dnsmasq.conf below.

dhcp-range=192.168.1.101,192.168.1.124,255.255.255.0,24h
domain=wlan
address=/castboard.net/127.0.0.1

server=0.0.0.0

dhcp-option=6,0.0.0.0,8.8.8.8,8.8.4.4
Michael Hampton avatar
cz flag
Why have you got `dhcp-option=option:router`? Your device is not a router and should not advertise itself as such.
Charlie avatar
gg flag
Those were left over from some troubleshooting. I have since removed those lines.
Score:2
kz flag

Assuming that dnsmasq runs on the IOT device:

Your approach cannot work. As soon as a mobile phone is connected to a WiFi, it assumes that this wifi has an internet connection. But as you say, your IOT device / WLAN has no internet connection, so any attempt to reach an alternative DNS would fail.

The solution to your problem would be to simply configure your phone not to use this WiFi (or configure the Wifi not to accept connections from mobile phones) - as far as I know, a phone does not have the option "use the mobile data connection" while a WiFi is connected. And nothing you configure in your dnsmasq server would be able to change that...

Charlie avatar
gg flag
Thanks for the response. I was running with the logic that in the past, I have had my phone connected to a WIFI on a closed network (ie no internet access) whilst also having my phone still able to connect to the internet via 4G. Perhaps the policies for that on my phone have since changed.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.