[Dnsmasq-discuss] listening on multiple ports at the same time

Matthias May matthias.may at westermo.com
Thu Dec 8 15:51:01 UTC 2022


On 12/8/22 13:25, Geert Stappers wrote:
> On Wed, Dec 07, 2022 at 03:11:53PM +0100, Matthias May via Dnsmasq-discuss wrote:
>> On 12/6/22 19:51, Gordon Shawn wrote:
>>> can dnsmasq listen on different ports(e.g. 53, 5353,5354,5355) in the
>>> same time with a single process running? each port can have its own
>>> configuration. so far I invoke multiple dnsmasq processes to do that. if
>>> they can share with one process I can save some memory.
>>
>> You could do a portforward with {ip,nf}tables.
>>
> 
> Please elaborate how that works.
> 
> 
>> BR
>> Matthias
> 
> 
> Groeten
> Geert Stappers


iptables -t nat -A PREROUTING -d 192.168.1.2 -p udp -m udp --dport 5353 -j DNAT --to-destination 192.168.1.2:53

This forwards requests to port 5353 to port 53.
As said elsewhere in the thread, this doesn't allow to have a different config for different "ports" because from
dnsmasq's point of view there is only a single port.

BR
Matthias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xDF76B604533C0DBE.asc
Type: application/pgp-keys
Size: 669 bytes
Desc: OpenPGP public key
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20221208/94c66d31/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20221208/94c66d31/attachment.sig>


More information about the Dnsmasq-discuss mailing list