Your setup is not easy to understand. This is what I understood:
a) There is a Moodle instance http://demo.example.com which is hosted at a public IP address
b) There is a bunch of Moodle instances like http://moodle-2010.example.com, ... http://moodle-2018.example.com. All resolve to the same private IP address.
c) Then there is the live Moodle, http://moodle.example.com, which also resolves to a private IP address.
That can be done - even if all those Moodles are on the same machine. Differentiate their web directories through Apache Virtual Hosts https://wiki.ubuntuusers.de/Apache/Virtual_Hosts/ and have separate databases and moodledata directories for each.