From ba61b64c424abed18052a68955f996d9eb81d9b7 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 11 Dec 2016 20:50:17 +0000 Subject: If a region address is resolveable to a single address, resolve it on startup and use that address This change facilitates running opensim within containers and VMs where the external address isn't that of the VM/container but that of the host. --- OpenSim/Framework/RegionInfo.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index ca17793..f764a34 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -708,7 +708,11 @@ namespace OpenSim.Framework } else { - m_externalHostName = externalName; + IPAddress[] addrs = Dns.GetHostAddresses(externalName); + if (addrs.Length != 1) // If it is ambiguous or not resolveable, use it literally + m_externalHostName = externalName; + else + m_externalHostName = addrs[0].ToString(); } // RegionType -- cgit v1.1