Conditional Forwarding with ports

Hi,

i'm running a bind server for local dns requests and a samba ad on the same machine as pihole.
A the moment, after every update i have to readd the conditional forwarding in the dnsmasq config for the server.
Can you add parameter for a port in the conditional forwarding option.

In what folder does this dnsmasq configuration file reside?

Sorry my post was uncomplete, but my smartphone had a connection problem.

The dnsmasq option for conditional forwarding can add to the /etc/dnsmasq.conf or in every config file in /etc/dnsmasq.d/ like the 01-pihole.conf
pihole recreate after every update the dnsmasq config with the configuration from the webgui or pihole config.
So it overwrites all dnsmasq files.
the pihole webgui has a option to add conditional forwarding, but only the ability to add a ip, not a additional port. So after every update i had to add the port parameter to the conditional forwarding line in /etc/dnsmasq.d/01-pihole.conf

server=/testme/192.168.0.1
server=/0.168.192.in-addr.arpa/192.168.0.1
to
server=/testme/192.168.0.1#54
server=/0.168.192.in-addr.arpa/192.168.0.1#54

This is not quite the case. Pi-Hole does not overwrite files in /etc/dnsmasq.d other than the file it installs (01-pihole.conf).

Since dnsmasq (as specified in /etc/dnsmasq.conf) uses the entire directory /etc/dnsmasq.d as a source for configuration files, make a new file in this directory with your conditional forwarding configuration.

Note the following section of file /etc/dnsmasq.d/01-pihole.conf

###############################################################################
#      FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE.      #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
#                                                                             #
#        IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN:          #
#                      /etc/pihole/setupVars.conf                             #
#                                                                             #
#        ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE           #
#                    WITHIN /etc/dnsmasq.d/yourname.conf                      #
############################################################################

So does that mean you need to edit setupVars.conf and change

REV_SERVER_TARGET=192.168.0.254

to
REV_SERVER_TARGET=192.168.0.254#5335

or does it use a different format/keyname?

(sorry about the thread necromancy but not much else on the forums on the subject.)

If you're using the OPNsense guide that I wrote and forward to unbound then you no longer need to use Conditional Forwarding.

the guide doesn't make reference to unbound other than that it's an "optional for upstream dns resolution". it says to use dnsmasq though and that's what i've done.
I've also, fwiw set up unbound as per your screenshot earlier in this thread. but i don't know what to do with it.