Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a DD-WRT router set up with DNSMasq to resolve certain domains to internal addresses and pass everything else thru. The router itself is configured to use Google's public DNS servers to resolve addresses..

My Setup screen looks like this:

DDWRT Setup Screen

My problem is that when a DHCP client connects, they get the router plus google's two DNS servers as the assigned DNS servers:

DNS servers assigned by DHCP

This is a problem because sometimes wireless clients try to resolve a domain that is supposed to point to an internal IP address and end up getting an external ip instead because for whatever reason their request is sent to 8.8.8.8 instead of to the router.

I don't want the router to serve anything but its own IP as the DNS server. Is that possible?

I'm using: Firmware: DD-WRT v24SP2-MULTI (03/21/11) std

share|improve this question
1  
I may be mistaken, but since that is the DHCP server configuration section you are explicitly telling your router to provide those google servers as dns options for clients. You want to remove those from the list, and then configure the router to get its own dns from google, perhaps the answer below is the proper way to do this. –  horatio Jan 24 '12 at 15:47
    
If I remove those, the router will provide the servers that it got from the ISP via DHCP.. –  thatjuan Jan 29 '12 at 17:30
    
You say "for whatever reason" sevral times in your post and comments. THIS is the reason that 8.8.8.8 is passed to the clients. Because you told it to. If you don't want that reported, you need to remove it. If your router is a dns server, then try your router's address ONLY. –  horatio Jan 31 '12 at 14:58
    
@horatio, not really.. My point is why is the dhcp server giving out any additional DNS addresses at all. If dnsmasq on the device and applying certain name resolution rules, serving additional DNS servers (besides the router itself) defeats that purpose. –  thatjuan Feb 1 '12 at 4:46
    
That section is a list of DNS servers to be given out to clients which request DHCP information. –  horatio Feb 1 '12 at 15:09
show 3 more comments

5 Answers

up vote 2 down vote accepted

From http://www.dd-wrt.com/wiki/index.php/OpenDNS

It appears you can set the remaining dns servers to non-routable IPs (in my case 10.0.0.0 & 10.0.0.1) and it will squeeze out your ISPs DNS servers with these non-routables. So far for me it seems to be working without any delay waiting on the non-existent dns servers.

share|improve this answer
add comment

If you do not want clients to reach external DNS do not put their addresses in your DHCP server config.

I suppose you wanted to add (eventually faster) google's DNS servers in a configuration of external DHCP Client (where DNSMASQ would take it's DNS client preferences)

Extra:

You have to add extra (all) DNS servers to WAN link configuration. DNSMasq will use them and never ones DHCP client would acquire from provider.

share|improve this answer
    
thanks for your contribution, but that doesn't make much sense in the context of the question. DNSMasq works by forwarding dns requests from clients to real DNS servers with the ability to modify some responses on the fly. If I removed the dns servers from the config, the router just reverts to the ISP-assigned servers. You're answering my question by saying "fix your configuration" but the question itself is "how to fix the configuration". –  thatjuan Jan 27 '12 at 15:03
add comment

I've been having a similar problem after my router died and I've needed to get a flashed WRT160N running.

I have a box functioning as a local DNS server on 192.168.2.30 in my network. I basically want DHCP to only give out that address as a DNS server; I don't want DNS going anywhere else.

I'm using "Firmware: DD-WRT v24-sp2 (12/19/10) mini"

Doesn't seem to matter what combination of DNSMasq settings, DHCP settings, Local DNS, or whatever I use. If DNS Server 2 and DNS Server 3 are blank or match DNS Server 1, DD-WRT insists on handing out Comcast's DNS servers for those spots. I don't want this as I have 192.168.2.30 forwarding to OpenDNS for queries that aren't local.

I'm writing this off as a bug in this rather old (by now) version of DD-WRT and am going to be installling/configuring my own DHCP server on 192.168.2.30 and disabling DHCP on the router.

share|improve this answer
    
that's actually not a bad idea... I might just set up dhcp on another box and quit screwing around with ddwrt. –  thatjuan May 28 '12 at 15:16
add comment

I am not using DDWRT, so this is half-question / half-answer.

The manual DNSMasq as DHCP server says in the section "Extra DNSMasq options" :

There are some extra options in the web interface for DNSMasq that you can set by entering them in Additional DNSMasq Options on the "Services" tab.

If you wish to pass through the DNS servers from your ISP, you can use the following parameters:

dhcp-option=6, x.x.x.x, y.y.y.y

where x.x.x.x = DNS1 y.y.y.y = DNS2

This seems to mean that passing the ISP servers is optional, so locating and deleting the above line should turn it off.

share|improve this answer
    
I would set dhcp-option=6,192.168.10.10 to pass that IP address as DNS server IP to DHCP clients. –  thane Jan 25 '12 at 7:25
    
Thanks for the pointer. I tried that on both uDHCPd (which is the DNS daemon I was using on ddwrt) and DNSMasq (switched to it) but to no avail :(. It keeps serving the additional dns records for whatever reason. –  thatjuan Jan 25 '12 at 16:24
    
In that case you should maybe post the question on the DD-WRT forums. –  harrymc Jan 25 '12 at 18:38
add comment

A typical configuration option for DD-WRT is to allow the router to route DNS outside of the ISP's primary DNS servers; which you have succesfully done; however, since the requests are generating from the CLIENT machine, connecting TOO the router, the order of preference is always given to the configured DNS on the client's machine, and then to the router.

What you are describing happening is that the client is associating with your router, which is correct, but their DNS shows your router IP + 2 other DNS settings. Please check the client computer, and make sure that their IPV4 settings are set to dynamically pull the DNS server configuration from the connection, and not manually configure it:

Configuring Client

Then, make sure you have your DD-WRT router setup properly:

Configure Router

In your configuration above, you also have some issues; you have set the DHCP address range to start at 200 and end at 255; I would recommend you change that to start at 200 and end at 254; leaving the 255 address off, given that for normal configurations *.*.*.255 is a broadcast address, and not a normal IP address to use to assign to the associated client.

I highlighted the local DNS settings because you set yours to 127.0.0.1; which means you are running a local DNS server on the router. If this isn't the case, then change it to 0.0.0.0, or a proper address to a local DNS server on your network.

You'll notice that when the server & client are configured in this manner, only the routers DNS IP address will appear; and all requests will be routed through the DNS servers associated w/ the router.

Note on local DNS server If you wish the router to associate certain local address to local IP's you can add those to the DNSMasq configuration options in the proper DD-WRT screen, or use a local DNS server, and put in a proper IP address for that server (usually a static server, within the scope of the network). This way, the order of resolution will be the local server first, then the 2 external. But, still only the clients will see the router IP as the DNS server.

share|improve this answer
    
thanks for your answer!, I've made sure all of the clients on the network don't have DNS servers hard coded. In fact, in every case 192.168.10.10 (the router itself) comes back as the first DNS server to hit. What happens is that some computers randomly hit the secondary DNS servers that DHCP is currently providing.. I've tried a million things and it just looks like there's no way to have it only serve itself. I might end up running some other dnsmasq instances on a different machine and use it as dns2 and dns3.. such a hack! lol. thx again. –  thatjuan Feb 1 '12 at 4:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.