How to change ISP DNS servers to Quad9 in DD-WRT

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
thunderhead
DD-WRT User


Joined: 11 Nov 2017
Posts: 150

PostPosted: Sun Nov 04, 2018 11:33    Post subject: How to change ISP DNS servers to Quad9 in DD-WRT Reply with quote
I am using v3.0-r36070M on my R7000 and would like to change the DNS servers from the ISP defaults to Quad9. I went to Setup>Basic Setup and scrolled down to "Static DNS 1" where I changed the 0.0.0.0 to 9.9.9.9. After applying, I tested with https://www.dnsleaktest.com but found that I was still using the ISP's DNS servers. What am I doing wrong? Thanks.
Sponsor
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6440
Location: UK, London, just across the river..

PostPosted: Sun Nov 04, 2018 13:52    Post subject: Reply with quote
ok follow those rules
add 3 entries to static DNS
9.9.9.9
149.112.112.9
149.112.112.112


than use force DNS redirection on set up page
so no other DNS servers will be permitted only your selected and all the client devices will use only those

then go to services and select
use DNSmasq
Local DNS
No DNS Rebind
Query DNS in Strict Order

copy /paste this to Additional DNSMasq Options

domain-needed
bogus-priv
no-resolv
server=9.9.9.9
no-negcache

if you want you can add 1.1.1.1 or 1.0.0.1 as a spare servers
those also belongs to Quad9 - 149.112.112.9 & 149.112.112.112 as well all those here

https://quad9.com/doh-quad9-dns-servers

there is a trick how to set and use DoH via Firefox as 9.9.9.9 now supports it too

look at my last post
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1145961#1145961

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913


Last edited by Alozaros on Sun Nov 04, 2018 14:45; edited 4 times in total
mrjcd
DD-WRT Guru


Joined: 31 Jan 2015
Posts: 6290
Location: Texas

PostPosted: Sun Nov 04, 2018 14:30    Post subject: Reply with quote
QUAD9 DNS servers that have DNSSEC + other protection --
IPv4 DNS:
9.9.9.9
149.112.112.112

IPv6 DNS:
2620:fe::fe
2620:fe::9

QUAD9 unsecured DNS servers --
IPv4:
9.9.9.10
149.112.112.10

IPv6 DNS:
2620:fe::10
2620:fe::fe:10

https://www.quad9.net/faq/
thunderhead
DD-WRT User


Joined: 11 Nov 2017
Posts: 150

PostPosted: Sun Nov 04, 2018 15:26    Post subject: Reply with quote
Thanks for the replies... for me the solution was based on Alozaros' reply. What I did:

NOTE - bold text indicates a deviation from the default settings I had.
Setup>DHCP section
Quote:

Static DNS 1 = 9.9.9.9
Static DNS 2 = 149.112.112.112
Static DNS 3 = 0.0.0.0


[x] Use DNSMasq for DHCP
[x] Use DNSMasq for DNS
[x] DHCP-Authoritative
[x] Force DNS Redirection



Services>services>DNSMasq section:
Quote:

[x] DNSMasq
[x] Local DNS
[x] No DNS Rebind
[x] Query DNS in strict order


(all other options set to disable)
(Nothing in Additional DNSMasq Options)


Last edited by thunderhead on Wed Nov 14, 2018 21:36; edited 3 times in total
grc
DD-WRT User


Joined: 11 Jul 2018
Posts: 122

PostPosted: Mon Nov 05, 2018 16:48    Post subject: Reply with quote
the only "secure" option is to use
Quote:
no-resolv
server=9.9.9.9
server=149.112.112.112

in Additional DNSMasq Options.

Forced DNS Redirection only forces clients to use DNSMasq on Router for DNS, while DNSMasq use resolv.dnsmasq where the ISP DNS is still present.

It works now because you use strict order.
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2036

PostPosted: Mon Nov 05, 2018 18:43    Post subject: Reply with quote
Does this work the same?

resolv-file=/opt/resolv.dnsmasq

Where resolv.dnsmasq is placed in /opt (on USB) to reduce nvram size. It will have no ISP DNS in it. Or does it continue to use /tmp/resolv.dnsmasq if I havn't added "no-resolv" ?

_________________
Forum Guide Lines (with helpful pointers about how to research your router, where and what firmware to download, where and how to post and many other helpful tips!)
How to get help the right way

Before asking for help - Read the forum guidelines AND Upgrade DD-WRT!
Adblock by eibgrad (1.1M blocked) + Blocklist Collection

grc
DD-WRT User


Joined: 11 Jul 2018
Posts: 122

PostPosted: Mon Nov 05, 2018 21:04    Post subject: Reply with quote
I don't think so. it will probably combine this two files.

From Man page of Dnsmasq:
Quote:
-r, --resolv-file=<file>
Read the IP addresses of the upstream nameservers from <file>, instead of /etc/resolv.conf. For the format of this file see resolv.conf(5). The only lines relevant to dnsmasq are nameserver ones. Dnsmasq can be told to poll more than one resolv.conf file, the first file name specified overrides the default, subsequent ones add to the list. This is only allowed when polling; the file with the currently latest modification time is the one used.
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2036

PostPosted: Mon Nov 05, 2018 21:35    Post subject: Reply with quote
grc wrote:
I don't think so. it will probably combine this two files.


Guess I will delete that then, Thanks for doing my homework for me.

grc wrote:
Forced DNS Redirection only forces clients to use DNSMasq on Router for DNS, while DNSMasq use resolv.dnsmasq where the ISP DNS is still present.

This is great to know,Thanks for increasing my understanding.

_________________
Forum Guide Lines (with helpful pointers about how to research your router, where and what firmware to download, where and how to post and many other helpful tips!)
How to get help the right way

Before asking for help - Read the forum guidelines AND Upgrade DD-WRT!
Adblock by eibgrad (1.1M blocked) + Blocklist Collection

egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Tue Nov 06, 2018 10:14    Post subject: Reply with quote
@grc is absolutely right in his assessment (as far as my knowledge goes Smile )
IF you want to stick to using resolve.dsnmasq (I am doing exactly as @grc use no-resolv, server=xxx, in additional options)you can also try the following to rewrite it, add to Commands/Startup:
Code:
[ "$( nvram get wan_get_dns )" != "" ] &&
nvram unset wan_get_dns &&
nvram unset wan_get_domain &&
nvram commit &&
stopservice dnsmasq &&
startservice dnsmasq


Disclaimer, It is not my code (see below) so I do not vouch for it, but it seems plausible, first try before placing it in startup.

For some reading see: https://svn.dd-wrt.com/ticket/6020

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6440
Location: UK, London, just across the river..

PostPosted: Tue Nov 06, 2018 11:05    Post subject: Reply with quote
you don't need this code it just another messy thing
just use no-resolv, server=xxx its fair enough


the only shait i see is if i use FFx with quad9 via DoH, or my other routers with DNScrypt
it works great and secure using DoH and tls 1.2/1.3 or DNScrypt...
but if i use Chrome it only uses my routers DNS resolver and its settings...but on the low level
units its less secure no DNSSEC validation is performed on router level only on DNS resolver level and Chrome does not provide DoH yet...if Chrome implements DoH than i might get back to it...i also wish at least my TP-Link WR1043ND v2 could support DNSSEC on router level

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum