TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.25k stars 418 forks source link

[QUESTION] What to do to run dns using podman? #929

Closed pawlosck closed 3 months ago

pawlosck commented 4 months ago

Anybody know, what to do to run dns using podman? Over one week I am trying it and nothing. Few days ago, I run it, but all queries were from one ip (network 10.X.X.X). I tried to change it, so I updated ubuntu from 20.04 to 22.04. I downloaded latest static binary of podman and prepared all files. Currently I am trying to run it as normal user and I can't, because show me info that port 53/tcp is in use. I tried to run using sudo and show me error (podman not found). I tried to run as root, but I see "errorError: cannot run command "podman machine init" as root". The same, when I am trying to run "podman machine start" as root.

I tried everything. netstat doesn't show any program which use port53. Nmap from other host show info, that port 53 is closed. I disabled systemd-resolved (I mean, disabled listening). I run command "sysctl net.ipv4.ip_unprivileged_port_start=0"` and nothing. I disabled iptables and other things which could block it.

ShreyasZare commented 4 months ago

Thanks for the post. I do not have experience working with podman so not sure how to fix this. I would suggest that you try to use the docker image directly.

Note that the containers have their own network setup which causes issues like not able to see the client's IP. I would suggest to run the container in "host" mode so that the DNS server is able to listen directly on the host system's port.

pawlosck commented 4 months ago

I know that containers uses own tools to manage networks. If I know, there are aardvark-dns tool to manage dns queries and I suppose this tool cause problems.

I tried to use host mode but I saw other errors. If I remember well, some features are not supported.

I will try to use docker directly. Could you write what commands I should use to run it? Probably the same what podman use but I should rename "podman" to "docker". In podman I had to run podman containter, but I suppose, docker don't need it.

ShreyasZare commented 4 months ago

I will try to use docker directly. Could you write what commands I should use to run it?

You can read this blog post to know how to deploy the docker image.