What's new

[384.12_Alpha - builds] Testing all variants.

  • 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!

Status
Not open for further replies.
That means if dns_local_cache is present, the dns_local can be ignored. No need to check firmware version. Or would one have to check for @john9527 s fork that may have a differing nvram parameter?
I was pondering the same thing. If nvram get dns_local returns null, then check for dns_local_cache and set to 1.

I found this method to compare integer values. Requires the entware package bc though:
Code:
#!/bin/sh
buildno=$(nvram get buildno)
testbuildno=384.11

ifbc () { test $(echo "$@" | bc -l ) -ne 0; }

ifbc "$testbuildno > $buildno" && echo "true, it's greater" || echo "no, it's less or ="
Or, strip off the numbers after the decimal and use -ge operators to compare firmware version.
 
I was pondering the same thing. If nvram get dns_local returns null, then check for dns_local_cache and set to 1.

I found this method to compare integer values. Requires the entware package bc though:
Code:
#!/bin/sh
buildno=$(nvram get buildno)
testbuildno=384.11

ifbc () { test $(echo "$@" | bc -l ) -ne 0; }

ifbc "$testbuildno > $buildno" && echo "true, it's greater" || echo "no, it's less or ="
Or, strip off the numbers after the decimal and use -ge operators to compare firmware version.

Wouldn't the easier solution be using an if-statement?

Code:
if [ -n "$(nvram get dns_local_cache)" ] && [ "$(nvram get dns_local_cache)" != "1" ]; then
    nvram set dns_local_cache="1"
elif [ "$(nvram get dns_local)" != "1" ]; then
    nvram set dns_local="1"
fi
 
Wouldn't the easier solution be using an if-statement?

Code:
if [ -n "$(nvram get dns_local_cache)" ] && [ "$(nvram get dns_local_cache)" != "1" ]; then
    nvram set dns_local_cache="1"
elif [ "$(nvram get dns_local)" != "1" ]; then
    nvram set dns_local="1"
fi
Thanks @Adamm, yes, that is much easier. Plus, no dependency on an entware utility. :)
 
You can compare the version completely in shell.
Code:
VERSION="$(nvram get buildno)"
if [ "${VERSION%.*}" -ge 384 ] && [ "${VERSION#*.}" -ge 12 ]; then
    nvram set dns_local_cache=1
else
    nvram set dns_local=1
fi
 
Thanks @Adamm, yes, that is much easier. Plus, no dependency on an entware utility. :)
Plus, johns LTS has none of these in nvram.
Wouldn't the easier solution be using an if-statement?

Code:
if [ -n "$(nvram get dns_local_cache)" ] && [ "$(nvram get dns_local_cache)" != "1" ]; then
    nvram set dns_local_cache="1"
elif [ "$(nvram get dns_local)" != "1" ]; then
    nvram set dns_local="1"
fi
That would set dns_local=1 in johns.
Another test and all is well in cache land:
Code:
if [ -n "$(nvram get dns_local_cache)" ] && [ "$(nvram get dns_local_cache)" != "1" ]; then
    nvram set dns_local_cache="1"
elif [ -n "$(nvram get dns_local)" ] && [ "$(nvram get dns_local)" != "1" ]; then
    nvram set dns_local="1"
fi
 
What about 385.00 up to .11 :D?
Yea that's true, lazy logic on my part. This should work right?
Code:
VERSION="$(nvram get buildno)"
VERSION="${VERSION%_*}"
if [ $((${VERSION%.*} * 100 + ${VERSION#*.})) -ge 38412 ]; then
    nvram set dns_local_cache=1
else
    nvram set dns_local=1
fi

EDIT: Mmm not quite, some builds have revisions, fixed hopefully.
EDIT2: <10 isn't padded. ok one more
 
Yea that's true, lazy logic on my part. This should work right?
Code:
VERSION="$(nvram get buildno)"
VERSION="${VERSION%_*}"
if [ $((${VERSION%.*} * 100 + ${VERSION#*.})) -ge 38412 ]; then
    nvram set dns_local_cache=1
else
    nvram set dns_local=1
fi

EDIT: Mmm not quite, some builds have revisions, fixed hopefully.
EDIT2: <10 isn't padded. ok one more
My updated code does not rely on version numbers and works...
 
Plus, johns LTS has none of these in nvram.

That would set dns_local=1 in johns.
Another test and all is well in cache land:
Code:
if [ -n "$(nvram get dns_local_cache)" ] && [ "$(nvram get dns_local_cache)" != "1" ]; then
    nvram set dns_local_cache="1"
elif [ -n "$(nvram get dns_local)" ] && [ "$(nvram get dns_local)" != "1" ]; then
    nvram set dns_local="1"
fi
I've been testing the past 30 min and also added the -n check for dns_local. Don't forget the nvram commit.
Code:
if [ -n "$(nvram get dns_local_cache)" ] && [ "$(nvram get dns_local_cache)" != "1" ]; then
    nvram set dns_local_cache="1"
    nvram commit
elif [ -n "$(nvram get dns_local)" ] && [ "$(nvram get dns_local)" != "1" ]; then
    nvram set dns_local="1"
    nvram commit
fi
 
I've been testing the past 30 min and also added the -n check for dns_local. Don't forget the nvram commit.
Code:
if [ -n "$(nvram get dns_local_cache)" ] && [ "$(nvram get dns_local_cache)" != "1" ]; then
    nvram set dns_local_cache="1"
    nvram commit
elif [ -n "$(nvram get dns_local)" ] && [ "$(nvram get dns_local)" != "1" ]; then
    nvram set dns_local="1"
    nvram commit
fi
I'll copy paste that right into my blocker script.
 
I'll copy paste that right into my blocker script.
I will also add it the installation script for x3mRouting due to the issues it causes with the loading of IPSET lists if it's set to No.
 
I will also add it the installation script for x3mRouting due to the issues it causes with the loading of IPSET lists if it's set to No.
I actually have not tested if that impacts Diversion. Will see if it makes it into release.
 
Why not check the content of /etc/resolv.conf instead? That would be the only 100% sure way of handling it, and it would work on other forks as well (and even on stock firmware, which will not contain 127.0.0.1).
 
@RMerlin is this commit critical to function?
Code:
Cleanup accidentally committed .orig files
 
I have a question, namely if using HTTPS for Authentication Method, EACH time i reboot router I have to re-accept the Server Certificate as it obviously makes a new one every time...
Is there a method of making the Certificate permanent regardless of reboot (or FW updates)?

Have also tried to see if enabling "Format JFFS partition at next boot" would help solve it, or "Enable JFFS custom scripts and configs" on Yes, but as expected the Certificate does not stick after reboot.
 
Right now, I am using the Cloudflare DNS settings with the 'No' setting and also using the Use local caching DNS Server setting too.

I will change the setting to Connect to DNS Server Automatically to Yes in a few hours (possibly tomorrow sometime) and leave the Use local caching DNS Server set to Yes too and then see if I see a difference. ;)

https://www.snbforums.com/threads/384-12_alpha-builds-testing-all-variants.56639/page-11#post-493386

As an update to my post above, I have now tested all possible scenarios with Connect to DNS Server Automatically (using ISP's or CloudFlare DNS servers) and Use local caching DNS Server (in Other Settings) set either to Yes or No.

By far, on my Fibre 1Gbps up/down symmetrical connection, the best combination is 'No' and using the CloudFlare DNS servers and 'Yes' for Use local caching. The page load times are noticeably faster than any other combination I tried. I feel like I'm 'surfing' the net like a 19-year-old, so fast and limber. :)


DNSFilter.PNG
Wan Use local caching DNS server.PNG

Wan DNS Settings.PNG
 
using the CloudFlare DNS servers and 'Yes' for Use local caching. The page load times are noticeably faster than any other combination I tried.
But of course you do, you CACHE the DNS Lookups on the router for the sites you visit constantly, you do not ask a DNS provider for the resolution (CloudFlare, ISPs or other).

For a test, to see that it will not affect speed, try to go to sites that you open for a first time and thus not cached on the router!
You will see no difference (or it might even be a tad slower) if after you try with the setting on "Yes" for Use local caching...
 
But of course you do, you CACHE the DNS Lookups on the router for the sites you visit constantly, you do not ask a DNS provider for the resolution (CloudFlare, ISPs or other).

For a test, to see that it will not affect speed, try to go to sites that you open for a first time and thus not cached on the router!
You will see no difference (or it might even be a tad slower) if after you try with the setting on "Yes" for Use local caching...

I am not trying to do a scientific test here. I am setting up the router to give me the best results for my usage. ;)

I have also been testing this over the last 18 hours or so. This was not a quick one minute test. :)

While most of my browsing involves most used sites (whose browsing doesn't?), I did make a point to include 'new' sites too.

With new sites and local caching off, the results were equivalent to using my ISP's DNS servers (I was using CloudFlare).

I also rebooted the computers, including clearing the browser cache before and after, that I used and also tested via wireless, wired and cellular connections too (via OpenVPN).

With my ISP and network environment and usage, there is no better combination.

I have already changed a few customers defaults to this and they too see a positive change, overall. :)
 
@L&LD
Yes, as I said it is faster, but the reason to use "No" for Use local caching, is because of possibles issues (and permanent ones for some users) especially with DoT used, as for checking if WAN works or not and for NTP time synchronization.
It newer was an issue if caching on the router would be faster or not, of course it will; but be careful to use on case per case only if certain no issues occur with Network Monitoring or NTP. And they might occur in the future at some point, not instantly (if cache remembers an old resolve no longer valid, breaks, corrupts, dnsmasq or stubby fails...), which is the very reason RMerlin went back to "No" as default.
Then if that ever happens, you will have to use "No" for Use local caching. If all works, stay with "Yes" for speed ;)

With new sites and local caching off, the results were equivalent to using my ISP's DNS servers (I was using CloudFlare).
It is for local caching on, that would thus in this case be same speed!
 
Status
Not open for further replies.

Similar threads

Support SNBForums w/ 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