local DNS fails after a while

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page 1, 2, 3  Next
Author Message
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Mon Jan 07, 2019 20:01    Post subject: local DNS fails after a while Reply with quote
I've been running many test versions by Kong on my R7800 since I bought it in july last year.
Since some time last autumn, local DNS on my laptop repeatedly fails some time after it was observed to function OK. It affects every version I've tried lately.

I use the DIG command in Linux Ubuntu 18.10 to test local DNS, but it is the failure to refresh router and/or local file server GUI pages which alerted me to the problem.

e.g. dig NAS.mylan

A few days ago I found a work-around where I manually disconnect the laptop from WLAN and immediately reconnect. After that DNS works again for some time.
It has been failing just minutes after restoring local DNS with the work-around.


Any ideas what might be behind this annoying problem?

The router and the file server have static addresses, but I rather use their given name.
Sponsor
jerrytouille
DD-WRT Guru


Joined: 11 Dec 2015
Posts: 1304

PostPosted: Mon Jan 07, 2019 21:15    Post subject: Reply with quote
Are you on the latest Kong test build 38150M?
mrjcd
DD-WRT Guru


Joined: 31 Jan 2015
Posts: 6290
Location: Texas

PostPosted: Mon Jan 07, 2019 22:28    Post subject: Reply with quote
On da EA8500 I've had some DNS issues with some recent Kong builds but not with r38065M kongat 12/22/18
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Mon Jan 07, 2019 22:28    Post subject: Reply with quote
I have been on 38150M since it was created.

The local DNS failures have been a problem since many previous versions.

Lately I read that it is best to have the static addresses occupy an IP space separate from the addresses assigned by DHCP.
In my case they're not separated. They never have been and I've been using DD-WRT as long as I can remember.

Use DNSMasq for DHCP: enabled
Use DNSMasq for DNS: enabled

I have these Additional DNSMasq Options:
expand-hosts
domain-needed
bogus-priv
cache-size=1000

Local DNS is enabled


Last edited by ArjenR49 on Mon Jan 07, 2019 22:53; edited 1 time in total
mrjcd
DD-WRT Guru


Joined: 31 Jan 2015
Posts: 6290
Location: Texas

PostPosted: Mon Jan 07, 2019 22:40    Post subject: Reply with quote
ArjenR49 wrote:
Lately I read that it is best to have the static addresses occupy an IP space separate from the addresses assigned by DHCP.
In my case they're not separated. They never have been and I've been using DD-WRT as long as I can remember.

That's what many say but it really makes NOT alot of diiference if everything is set when router is first setup and put in use.
Now if you add a reserved static IP after you been up a while it could be one in use or recently in use if its in the DHCP range.
My DHCP range is 100 ~ 175 so I know for sure none below 100 or over 175 are ever in use.
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Mon Jan 07, 2019 23:05    Post subject: Reply with quote
In Services the static leases are assigned by DHCP as far as I understand it. So, if I would limit DHCP to a space not including the static leases, it might very well fail at some point.
I have the same static leases for a long time and of course, I've rebooted the router many times since filling in the static lease table.
So I did wonder about the sanity of that piece of advice and didn't follow it, since I had no problems.
Except this local DNS failure of late.

Perhaps I've just not been using local DNS so much in the past. I now have a NAS and a Raspberry PI on a static lease and access those very often.
The failure also affects the router itself. And now that I write that, I realize that I've had its IP-address in the bookmarks for a long time for a reason, obviously ... an occasional failure of local DNS ...
And that address isn't even changing, always being at 192.168.x.1. (x for different routers I have in different places)

Probably this problem has been around for longer than I thought at first.
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Mon Jan 07, 2019 23:26    Post subject: Reply with quote
What about client lease time in the static lease table?
I just noticed all lease time values in this new router are blank.
However, on the LAN page, the Client lease time for those leases is markes as Static, so I suppose it's ok to leave the client lease times blank on the Services page.
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 2036

PostPosted: Mon Jan 07, 2019 23:42    Post subject: Reply with quote
I have same router with same build. Local DNS working fine.
Setup>Basic Setup page
Use DNSMasq for DHCP enable
Use DNSMasq for DNS enable
DHCP-Authoritative enable

Services>Services page
Used Domain LAN & WLAN
LAN Domain home (anything you want)

Additional DNSMasq Options
domain=home
local=/home/ (Same as above)
expand-hosts

All my static leases are in the same IP space as addresses assigned by DHCP.
Didn't know I wasn't supposed to until it was already to late.
Lease time is also blank. Equals infinite i read.

Not saying it's all necessary or even right and have been using it for several months.
Probably do not use it as much as you may be.
No Raspberry or NAS on Static.

_________________
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

mrjcd
DD-WRT Guru


Joined: 31 Jan 2015
Posts: 6290
Location: Texas

PostPosted: Mon Jan 07, 2019 23:43    Post subject: Reply with quote
ArjenR49 wrote:
So, if I would limit DHCP to a space not including the static leases, it might very well fail at some point....I did wonder about the sanity...
Really depends on the netmask used on main setup page ----
If router IP is 10.10.10.10 netmask 255.255.255.0 any IP between 10.10.10.1 and 10.10.10.254 is good to use, of course not 10.10.10.10 because that is router IP. I know most use the first IP in the networks range for router IP but that is just a preference not a requirement.
My main router IP has always ended in .13 for 10+ years.

Now if you use a 10.10.10.10 IP & netmask 255.255.254.0 that will also work.
You would have 10.10.10.1 ~ 10.10.11.254 IPs to choose from - the 10.10.10.10 router IP
I used to have my network that way but it can be conflicting if also using OVPN server---- don't want to ever be on network within same IP range when trying to use it's ovpn server and besides the 10.10.10.10 /23 had total 512 host IPs which was ridiculous for home setup anyways.

AFAIK DD-WRT still has a problem with a netmask allowing over 999 IPs. It'll work but static IPs don't work as to be expected Smile

Most folks here could use a 255.255.255.192 and never know the difference. (64 host....62 useable IPs)

ArjenR49 wrote:
What about client lease time in the static lease table?
If leases time is left blank it means 'infinity' (forever)
I use 1440 (1 day) on main router and 720 (1/2 day) for its guest network.
Just what time DHCP lease will renew so if client is no longer there then it just releases some crap within router.
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Tue Jan 08, 2019 9:22    Post subject: Reply with quote
bushant wrote:

Additional DNSMasq Options
domain=home
local=/home/ (Same as above)


All my static leases are in the same IP space as addresses assigned by DHCP.


I had removed those two options at some point thinking it was covered already by used domain and lan domain in the DHCP server. There are so many layers of instructions from different eras that it's hard to see the wood from the trees sometimes.

I'll try with those two added in and keeping the IP space settings as they were:
192.168.x.1 for the router itself
255.255.255.224 mask

start IP: 192.168.x.2
max. DHCP users: 29

(IP space for DHCP: 192.168.x.2-192.168.x.30): That would include all the static leases (which are negotiated by the clients with the router/DHCP, if I understand correctly; none are defined on the client devices themselves),
but it doesn't include the router's IP address ...

Should the start address be 192.168.x.1, perhaps?

I think I tried that a long time ago and it caused problems, as I remember.

BTW: I had the laptop running and connected all night. When I checked local DNS with the dig command again in the morning, at first it worked, but after a little while it failed again.
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 666
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Tue Jan 08, 2019 11:14    Post subject: Reply with quote
bushant wrote:

Additional DNSMasq Options
domain=home
local=/home/ (Same as above)


It looks like those made the difference. No local DNS failures for a while now.
Thanks all!
tatsuya46
DD-WRT Guru


Joined: 03 Jan 2010
Posts: 7568
Location: YWG, Canada

PostPosted: Tue Jan 08, 2019 12:21    Post subject: Reply with quote
ArjenR49 wrote:
I have been on 38150M since it was created.

The local DNS failures have been a problem since many previous versions.

Lately I read that it is best to have the static addresses occupy an IP space separate from the addresses assigned by DHCP.
In my case they're not separated. They never have been and I've been using DD-WRT as long as I can remember.

Use DNSMasq for DHCP: enabled
Use DNSMasq for DNS: enabled

I have these Additional DNSMasq Options:
expand-hosts
domain-needed
bogus-priv
cache-size=1000

Local DNS is enabled


why reduce cache size? iirc default is already a tiny 1500? and remove bogus-priv, its in there already by default, actually i hate that thing and dont know how to remove it (from the default)..

_________________
LATEST FIRMWARE(S)

BrainSlayer wrote:
we just do it since we do not like any restrictions enforced by stupid cocaine snorting managers

[x86_64] Haswell i3-4150/QCA9984/QCA9882 ------> r55797 std
[QUALCOMM] DIR-862L --------------------------------> r55797 std
▲ ACTIVE / INACTIVE ▼
[QUALCOMM] WNDR4300 v1 --------------------------> r50485 std
[BROADCOM] DIR-860L A1 ----------------------------> r50485 std


Sigh.. why do i exist anyway.. | I love you Anthony.. never forget that.. my other 99% that ill never see again..

danielwritesback
DD-WRT User


Joined: 29 Aug 2011
Posts: 240

PostPosted: Tue Jan 08, 2019 14:19    Post subject: lookup lags Reply with quote
The cache number isn't kilobytes, but it is the number of addresses, apparently stored in a flat format not conducive to fast lookups.
The problem is that if the cache size is too big And the cpu happens to be busy, dns lookup is delayed.

From the DNSmasq manual:
"-c, --cache-size=<cachesize>
Set the size of dnsmasq's cache. The default is 150 names. Setting the cache size to zero disables caching. Note: huge cache size impacts performance.
"

Just now, I dreamed up a weird alternative method for setting the cache size. Multiply router's cpu speed in MHz times 1.33. That should scale so that the lookups don't lag. That method is not tested.

Or this shortcut:
New router: 1000
not so new router: 700
Old router: 500
Ancient router: 250

Use of very large cache size, such as 4096, is for special cases when slower lookups is much better than failed dns requests due to UDP connectivity faults, locally such as with Dish internet, irritated cable modem, WDS inappropriately at far-fringe range, or an overloaded remote dns server.
For most of us, the need of an overlarge cache could be removed by use of a 7-day digital lamp timer, situated to give the cable modem and other network parts, a 2 minute 'nap' perhaps 4 am Sunday mornings.
And then,
Ironically, I have a backup battery so that the power doesn't go out and a timer to make it go out on purpose.
YAY!
Is it too late to put in a request for DNS over TCP?

P.S.
A related variable is min-cache-ttl=3600 (it is valid at 3600 or Less). That would force the DNS cache to retain addresses for at least an hour. It doesn't restrict the maximum.

_________________
R6250 with fan on; wifi off
R6300.1 mips DD-WRT 42617 Giga AP
WNR3500Lv2 DD-WRT 33525 K3 Giga
E3000 5ghz multicast AP DD-WRT 33525 K2.6
WRT54GSv2 long range AP HyperWRT 15
2 WR841Nv9 DD-WRT 33006 AP
mrjcd
DD-WRT Guru


Joined: 31 Jan 2015
Posts: 6290
Location: Texas

PostPosted: Tue Jan 08, 2019 14:31    Post subject: Reply with quote
On EA8500 for years all I have in 'Additional DNSMasq Options'
interface=tun2
cache-size=2048

1st line is only so connected to its ovpn server I can still have local DNS
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Tue Jan 08, 2019 15:46    Post subject: Reply with quote
mrjcd wrote:
On EA8500 for years all I have in 'Additional DNSMasq Options'
interface=tun2
cache-size=2048

1st line is only so connected to its ovpn server I can still have local DNS


I'm using an openvpn client connection and forcing openvpn Local devices on Interface br3 to local DNS with interface=br3.

I have never heard of the need to use a Public Interface with DNSMasq. Is that even safe for DNSMasq which is a local DNS service?

_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
Goto page 1, 2, 3  Next Display posts from previous:    Page 1 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC 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 cannot attach files in this forum
You cannot download files in this forum