Playing local audio file on Pi local port with remote access via duckdns on

sorry if this has been asked before.
I got ability to play local audio mp3 files on local pi port working using mopidy add-on. configuration for that was something like:

action:

  • data:
    entity_id: media_player.music_player
    media_content_id: 192.168.0.111 /local/ somefile.mp3
    media_content_type: music
    service: media_player.play_media

It worked fine until I configured remote access using duckdns. now above configuration do not work as hassio no longs responds to http request. Instance runs on https and certificate is issued with duckdns domain. With that said, same configuration requires public url for locally stored file like:

action:

  • data:
    entity_id: media_player.music_player
    media_content_id: https:// mysubdomain. duckdns.org:8123/local/ somefile.mp3
    media_content_type: music
    service: media_player.play_media

It works when internet is on, but my quest is make this particular automation working without internet.

I am thinking something like:

  1. Have a DNS server running LAN which resolves: “mysubdomain. duckdns. org” to local IP automatically and forward the remaining DNS request to upstream DNS server. then have that local DNS set in DHCP config at router so that all local clients (including hassio pi) resolves to local IP
  2. or somehow override hassio running Pi host file to resolve “mysubdomain. duckdns. org” to localhost.

what is possible ?

Hello, i am working with identical problem. Do you figure something out? Thanks.