Here is an easier way to keep it updated whenever you restart HA container.
recreate that file in the same directory as your docker compose.yaml (mine is called ha_resolv.conf)
Add the following to the volumes for homeassistant in your compose.yaml file.
volumes:
- ./ha_resolv.conf:/etc/resolv.conf # workaround for dns issues from 2025.5 on
you will need to rebuild the homeassistant container for it to be loaded the first time.
docker compose up --detach --remove-orphans --build homeassistant