Setting DNS with Macvlan

Hey,

i want to set a specific DNS server. Is this the correct code to achieve this?
The rest works as it should.

version: '2'

services:
  homebridge1:
    container_name: homebridge
    image: oznu/homebridge:latest
    hostname: homebridge
    mac_address: d0:ca:ab:cd:ef:09
    networks:
      macvlan0:
       ipv4_address: 192.168.178.250
       dns:
      - 192.168.178.1
    environment:
      HOMEBRIDGE_CONFIG_UI: 1
      HOMEBRIDGE_CONFIG_UI_PORT: 80
      TZ: Europe/Berlin
      PGID: 100
      PUID: 1026
    volumes:
      - /volume1/docker/homebridge:/homebridge
    restart: always

  homebridge2:
    container_name: homebridge_testing
    image: oznu/homebridge:latest
    hostname: homebridge1
    mac_address: d0:ca:ab:cd:ef:08
    networks:
      macvlan0:
       ipv4_address: 192.168.178.249
       dns:
      - 192.168.178.1
    environment:
      HOMEBRIDGE_CONFIG_UI: 1
      HOMEBRIDGE_CONFIG_UI_PORT: 80
      TZ: Europe/Berlin
      PGID: 100
      PUID: 1026
    volumes:
      - /volume1/docker/homebridge_testing:/homebridge_testing
    restart: always
  
networks:
  macvlan0:
    driver: macvlan
    driver_opts:
      parent: ovs_eth0
    ipam:
      config:
        - subnet: 192.168.178.0/24
          gateway: 192.168.178.1
          ip_range: 192.168.178.240/28

I was having trouble with this last night also.
Is there a solution for this please?

In case of uncertainty, it is alway good to take a look at the compose file reference: dns (note: this is a sibling node to networks, not a child node of a network underneath networks)

If I am not mistaking this will replace docker’s internal dns used for service discovery.
Docker’s internal dns uses the nameserver defined in the hosts /etc/resolv.conf as upstream.

Would it help to set the nameserver to the resolver of your choise or at least declare it as upstream in the resolver you are pointing to?