[SPLIT] DHCP static leases.

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
Duxa
DD-WRT User


Joined: 16 Aug 2013
Posts: 191

PostPosted: Thu Jun 09, 2022 17:46    Post subject: Reply with quote
egc wrote:
Although the static leases GUI has been improved tremendously thanks to the-joker, many of us just add the static leases to the DNSMasq additional options e.g.:
Code:
dhcp-host=00:1B:A9:D5:AA:C3,192.168.0.99,Printer_HL2150,1440m

Especially if you have a lot of static leases it is just easier to save and restore them after a reset and you can save them to a spreadsheet and sort them like you want and copy them back.

You should be able to grab the current static leases you have already set with:
cat /tmp/dnsmasq.conf | grep dhcp-host

Problem solved Smile


Yeah its a decent workaround, but I prefer to keep stuff in a table rather than a text field. (although as you said restoring with text field is 1000 times easier).

I have a pihole server, so tend not to use dnsmasq on router.

Is there a way to push dnsmasq list to the static routes table?
Sponsor
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Thu Jun 09, 2022 17:51    Post subject: Reply with quote
so either you use dnsmasq as DHCP server or not

if you would not use dnsmasq at all then also the static leases in WebIF would be without function because they are handled by dnsmasq as DHCP server

and the pi-hole mostly acts only as a DNS server

just look in the /tmp/dnsmasq.conf there are your static lease assignments from the WebIF listed anyway
Duxa
DD-WRT User


Joined: 16 Aug 2013
Posts: 191

PostPosted: Thu Jun 09, 2022 17:54    Post subject: Reply with quote
ho1Aetoo wrote:
so either you use dnsmasq as DHCP server or not

if you would not use dnsmasq at all then also the static leases in WebIF would be without function because they are handled by dnsmasq as DHCP server

and the pi-hole mostly acts only as a DNS server


Well, the config I desire is pihole being DNS (no DHCP) and router is DHCP.

dnsmasq will do DNS caching right? I dont want router to do any DNS (forward it all to pihole).

So thats my issue.

I have "Use dnsmasq for DNS" unchecked in ddwrt.
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Thu Jun 09, 2022 18:02    Post subject: Reply with quote
dnsmasq is both dns forwarder and DHCP server
but you don't have to use it as both
you can also use dnsmasq as a pure DHCP server
dnsmasq provides the DHCP IPv4 server functionality under dd-wrt

and regarding the Pi-Hole you can also read the following link, there on the dd-wrt router dnsmasq is used as DHCP server and depending on that the Pi-Hole as DNS forwarder.

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=331414

Also the Pi-Hole itself uses dnsmasq
Uses an integrated dnsmasq fork called FTL

see > https://github.com/pi-hole/FTL/releases
Duxa
DD-WRT User


Joined: 16 Aug 2013
Posts: 191

PostPosted: Thu Jun 09, 2022 18:13    Post subject: Reply with quote
ho1Aetoo wrote:
dnsmasq is both dns forwarder and DHCP server
but you don't have to use it as both
you can also use dnsmasq as a pure DHCP server
dnsmasq provides the DHCP IPv4 server functionality under dd-wrt

and regarding the Pi-Hole you can also read the following link, there on the dd-wrt router dnsmasq is used as DHCP server and depending on that the Pi-Hole as DNS forwarder.

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=331414

Also the Pi-Hole itself uses dnsmasq
Uses an integrated dnsmasq fork called FTL

see > https://github.com/pi-hole/FTL/releases


nice post. I have it set up as in your example #1. I do desire fallback DNS, but its my understanding you cant set it up to use fallback only if pihole is down? Clients will randomly choose one of the available DNS servers. My desired behavior would be use pihole 100% of the time, unless no response, then use fallback DNS. Maybe things have changed but when I did my research on the topic this wasnt possible.

mod edit, split topic cleanup
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Thu Jun 09, 2022 18:23    Post subject: Reply with quote
@the-joker

If you would be nice then you could just split the off-topic posts into a separate thread so the rest of us can keep talking.

@Duxa

Well, in example 1+2 you can also configure a DNS fallback
server (just configure it as static DNS2) but this is only recommended if the fallback server is also a Pi-Hole otherwise this can lead to DNS leaks.
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Thu Jun 09, 2022 18:23    Post subject: Reply with quote
Splitting threads is easy, consider it done, in 3, 2 ,1...

Done... let me know any suggestions to topic title or anything that may help better.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)


Last edited by the-joker on Thu Jun 09, 2022 18:29; edited 1 time in total
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Thu Jun 09, 2022 18:28    Post subject: Reply with quote
thank you very much Smile
Duxa
DD-WRT User


Joined: 16 Aug 2013
Posts: 191

PostPosted: Thu Jun 09, 2022 18:32    Post subject: Reply with quote
ho1Aetoo wrote:
@the-joker

If you would be nice then you could just split the off-topic posts into a separate thread so the rest of us can keep talking.

@Duxa

Well, in example 1+2 you can also configure a DNS fallback
server (just configure it as static DNS2) but this is only recommended if the fallback server is also a Pi-Hole otherwise this can lead to DNS leaks.


Fallback DNS is not important enough for me to set up another piece of hardware (its been solid for years). In ideal situation id like to use pihole as DNS 100% of the time. Then if its down use 8.8.8.8 or 1.1.1.1 or something like that.

So I guess Ill just keep setup as is for now.
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Thu Jun 09, 2022 18:54    Post subject: Reply with quote
Plenty threads on doing PIHole setups 100% all, success stories.
_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
Duxa
DD-WRT User


Joined: 16 Aug 2013
Posts: 191

PostPosted: Thu Jun 09, 2022 19:07    Post subject: Reply with quote
the-joker wrote:
Plenty threads on doing PIHole setups 100% all, success stories.


I dont need help setting up pihole, Ive had one running for years. I was just confirming that you cant really do a pihole 100% DNS with fallback being google or OpenDNS or something.
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2927
Location: Germany

PostPosted: Thu Jun 09, 2022 19:25    Post subject: Reply with quote
Well if you use the setup example 1 then all DNS servers configured as "static DNS 1-3" will be sent directly via DHCP to the client.
The client then decides itself which DNS it uses.
Often this happens in the round robin procedure, so the client queries any configured DNS server Wink

In example 2 the DNS servers are queried in "strict order" but this does not protect 100% from DNS leaks, in case of a timeout or a NXDOMAIN it is possible that the 2nd DNS server is queried.

If you want gapfree DNS blocking then you have to use (unfortunately) a 2nd Pi-Hole as fallback - or you use a filtered DNS provider.
Alozaros
DD-WRT Guru


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

PostPosted: Fri Jun 10, 2022 7:44    Post subject: Reply with quote
just to add that, you either use filtered DNS providers or not, as it's get messy...if you have a mix of them both...
i use 9.9.9.9 as well Next DNS and some others all with malware filtering and ad blocking...

i also stay away form google 8.8.8.8 or 1.1.1.1..

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 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 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 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 Fri Jun 10, 2022 12:38; edited 1 time in total
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Fri Jun 10, 2022 8:12    Post subject: Reply with quote
I would suggest that DNS 1 and DNS 2 fields are populated with different DNS IP's, only one doesnt work proeprly sometimes and its always good to have fallbacks, I dont recommend Google and friends DNS anything, unless you like to have your traffic being fed into their AI for training and god/dog knows what.

Screenshots always to assuage the crowds looking to help.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions 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