DNS forwarding

Hi guys!

I’m setting up an IPTV app at location with core being Mikrotik CCR.
The app by default pulls the channel playlist from address:

http://iptv.local/playlist.m3u

So to make it work I set up static DNS rule in CCR like this:

/ip dns static
add address=xxx.yyy.xx.qqq name=iptv.local

and uploaded the “playlist.m3u” to the root directory of xxx.yyy.xx.qqq. This works great as expected.

The problem is I’m doing next location that will need a different playlist.
I can’t make any changes in the app with a link or file name.
I also can’t make subdirectories since in DNS I can only put an IP address.

Is there any way to solve it without creating separate servers for each playlist?

You could have a script (i.e. PHP) instead of static playlist on the server (to which you’re directing clients via DNS setting). It would serve different playlists depending on client IP address or some other criteria. Any decent web server will allow you to execute script even if the file extension is “not right”.