cancel
Showing results for 
Search instead for 
Did you mean: 

Android DNS - doesn't use nameserver on LAN?

FIXED
7up
Community Veteran
Posts: 15,856
Thanks: 1,603
Fixes: 18
Registered: ‎01-08-2007

Android DNS - doesn't use nameserver on LAN?

Hi all,

 

I've got my DHCP server working in order to hand out the IP of my nameserver which hosts several domains internally on our network. This works fine on windows machines, they do as they're told and use my nameserver and everything is ticketyboo.

On our android devices name resolution drops dead. On the GUI for my nameserver I can see that a request comes in, and that one is issued, wireshark confirms it was replied to and that the packet conforms but android keeps saying that it cannot resolve the domain.

When i set the nameserver ip back to the router (or an external IP) all is good again. It seems that it is only a lan problem where android deliberately refuses to act on information being returned from a nameserver that is on a different IP to the router / gateway. I've even tried the spare wifi AP in case it was getting upset about the nameserver being a hop further away than the router but it still didn't like it.

So my question.. is this a known android thing? - I've found a few references to it online but all the symptoms seem to vary slightly (though pi-hole users have been complaining). I'm just wondering if there is any sort of workaround other than using an external nameserver with internal A records which isn't ideal..

I need a new signature... i'm bored of the old one!
22 REPLIES 22
HairyMcbiker
All Star
Posts: 6,792
Thanks: 266
Fixes: 21
Registered: ‎16-02-2009

Re: Android DNS - doesn't use nameserver on LAN?

Yep seen this on mine. I think there is a dns changer on the play store, but it may require root access, but not tried it I just use ip addresses.
Anonymous
Not applicable

Re: Android DNS - doesn't use nameserver on LAN?

Could you set the router's DNS to point at your internal nameserver.

 

Therefore your Android will request from router, that will in turn ask your nameserver, which will get it's info from your WAN bypassing the router.

If your nameserver is caching, then that will still be faster than Android using the router alone.

 

It may or may not work with your router, but it would work with mine.

7up
Community Veteran
Posts: 15,856
Thanks: 1,603
Fixes: 18
Registered: ‎01-08-2007

Re: Android DNS - doesn't use nameserver on LAN?

We use the hub one which means i can't do that - plusnet lock the thing so you can't change dns.

I need a new signature... i'm bored of the old one!
MJN
Pro
Posts: 1,318
Thanks: 160
Fixes: 5
Registered: ‎26-08-2010

Re: Android DNS - doesn't use nameserver on LAN?

Just to be clear, if you manually configure your Android device to use your local nameserver (not the router) for DNS resolution then that also doesn't work? Or is it only when forcing the configuration via DHCP that you are having problems?

HairyMcbiker
All Star
Posts: 6,792
Thanks: 266
Fixes: 21
Registered: ‎16-02-2009

Re: Android DNS - doesn't use nameserver on LAN?

You could disable the dhcp server on the Hub 1 and use the pi-hole to do both. That MAY fix it.
MJN
Pro
Posts: 1,318
Thanks: 160
Fixes: 5
Registered: ‎26-08-2010

Re: Android DNS - doesn't use nameserver on LAN?

I had assumed that's how it was configured, otherwise having two DHCP servers on the LAN is going to cause issues.

HairyMcbiker
All Star
Posts: 6,792
Thanks: 266
Fixes: 21
Registered: ‎16-02-2009

Re: Android DNS - doesn't use nameserver on LAN?

Just used DNS Changer (non root) from the play store. Changing to my pi-hole server dns let me use http://pi.hole as an address (you have to use http://or google grabs the query) if you don't want to use pi.hole as a dhcp server.
7up
Community Veteran
Posts: 15,856
Thanks: 1,603
Fixes: 18
Registered: ‎01-08-2007

Re: Android DNS - doesn't use nameserver on LAN?


@MJN wrote:

Just to be clear, if you manually configure your Android device to use your local nameserver (not the router) for DNS resolution then that also doesn't work? Or is it only when forcing the configuration via DHCP that you are having problems?


Manual configuration never worked either.

Yes hubone DHCP was turned off during trials.

Will give pi-hole trial a go at some point, be interesting to see if android can see it!

EDIT: Guys you're confusing me lol. Android can see the nameservers, it's just refusing to act on the returned results for whatever reason as i previously stated. I'm going to try the app HMcB has recommended and see if that makes any difference but i have a hunch this is an android glitch or security 'feature'.

I need a new signature... i'm bored of the old one!
7up
Community Veteran
Posts: 15,856
Thanks: 1,603
Fixes: 18
Registered: ‎01-08-2007

Re: Android DNS - doesn't use nameserver on LAN?

Fix

Ok I've got this fixed!!!

My dns server wasn't setting the RClass in the returned resource records. I've updated that and now it sets the results to 1 for IN and everything works on android devices as it should. Android DOES use local nameservers it's just a bit pickier than windows which apparently doesn't worry about the RClass.

Good old wireshark.. 

Sorry that doesn't help you @HairyMcbiker, no idea whats up with pi-hole

I need a new signature... i'm bored of the old one!
MJN
Pro
Posts: 1,318
Thanks: 160
Fixes: 5
Registered: ‎26-08-2010

Re: Android DNS - doesn't use nameserver on LAN?

Is this DNS server one you've written yourself? If so you really ought to have made that clear from the outset!
Anonymous
Not applicable

Re: Android DNS - doesn't use nameserver on LAN?

I had always assumed that this topic was about a self written DNS / DHCP project Huh

MJN
Pro
Posts: 1,318
Thanks: 160
Fixes: 5
Registered: ‎26-08-2010

Re: Android DNS - doesn't use nameserver on LAN?

There's nothing suggesting that in the thread.
Anonymous
Not applicable

Re: Android DNS - doesn't use nameserver on LAN?

That may be so, but this is @7up , and he does have a history of doing such things - which is fine !  Thumbs_Up

MJN
Pro
Posts: 1,318
Thanks: 160
Fixes: 5
Registered: ‎26-08-2010

Re: Android DNS - doesn't use nameserver on LAN?

Ah, okay, I'll bear that in mind in future! 😉