Changing accessible hostname

I’m running a node express server after wifi-connect gets a pi zero on to a network. I would like to be able to access the express server via a_custom_name.io on the LAN instead of the device ip. I found this command that I can run in my start.sh, however balena local doesn’t find the device anymore. What should I be doing to achieve this?

curl -X PATCH --header "Content-Type:application/json" \
    --data '{"network": {"hostname": "newhostname"}}' \
    "$BALENA_SUPERVISOR_ADDRESS/v1/device/host-config?apikey=$BALENA_SUPERVISOR_API_KEY"
version: '2.1'
networks: {}
volumes:
    myapp-data: {}
services:
    audio:
        build:
            context: ./audio
        privileged: true
        restart: always
        labels:
            io.balena.features.kernel-modules: '1'
    wifi-connect:
        build: ./wifi-connect
        privileged: true
        network_mode: host
        labels:
            io.balena.features.dbus: '1'
            io.balena.features.supervisor-api: '1'
    main:
        build:
            context: ./main
        volumes:
            - 'myapp-data:/data'
        privileged: true
        restart: always
        expose:
            - "1381"
        ports:
            - "80:1381"
        depends_on:
            - audio
            - wifi-connect

Hey, could you clarify what you mean by “balena local doesn’t find the device anymore” please?

I believe I sorted out the local issue where devices weren’t being found, It was my fault.