[Mono-bugs] [Bug 473006] New: Dns.GetHostAddresses with local hostname only returns entries in /etc/hosts if present

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 5 13:34:24 EST 2009


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


           Summary: Dns.GetHostAddresses with local hostname only returns
                    entries in /etc/hosts if present
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.2.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: io-layer
        AssignedTo: dick at novell.com
        ReportedBy: jaebird at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:

If a machine's hostname is located in /etc/hosts file, the
Dns.GetHostAddresses("HOSTNAME") only returns entries from the /etc/hosts file.
If there are no entries in the hosts file, the addresses returned include the
external ip addresses.

This may be related to: https://bugzilla.novell.com/show_bug.cgi?id=386637

Steps to reproduce the problem:

1. Make sure there is at least one entry in the /etc/hosts file containing the
machines hostname.

2. execute the following:
foreach (IPAddress addr in Dns.GetHostAddresses(Dns.GetHostName()))

{

   Console.WriteLine(addr);

}


Actual Results:
The only addresses that are printed are from the /etc/hosts file...none of the
external addresses (ie dhcp) are printed.

Expected Results:
An array of all addresses. (not sure if loopback is part of this list or not,
it doesn't appear the MS.NET includes 127.0.0.1 in this list)

How often does this happen? 
Every time.

Additional Information:
If all local hostname entries are removed from the /etc/hosts file. The
addresses returned are correct.

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


More information about the mono-bugs mailing list