Enable DNS in a container

Hi
I have LXD ver 4 set up running two containers on ubuntu 18.04 host.

One container contains nginx reverse proxy and the other container is running a mail server. (Both on Ububntu 18.04) The mail server is sending mail correctly but no mail is being received. The system status checks diagnostics in the mailserver inform me that the mailserver is configured correctly with the exception that
“Public DNS (nsd4) is not running (port 53).”
How do I enable this container to be passed appropriate data from the hosts port 53?

Thanks in advance for any suggestions.

This looks like an issue with the mail server configuration.
The mail server container gets by default DNS from the host.

Thanks for this.

On port 53 in the mail server container? For both TCP and UDP?

I have not noticed the name of the mail server.
There is this nds4 name server, which apparently is to be used in conjunction with the unnamed mail server. The mail server documentation should say how the two are expected to work with each other.

The mailserver is Mailinabox (MIAB) https://mailinabox.email/. Their preferred configuration is to takeover dns for the domain and to host the nameservers for the mail domain and any other domains required. Currently I have it set up with an external domain name server (from my domain name supplier). MIAB provides a description of the necessary A records, mx records etc for an external DNS supplier and I have followed those.

I had a look at https://mailinabox.email/guide.html It is an interesting project.
Since it is tested on Ubuntu Server 18.04, it is ideal to install in a LXD container so that no matter what host you are using, the package will be working on 18.04.

While the package says there is an issue with the DNS, you do not mention how you got the container accessible from the Internet. Can you show the LXD proxy devices; Because if you did not create any proxy devices, then the container that has MIAB is not accessible from the Internet, hence cannot receive email.

@simos Thanks for your interest in this problem.
Yes MIAB is an interesting project for those of us who are not too technical but who wish to control their own mailserver. I ran it for about two years on another VPS and it worked well but the VPS provider closed down which is why I need to set it up now.

I have set up LXD proxy devices for another container which has the nginx reverse proxy which is handling port 80 and 443 proxies to the mail server.

I have set up LXD Reverse Proxies for the mail server container for ports 25, 143, 993, 465, 587 and 4190. (You said to me in a previous post that it would be better to forward these through the nginx reverse proxy too but I haven’t worked out how to do the nginx conf file to achieve this yet.) I have used “proxy_protocol=true” addition to the command to establish these ports.

The mail server is running and I am able to send emails from it but it is not receiving emails as yet. There are 2 or 3 other configuration errors reported by the mailserver with a couple of dns A records that are needed on my nameserver provider. These are for entries concerned with autoconfig.mydomainname and
autodiscover.mydomainname.
I have set up the A records on the nameserver but my mailserver is reporting that the domain currently resolves to [Not Set] in public DNS. I suspect this is as a result of the DNS error reported by the status check that is the subject of this thread.

Thanks again for your help.