DHCP serving wrong DNS servers

If your problem doesn't fall into one of the other categories, report it here.

Moderator: Moderators

stevekdavis
Posts: 1
Joined: Thu Apr 12, 2012 3:27 pm

DHCP serving wrong DNS servers

Post by stevekdavis »

Hi, I'm using v1.5.4 Gargoyle on a Netgear WNDR3700v2. All installed fine.

I've set 3 custom DNS servers, one is an internal Windows server that runs internal DNS for MS Active Directory and I want this to be served via DHCP as DNS server 1 with the two OpenDNS servers as 2 and 3.

However having set these and ticked the box to force clients to use router DNS I still find all DHCP clients only ever get server the router address as the DNS server. When running an NSLOOKUP against the router it will not resolve any internal addresses.

No matter what I set, DHCP only serves the router address as the only DNS server.

Is there any way of resolving this?

Steve

mix
Posts: 292
Joined: Sun Feb 27, 2011 11:18 am

Re: DHCP serving wrong DNS servers

Post by mix »

dnsmasq should be using the DNS servers you specify to resolv queries. You can verify this if you ssh into your router, and view the contents of /tmp/resolv.conf.auto

Now, if you specify three different dns servers, and only one of those dns servers knows how to resolv your custom internal dns queries, what do you think the problem is? You need to only specify the one dns server (your windows one), since dnsmasq could potentially use any of the three it wants (two of which that don't know about your internal names).

What you can do though is set your windows dns to use the opendns servers to resolv queries it doesn't have dns records for (which is basically everything other than your internal ones). This should fix your problem.

Otherwise you can take a look at /etc/config/dhcp and configure it however you want.
WRT54GL v1.1
Gargoyle 1.4.7

User avatar
ballistyx
Posts: 11
Joined: Sat Apr 14, 2012 2:45 am

Re: DHCP serving wrong DNS servers

Post by ballistyx »

I think my problem is somewhat relevant to this topic.
I also can't get the DHCP (WR841N v7.2, 1.5.4) to supply the desired DNS servers.
I have them added as custom servers in basic.sh, /tmp/resolv.conf.auto says they are there, but a wireless connection still gets given only the router IP as DNS (and gateway, when it needs to be the satellite modem's IP)
It's fine if I manually set the DNS & gateway in TCP/IP, but that sort of defeats the purpose of DHCP :)

Thought I could get around it by using the modem as the DHCP server, but while that supplies the correct gateway & DNS, it refuses to stick to my reserved IPs when allocating.

Should I try an earlier (and more tested) version of Gargoyle? Or is there something I am overlooking in my setup. Set custom DNS servers - check. Force client to use router DNS - check.
Also, can I force DHCP to supply a different gateway than the router's own IP?

mix
Posts: 292
Joined: Sun Feb 27, 2011 11:18 am

Re: DHCP serving wrong DNS servers

Post by mix »

Right. This is the expected behavior. dnsmasq is a dns forwarder. It will forward your requests to whatever dns servers you specify, and it will actually cache some of the data to speed up dns resolution (I think by default it only caches 150 or so ptr records). So for example, if a couple of different users want to visit http://www.google.com, and another computer already visited it recently, you avoid a dns lookup across the internet. If you don't want to use dnsmasq, and the only good reason I can think of not to use it is if you are running a local dns server yourself, you need to disable it and specify the needed options in the dhcp config... which might be easier said than done since I believe dnsmasq is also used as the dhcp server. This functionality isn't supported from the web interface obviously.
WRT54GL v1.1
Gargoyle 1.4.7

User avatar
ballistyx
Posts: 11
Joined: Sat Apr 14, 2012 2:45 am

Re: DHCP serving wrong DNS servers

Post by ballistyx »

mix wrote:This is the expected behavior.
and that would be fine if it worked. Without setting my DNS servers manually, my browser tells me DNS lookup failed.
I also have to manually set the default gateway to the modem's IP. If I leave it to Gargoyle, it uses it's own IP and I lose internet again.
I'm hesitant to play with the internet/WAN settings in basic.sh as the last time I did that I got locked out!
At the moment (as shown) I have that set to DHCP(wired) which isn't strictly accurate as the DHCP on the modem is off (I shouldn't have 2xDHCP on should I?).
basic.gif
basic.gif (13.42 KiB) Viewed 12200 times
network.gif
network.gif (15.54 KiB) Viewed 12200 times
now I'm off to trawl to forums for answers to my other problems! i.e. quotas not working. Problem is, I had all sorts of trouble finding anything on my DNS question as searching for DNS returns no results, being too short or too common a term. Hope I have better luck with quotas!

mix
Posts: 292
Joined: Sun Feb 27, 2011 11:18 am

Re: DHCP serving wrong DNS servers

Post by mix »

DHCP on modem? What do you mean set default gateway to your modems ip? What modem has an ip address that a customer with his own router would care about? If your modem has a router built in, it should be bridged, otherwise you are probably going to end up with double nat. Your modem should act as a plain dumb modem. It is nothing but a bridge from your network to your isp's network. On your isp's network, there is a dhcp server that will give your router an ip address.
WRT54GL v1.1
Gargoyle 1.4.7

User avatar
ballistyx
Posts: 11
Joined: Sat Apr 14, 2012 2:45 am

Re: DHCP serving wrong DNS servers

Post by ballistyx »

All I know is that if I don't have the gateway (in TCP/IP) set to the modem's IP (192.168.5.100) the internet doesn't work. Maybe it has something to do with the fact that it's not your generic consumer modem, being of a proprietary type for a satellite connection.
It has a fixed ethernet IP, and I honestly have no idea if the IP from my ISP is fixed or dynamic.
I don't see anything in the modem's config that suggests bridging is an option, and I'm not even sure the ISP wants me messing about with the settings as I was never given a password. I only have access to the DHCP page because I found a default password online. There's a lot of stuff in there that I wouldn't dream of tampering with though! :) (see below)
modem.gif
modem.gif (24.53 KiB) Viewed 12196 times
I'm sure I'm being a hassle as I obviously don't know enough to do all this, but setting up my initial network was easy enough (incl a 200m wireless bridge) and I thought I would be able to manage this!
It could be that I'm actually doing everything right, but because v7.2 of this router is not specifically supported, it's just not going to work properly :? I dunno . . .

mix
Posts: 292
Joined: Sun Feb 27, 2011 11:18 am

Re: DHCP serving wrong DNS servers

Post by mix »

You've pretty much just been wasting your time since your satellite modem has a nat router built into it. You need to figure out how to disable this functionality. If you post the name and model of the modem, my guess is that I can google and find someone who has already done it...
WRT54GL v1.1
Gargoyle 1.4.7

User avatar
ballistyx
Posts: 11
Joined: Sat Apr 14, 2012 2:45 am

Re: DHCP serving wrong DNS servers

Post by ballistyx »

Cheers Mix :)
As I said, I was hesitant to play around with the delicate workings of the modem, but I do see a radio box to enable/disable the NAT there (above).
So if I disable that, it might help?
FYI, it's an IPStar terminal, ICON Series IPX-3200.

mix
Posts: 292
Joined: Sun Feb 27, 2011 11:18 am

Re: DHCP serving wrong DNS servers

Post by mix »

You are probably out of luck unless your isp has assigned you an ip block, not just a single ip address.

http://forums.whirlpool.net.au/archive/1013461

In any case, your problem is so far out of the relm of anything to do with Gargoyle, I think this thread is about done.
WRT54GL v1.1
Gargoyle 1.4.7

Post Reply