In roaming case when MME of visited network serves UE of different network, It has to fetch UE information from its home network HSS. In these cases only DNS helps to resolve the HSS and MME gets the information from that HSS.
In lab testing, you might have static configuration but in deployment DNS would be preferred choice.
Based on the PLMN of IMSI, MME forms FQDN and resolve the HSS details.