Run 2 containers on same host?

afaik

one container can go with

"531:53/tcp"
      - "531:53/udp"
      - "671:67/udp"
      - "801:80/tcp"

second container

"532:53/tcp"
      - "532:53/udp"
      - "672:67/udp"
      - "802:80/tcp"
 nc -zv 192.168 xx 531
Connection to 192.168 xx 531 port [tcp/apertus-ldp] succeeded!

but


dig @192.168.xx -p 531 google.com 

; <<>> DiG 9.16.18 <<>> @192.168.xx -p 531 google.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

from the host machine


dig @0.0.0.0 -p 531 google.com

; <<>> DiG 9.11.5-P4-5.1+deb10u5-Debian <<>> @0.0.0.0 -p 531 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1576
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com.			IN	A

;; ANSWER SECTION:
google.com.		145	IN	A	142.250.185.14

;; Query time: 88 msec
;; SERVER: 127.0.0.1#531(0.0.0.0)
;; WHEN: Fri Aug 13 17:12:35 CEST 2021
;; MSG SIZE  rcvd: 55

what i am doing wrong?

What are you trying to do here? You have presented some command outputs, but with little context.

i try to run 2 pihole containers on the same host

You'll have to figure out how to make every client send queries to port 532 instead of port 53 first. Pretty much every single OS is going to use port 53.

so then i am better of to put the 2 container on a macvlan and dont care about port

You're not going to be able to run 2 DNS servers on the same node. Clients are going to use port 53 and you can't have two services listening on that port.

You can run two servers on the same node but have to use private dns (setup similar to GitHub - varunsridharan/pi-hole-android-private-dns: Script to auto-install & configure Android Private DNS For Pi-Hole with custom ports/services). I had to do this for running two diff piholes on 1 openstack container a while back to setup diff dns for my kids vs grownups devices :smiley: