How to locally resolve host name starting with variable slug?
People often use dnsmasq for this.  You can wildcard sub-domains like this fairly easily for local testing using it.

Here's an example - https://qiita.com/bmj0114/items/9c24d863bcab1a634503 but there are plenty online.