Bind / Secondary Zone - Primary IP Port

Started by dusty128, November 13, 2024, 12:01:16 PM

Previous topic - Next topic
Dear OPNSense community,
I have a primary OPNSense DNS server with bind, running on port 53530 with a zone.

Now I have a secondary OPNSense installation, where I want to put this zone as a secondary zone in Bind.

My problem is that I cannot specify the port in the GUI. I can do so directly in the configuration files, however, this is overwritten.

How can I specify the port for the primary DNS server on my secondary OPNSense Bind installation?

Best Regards,
Hermann

I have actually come across the same issue.

It looks like you can specify the port in the config file on the host
/usr/local/etc/namedb/named.conf
Example below, where a manual port insertion on the primaries line did the trick for me.

zone "lan1" {
        type secondary;
        primaries { 10.1.1.1 port 53530; };
        file "/usr/local/etc/namedb/secondary/lan1.db";
        allow-transfer {
                dns_lan;
        };
        allow-query {
                dns_lan;
        };
};

The issue with this approach appears to be any GUI edit regenerates the config and wipes out said adjustment.
Granted I haven't yet explored a better/more permanent approach.

Hopefully we hear some developments from others who come across this thread. Else might be one for a GitHub feature request.

I have created an github issue/pull request since I'm having the same requirement.

https://github.com/opnsense/plugins/issues/4444

I also struggled with these problems.
My solution is solved with a virtual IP.
On the IP, bind can then work normally on port 53.
Listen IP is then the virtual IP in bind.