Specify DNS server port

Hi,

for some reasons my network’s DNS server can not run on port 53 so I run it on another port. This is the server I must use with Truenas SCALE Electric Eel.However, I can not specify a DNS port in the web UI.

Is there a way to configure a different DNS server port?

Every device that needs DNS is going to reach out using the default DNS port.

So you either catch this DNS communication in a firewall (an pfsense or opnsense setup could do it for example) and then redirect it to your DNS server using whatever port you prefer, or you figure out how to move your DNS server to the correct port.

I suggest you give the latter thing another try.

1 Like

Thank you for taking the time to answer.

However, neither is it an answer to my question nor is it true.

What part of what I said do you object to, specifically?

I parsed your question as asking how to change the port used by TrueNAS when it makes DNS inquiries.

TrueNAS is appliance software and there is no supported way of changing the port used in the above (DNS client) situation.

Now, if you were to be more forthcoming perhaps someone can assist you with the underlying issue at hand, where you say that “for some reasons my network’s DNS server can not run on port 53”.

Community help is often tied to the quality, detail and tone of the question, as asked. It is also not guaranteed.

2 Likes

I object to the part that every device that needs DNS is going to reach out using the default DNS port.

I am sorry if I came across as harsh. I appreciate that you want to help and obviously help is what I am looking for in this forum. However, I was specifically asking about setting the port in truenas. Thank you for clarifying this.

I have multiple DNS servers running on multiple hosts and I already use firewall rules to bend the ports and redirect the packets and I’d like to simplify my setup. Some of the DNSes serve different functions, others are for redundancy and there is isolation for security purposes. The ones I use for general lookup inside my home network are forwarding to each other in a hierarchical fashion to leverage the integration with DHCP of the routers they are running on. I specifically have trouble with using PAT to redirect into the same network, which will change my source IP rather than just the target and port, for obvious reasons.

Being able to change the DNS port would simplify my setup a little bit.

Part of the problem is that I want to migrate a PiHole instance to a Docker container on my TrueNAS host, but when I set the TrueNAS’s DNS to its own IP the Docker containers will have trouble resolving some names and I didn’t want to dig deeper into that problem, so my other solution involves another host that already runs a DNS on its port 53 that has clients who also can’t change the port. Using the container also has the drawback that I wouldn’t be able to resolve addresses during boot, so that solution isn’t a good one anyway. So what I’m doing now is that I specifically rewrite the packets coming from the IP of my TrueNAS system.