[Mono-bugs] [Bug 392051] New: Validating "DNS" name using System.Net.Dns.GetHostByName

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon May 19 09:47:25 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=392051


           Summary: Validating "DNS" name using System.Net.Dns.GetHostByName
           Product: Mono: Class Libraries
           Version: unspecified
          Platform: Other
        OS/Version: SLED 10
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: ssutapalli at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


I am trying to validate DNS name as follows:

IPHostEntry host = nil;

try
{
 host = Dns.GetHostByName(ipstring); //ipstring is declared as string which
holds "192.168.80"
 foreach (IPAddress ip in host.AddressList)
 {
   log.Info("{0} is the IP Address",ip); 
 }
}
catch(Exception ex)
{
 log.Info("Invalid DNS Name {0}",ex.Message);
}

As per the functionality of GetHostByName, it must fail. But it is logging IP
address as "192.168.0.80 is IP Address" instead of throwing exception.
Please let me know the correct API to proceed.

Note: I am not talking about Dns.GetHostByAddress(IPAddress) method.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list