TYPO3 Extension hosts_pattern
Set TYPO3_CONF_VARS['SYS']['trustedHostsPattern'] depending on available sys_domain records
Simply install the extension with Composer or the Extension Manager.
Hosts Patternbackend module
Check domain records that were found and pattern that was built
Write configurationbutton to write the built pattern to your LocalConfiguration.php file