What's new

DHCP handing out router as DNS server no matter what

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

gyzer

Occasional Visitor
[SOLVED] DHCP handing out router as DNS server no matter what

So I've changed DNS under DHCP on my router, rt-n66u, to my linux box running bind, and when my computers renew DHCP, they have both the router and my bind server listed for DNS.

I enabled ssh to look around for dhcp but I was unable to find any config files. I have enabled jffs so I can overwrite the config file I need.

Where is the config file for dhcp? I found dnsmasq.conf and thought that was it because it had an entry that looked like it might be the culprit but it wasn't.

I think I'll be set if I just knew where this damn config file is for dhcp.
 
Last edited:
So I've changed DNS under DHCP on my router, rt-n66u, to my linux box running bind, and when my computers renew DHCP, they have both the router and my bind server listed for DNS.

I enabled ssh to look around for dhcp but I was unable to find any config files. I have enabled jffs so I can overwrite the config file I need.

Where is the config file for dhcp? I found dnsmasq.conf and thought that was it because it had an entry that looked like it might be the culprit but it wasn't.

I think I'll be set if I just knew where this damn config file is for dhcp.
I don't know the answer to your question as it pertains to the N66U DHCP server, but how about letting your linux box perform DHCP duties and kill DHCP on the 66U?
 
So I've changed DNS under DHCP on my router, rt-n66u, to my linux box running bind, and when my computers renew DHCP, they have both the router and my bind server listed for DNS.

I enabled ssh to look around for dhcp but I was unable to find any config files. I have enabled jffs so I can overwrite the config file I need.

Where is the config file for dhcp? I found dnsmasq.conf and thought that was it because it had an entry that looked like it might be the culprit but it wasn't.

I think I'll be set if I just knew where this damn config file is for dhcp.

dnsmasq.conf is the DHCP config file, however it gets regenerated at every reboot, so you'll have to either provide a custom dnsmasq.conf file (see the Github Wiki on how to use custom config files), or configure the webui to push the correct DNS.

Two different methods you could configure this:

1) Have the DNS field kept empty on "LAN -> DHCP" so it will push its own IP to your clients, and on the WAN page set the DNS setting to not automatically connect to your ISP, and there enter the IPs of your own DNS server. In this setup, the router will simply forward DNS requests to your Bind server. This is ideal, because it will allow your router to also resolve hostnames of the DHCP leases it has allocated.

2) Have your server's IP entered on the LAN -> DHCP page, and keep the WAN DNS option set to automatically connect to your ISP. This should have your clients obtain your Bind server's IP for their resolutions.

I haven't tested either as I just use my router as DNS server, but in theory these two should work.
 
I don't know the answer to your question as it pertains to the N66U DHCP server, but how about letting your linux box perform DHCP duties and kill DHCP on the 66U?

I want to use DHCP on the router so I can use the guest wireless when I want to use them.

dnsmasq.conf is the DHCP config file, however it gets regenerated at every reboot, so you'll have to either provide a custom dnsmasq.conf file (see the Github Wiki on how to use custom config files), or configure the webui to push the correct DNS.

I did create a dnsmasq.conf in the /jffs/configs/ directory but even removing the line with the offending DNS ip address the router is still pushing out the wrong ip address for DNS.

1) Have the DNS field kept empty on "LAN -> DHCP" so it will push its own IP to your clients, and on the WAN page set the DNS setting to not automatically connect to your ISP, and there enter the IPs of your own DNS server. In this setup, the router will simply forward DNS requests to your Bind server. This is ideal, because it will allow your router to also resolve hostnames of the DHCP leases it has allocated.

This is a great idea and I think I'm going to try this. If this works it should do what I want it to do.

2) Have your server's IP entered on the LAN -> DHCP page, and keep the WAN DNS option set to automatically connect to your ISP. This should have your clients obtain your Bind server's IP for their resolutions.

This is what I currently have, but for some reason the router is pushing out two DNS server ip addresses, it's self and my bind server's.

Thanks for the help!
 
Let me know if the first solution works out.
 
RMerlin: That worked but still I'm unable to resolve my server's name. I even put my server's name (server) in as a reservation in DHCP on the router and that didn't work.

I honestly have no idea why this is so difficult. Is there anyways to setup DHCP forwarding on the rt-n66u? I had that setup when I was testing out DD-WRT, but the router was never stable under DD-WRT, thats why I'm using Merlin now.
 
Honestly, in the end all I want is to be able to resolve names on my network without issues, and to be able to use the guest networks on my rt-n66u.
 
Well I just fixed it. Overwriting the dnsmasq.conf was the key.

If dhcp-option=lan,6,"dns-ip-address" isn't listed, then the router is used as the DNS server, but if you overwrite the dnsmasq.conf with the dhcp-option=lan,6,"dns-ip-address" then the router will only push out the listed DNS server and it will no longer broadcast it's self as being a dns server.
 

Latest threads

Support Us - Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top