Fixed DNS resolve bug for Grid mode on multi-Homer systems.

This commit is contained in:
Tedd Hansen
2007-09-12 05:37:46 +00:00
parent 6ca6c035e7
commit 5ade01bb49
2 changed files with 8 additions and 0 deletions

View File

@@ -249,6 +249,13 @@ namespace OpenSim.Framework.Utilities
/// <returns>An IP address, or null</returns>
public static IPAddress GetHostFromDNS(string dnsAddress)
{
// Is it already a valid IP? No need to look it up.
IPAddress ipa;
if (IPAddress.TryParse(dnsAddress, out ipa))
return ipa;
// Not an IP, lookup required
IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList;
foreach (IPAddress host in hosts)