I've posted about this moons ago however i have a new twist to the original tale of woe.
I'm using a medion E5004 with android 5.1. Like the previous identical model, this one has gremlins when the phone screen locks for a bit. Sometimes DNS works, other times it doesn't (it's set for the dns server on my PC but if that fails it seems to resort to googles DNS).
I use an app called automate - which can be used for all sorts of things however two features i use it for are to ping the CCTV camera in the residents car park and also to ping the phone buried in the motors dashboard. Why? - Well i can grab a screenshot from the camera but it takes time so it's easier to send a ping first to make sure it's reachable. The second one is to make sure that the van is actually still out there without needing to grab a screenshot (had interest from the local travellers - hence wanting to be able to monitor it).
I have two domains setup for this - cp.cam.lan (the camera) and van.lan (the phone).
Now, when the screen locks, i unlock it a while later and try to ping both. van.lan is looked up on my dns server and pinged successfully. cp.cam.lan however is not looked up and does not ping - when i look in the error logs for automate it says it was an unknown host - in other words, it wasn't looked up successfully via dns.
Now i get that android will switch to it's own google dns servers if it can't reach my custom dns server but why does it only do it for one domain and not all of them? - It seems nuts. Annoyingly it repeats this behaviour even if i disconnect and reconnect the wifi - somewhile later it will give up on cp.cam.lan yet van.lan will remain resolveable.
Both domains are resolved and pinged successfully from windows command prompt.
Fixed! Go to the fix.
Re: Android DNS woes
Probably not much - the dot is intentional as it's a subdomain of cam.lan (i'm mulling over a 2nd camera). What annoys me is that the dns lookup doesn't even reach the dns server, android just seems to deliberately ignore it and try via it's own nameservers.
Re: Android DNS woes
I'd echo the thought about it being the sub-domain. No obvious explanation but it's the only apparent difference between the one that works and the one that doesn't. Try temporarily concatenating it to an SLD and see if the problem goes away. Do you really need a hierarchical namespace with such a small set of devices?
Well as luck would have it, the sub domain also started playing up so i'm putting this down to a google screw up.
The hack was to create a automate shortcut to a "flow" which turns the wifi off and then back on.