[Mono-bugs] [Bug 79886][Blo] New - Dns.GetHostEntry fails to resolve IP addresses

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Nov 10 01:39:04 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jwiegley at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=79886

--- shadow/79886	2006-11-10 01:39:04.000000000 -0500
+++ shadow/79886.tmp.951	2006-11-10 01:39:04.000000000 -0500
@@ -0,0 +1,78 @@
+Bug#: 79886
+Product: Mono: Class Libraries
+Version: 1.1
+OS: Mac OS X 10.3
+OS Details: Mono 1.2rc0 OS/X 10.4.8
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: jwiegley at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Dns.GetHostEntry fails to resolve IP addresses
+
+Please fill in this template when reporting a bug, unless you know what you are doing.
+Description of Problem:
+
+The following sample code fails to run using 1.2rc0 and OS/X 10.4.8.  I tested that it works fine 
+with Visual Studio 2005:
+
+using System;
+using System.Net;
+
+namespace Bug
+{
+	public class MyTest
+	{
+		public static void Main(string[] args)
+		{
+			IPHostEntry host;
+
+			byte[] addr = {127, 0, 0, 1};
+			host = Dns.GetHostEntry(new IPAddress(addr));
+
+			Console.WriteLine("GetHostEntry({0}) returns:", addr);
+
+			foreach (IPAddress ip in host.AddressList)
+			{
+				Console.WriteLine("    {0}", ip);
+			}
+		}
+	}
+}
+
+The output I get from Mono is:
+
+Hermes:/Users/johnw/Sites/johnw $ mono --debug bug.exe
+
+Unhandled Exception: System.Net.Sockets.SocketException: No such host is known
+  at System.Net.Dns.GetHostByAddressFromString (System.String address, Boolean parse) 
+[0x0004e] in /private/tmp/scratch/mono-1.2/mcs/class/System/System.Net/Dns.cs:265 
+  at System.Net.Dns.GetHostEntry (System.Net.IPAddress address) [0x00012] in /private/tmp/
+scratch/mono-1.2/mcs/class/System/System.Net/Dns.cs:287 
+  at Bug.MyTest.Main (System.String[] args) [0x00018] in /Volumes/Users/johnw/Sites/johnw/
+bug.cs:13 
+
+Expected Results:
+
+GetHostEntry(System.Byte[]) returns:
+    127.0.0.1
+
+How often does this happen? 
+
+Every time.
+
+Additional Information:
+
+This is a serious problem for me because MySQL Connector/NET is making this exact same call in 
+order to connect to my database on localhost.
+
+Also, it happens no matter what IP combo I use.  I tried adjusting my /etc/hosts to remove all 
+lPv6 related entries, but no effect.
+
+John


More information about the mono-bugs mailing list