Posted: Fri Sep 23, 2016 13:07 Post subject: [SOLVED] Different local DNS server, not the router!
Hi,
I have searched the forums without luck so i'm trying my luck here.
I have a DIR825 rev B router and i have a DNS server configured in my network that can handle all request and if not found forward it to external server, for example google.
Now i'm trying to configure this in my router that is running build DD-WRT v3.0-r30631 std (09/14/16)
So i configured it on several places just to be sure it would push this to all clients connected to my router wired or wireless without luck, it keeps returning the previous external ones (8.8.8.8, 8.8.4.4)
My configuration is like this:
Under Setup / Basic Setup:
Router IP:
Local IP: 192.168.1.1
Subnet Mask: 255.255.255.0
Gateway: 192.168.1.1
Local DNS: 192.168.1.1 <-- this i changed to the IP of the actual DNS server i would like to use 192.168.1.100
Network Address Server Settings (DHCP):
DHCP Type: Server
DHCP Server: Enabled
Static DNS 1: 8.8.8.8 <-- this i changed to the IP of the actual DNS server i would like to use 192.168.1.100 and removed the second one
Static DNS 1: 8.8.4.4
Use DNSMasq for DHCP: Enabled
Use DNSMasq for DNS: Enabled <-- If i'm correct when this is enabled it is of no use to configure the previously static DNS servers?
DHCP-Authoritative: Enabled
Forced DNS Redirection: Disabled
Under Services / Services:
DNSMasq: Enabled
Local DNS: Disabled <-- Wasn't sure if i needed to enable or disable this? I thought it would use the configured Local DNS IP given in Basic Setup under Router IP
No DNS Rebind: Enabled
Query DNS in Strict Order: Enabled
Add Requestor MAC to DNS Query: Disabled
Additional DNSMasq Options
dhcp-option=6,8.8.8.8,8.8.4.4 <-- Can not recall why i have configured this but i think it was for the HE IP6to4 tunnel, anyway i removed that when i configured my local DNS server with IP 192.168.1.100
What i would like to accomplish is that all clients connected to my router , wired or wireless will be using the DNS server that is available in my own network. But everytime i do some changes to DDWRT config and reboot router, do a ipconfig /renew or release on clients or reboot them also it still gives me the wrong DNS server.
Or it is 8.8.8.8 and 8.8.4.4 or it's given 192.168.1.1 (the router gateway IP) as DNS server(s)
I was hoping someone here could give me some tips/tricks on how to accomplish what i want?
Last edited by bl@d3runn3r on Mon Sep 26, 2016 7:39; edited 1 time in total
192.168.1.100 is doing local DNS but it's not the gateway to internet?
I really haven't done a conf exactly like that in ages but -
Try (on your 192.168.1.1) router main setup page
leave local DNS 0.0.0.0
set dns1 192.168.1.100
set dns2 8.8.8.8
set dns3 8.8.4.4
Forced DNS Redirection: Enabled
leave everything else as you have shown
also some new buggy stuff in GUI settings with some routers
I would telnet or ssh in --
cat /tmp/resolv.conf (see what nameserver says)
and/or look at
cat /tmp/resolv.dnsmasq
--
EDIT:
just thinking if the 192.168.100 router is already conf with good DNS servers and it's always
available then in might be better to leave -
set dns2 0.0.0.0
set dns3 0.0.0.0
or put in dummy IP that won't go anywhere
I have a raspberry pi running pi.hole adblocker as my DNS server, and this config works for all connected DHCP clients wired and wireless
DNS 1 = Raspberry Pi
DNS 2 and 3 are non existent IPs to ensure it either uses the Pi, or doesn't work at all, setting them all to the same IP forces ISP DNS to take control of 2&3 instead)
Thanks both for the input.
I'm also running a pi hole adblocker variant on my Synology
I'm using DNSMasq for DNS, no idea why I configured it but i have disabled it now and only configured my local DNS server, now lets see what happens with my VPN setup and 6to4 tunnel.
Otherwise i should change this line in Additional DNSMasq Options from: dhcp-option=6,8.8.8.8,8.8.4.4 to dhcp-option=6,192.168.1.100 (if i'm correct)
Configuring static DNS servers doesn't work when DNSmasq is enabled for DNS, am i right?
/edit:
For some reason my laptop still uses googles dns servers. Need to do some digging in conf i guess.
I did execute your commands given and this is the output:
root@DIR825:~# cat /tmp/resolv.conf
search dynamic.ziggo.nl
nameserver 192.168.1.1
root@DIR825:~# cat /tmp/resolv.dnsmasq
nameserver 192.168.1.1
nameserver 192.168.1.125
nameserver 89.101.251.229
root@DIR825:~#
Seems legit but why does Win7 still saying 8.8.8.8 as server?
Posted: Mon Sep 26, 2016 5:59 Post subject: Re: Different local DNS server, not the router!
Hi @bl@d3runn3r,
From what I understand, you are trying to have your DHCP clients use a *different* DNS server than the router itself.
Usually in typical setups, the router itself is also the DNS server (which forwards dns queries upstream to the configured ISP/Google (etc) public DNS servers).
If you want to override this and have something like this:
a) router is 192.168.1.1 (and has everything configured as usual for DNS etc. from settings based on your ISP/Google).
b) separate super-dns-server is 192.168.1.101 (example).
c) All DHCP clients should use DNS server as 192.168.1.101 instead of 192.168.1.1 (or public DNSs).
Here's what you need to do:
1. Enable dnsmasq (etc.)
2. As a backup, ensure that the router is setup correctly for DNS via ISP and/or Google (etc.) - this way if you use 192.168.1.1 as the DNS everything works correctly at a minimum.
3. Enable the advanced dnsmasq configuration options and add:
--dhcp-option=6,192.168.1.101
What this does is setups dnsmasq to advertise the DNS Server to your LAN as 192.168.1.101.
There are lots of other configurations also possible (like changing router etc.)
By the way local DNS + DNSMasq only works if you have disabled "No DNS Rebind", otherwise DNSMasq will reject the local DNS as this is a security feature to prevent from certain attacks. _________________ KONG PB's: http://www.desipro.de/ddwrt/
KONG Info: http://tips.desipro.de/
I think in my previous attempts i enabled/disabled to much i guess to get this working.
The last comment from @<Kong> was that little push i think to get things working as wanted
just wanted to say thank you for this post. Have been playing with quite a few settings to have my router give my clients a different dns server. The info in this post worked for me too
Posted: Wed Mar 28, 2018 4:09 Post subject: Just to reiterate...
Thanks for the advice! To illustrate what worked for me, based on your suggestions, here are 2 screenshots. I am running Firmware: DD-WRT v3.0-r35531 std (03/26/18 ) on a Linkysy WRT 1200ac v2.
The thread is 6-7 years old and outdated and there is a lot of nonsense here.
If you want the configured static DNS server to be sent to the clients via DHCP instead of the IP address of the router, then it is also sufficient to deactivate "use dnsmasq for DNS".
You don't need any "additional dnsmasq configurations" for this at all.