Allow to set custom ports for upstream dns servers

,

NethServer Version: NethServer release 7.5.1804 (final)
Module: DNS(dnsmasq)

Hi. I’ve encountered a problem with configuring my server’s DNS. I’ve installed dnscrypt-proxy and registered it on localhost on a custom port as to not interfere with dnsmasq and tried to add it to the list of upstream DNS servers in GUI. But only “valid” IP addresses are allowed there, while it’s possible to set custom ports in the dnsmasq config like server=1.2.3.4#56987 where numbers after # are the port.
I’m aware of the template-custom method to persist custom configuration files edits, but I think it would be appropriate to allow setting custom ports in the web frontend for use cases like mine.

TL;DR
Installed dnscrypt-proxy to listen on custom port on localhost
Cannot set port for upstream dns for dnsmasq in web frontend
Would like to do so, without template-custom.

Cheers.

I don’t think that accepting dnsmasq custom syntax in the dns ip address field is a good choice (we could change dns forwarder in the future).
Apart from custom templates, we could add an option to forward dns requests to localhost, with a custom port.
But, maybe, we could create a nethserver-dnscrypt-proxy rpm package that does all under the hood.

Not necessarily custom dnsmasq syntax, but at least custom port field.

This is also a good idea, but less integrated with the neth ecosystem, I think.

This seems like a most sensible solution, but very narrow at that. What if I’d like to use pi-hole and dnscrypt-proxy as its upstream, for example?

I get that it’s a pretty niche problem, but I think allowing just a custom port in upstream dns config(regardless of the forwarder, as most of them allow it in some way) would be the most flexible solution.
But I might be wrong.

Bumping this as I’ve also run into a need for this:

Sure, a custom template fragment works, but it’s strange that even setting the config property directly doesn’t work–if I do config setprop dns NameServers 127.0.0.1#5335 and then expand the template, I get:

expand-template /etc/dnsmasq.conf 
ERROR in /etc/e-smith/templates//etc/dnsmasq.conf/20dns: Program fragment delivered error <<Can't call method "within" on an undefined value at /etc/e-smith/templates//etc/dnsmasq.conf/20dns line 18.>> at template line 8
ERROR: Template processing failed for //etc/dnsmasq.conf: 1 fragment generated errors
 at /sbin/e-smith/expand-template line 45.

What are you trying to achieve with this command, or what exactly is it supposed to do, in relation to the Technitium DNS?

My instructions have Technitium running alongside DNSMasq (which Neth expects to provide all DNS), and tell DNSMasq to query the Technitium instance for anything DNSMasq doesn’t already know about. It’d be nice to be able to configure DNSMasq to do this without needing to prepare a custom template fragment.

1 Like