DNS settings get reset in docker

This looks like a common problem and I'm not sure if there's already a solution to it. This is how I have the docker container configured, very simple:

pihole:
    image: pihole/pihole:v5.2.1
    container_name: pihole
    hostname: pihole.condo.arpa
    volumes:
      - /home/kevin/appdata/pihole/etc-pihole:/etc/pihole
      - /home/kevin/appdata/pihole/etc-dnsmasq.d:/etc/dnsmasq.d
      - /home/kevin/appdata/proxy/wpad.dat:/var/www/html/wpad.da
      - /home/kevin/appdata/proxy/wpad.dat:/var/www/html/wpad.dat
      - /home/kevin/appdata/proxy/wpad.dat:/var/www/html/proxy.pac
    mac_address: fa:af:f7:2e:f5:97
    networks:
      physical_macvlan_network:
        ipv4_address: 192.168.20.100
    dns:
      - 127.0.0.1
      - 8.8.4.4
    restart: unless-stopped
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=Asia/Manila

Everytime I enable DNSSEC and configure conditional forwarding, they get reset every after container restart. This seems to be a very common issue and I'm surprised it's not fixed until now. Do I have to "force" the values of these DNS settings by using all the environment variables for them? Clearly, these variables are marked as "optional" so why do I need to be using them to be able to set my DNS settings? It's kinda counterproductive, no?

Also, I know that to be able to use multiple conditional forwarders, I need to manually edit dnsmasq.d. But how will even achieve that if everything after restart that config file is written with a fresh copy?

Nevermind! I updated to 5.3.4 and it solved the issue.