LUCI DNS https proxy and OpenDNS howto

To help others... (and as a future reminder for me if needed)

Just moved from DNSCrypt to DNS over https and wanted to continue using OpenDNS for content filtering. But the LUCI GUI for DNS HTTPS Proxy does not include the OpenDNS entries, I could just add the config in to the Config file but wanted a GUI solution to switch DNS providers if needed. So I have added them to the GUI by doing:

Log in to the SSH terminal of your router
Change directory with cd /usr/lib/lua/luci/https-dns-proxy/providers
Create a new file with you favourite text editor (I use nano) called OpenDNS.lua and enter the following text:

 return {
         name = "OpenDNS",
         label = _("OpenDNS"),
         resolver_url = "https://doh.opendns.com/dns-query",
         bootstrap_dns = "208.67.222.222,208.67.220.220",
         default = true
 }

Once you have saved the file. Go to the LUCI DNS HTTPS Proxy page (if your already on the page reload it) and OpenDNS will be shown in the drop down list, select it and "save and apply" - I find that I also need to reload the service for the service status to show the selected provider.
Test by using the OpenDNS test page of https://welcome.opendns.com/ and the page should show a tick and OpenDNS is working.

If you use the OpenDNS Family Shield service (I have not test this part as I don't use the service) the file above should work by replacing the file text with (or a second different file could be used with the text):

return {
        name = "OpenDNS Family Shield",
        label = _("OpenDNS Family Shield"),
        resolver_url = "https://doh.familyshield.opendns.com/dns-query",
        bootstrap_dns = "208.67.222.123,208.67.220.123",
        default = true
}

Hope this helps others.

PS - You might want to add (without the quotes) "/usr/lib/lua/luci/https-dns-proxy/providers/OpenDNS.lua" to your backup config so it backup's the file and can be restored through upgrades and faults.

Probably you should file an issue on luci-app-https-dns-proxy or contact @stangri.

1 Like

@vgaetera thanks for tagging me in this!

@paped I just updated the luci app and merged changes to the OpenWrt repo (https://github.com/openwrt/luci/pull/4310, https://github.com/openwrt/luci/pull/4311, https://github.com/openwrt/luci/pull/4312) for master branch as well as 19.07 and 18.06. The updated ipk should be available within 48 hours hopefully. I recommend you undo the manual changes you've made if you decide to upgrade to a newer version.

1 Like

@stangri - Wow, will remove my manual workaround and update at the weekend, thank you very much for adding it in.