With mono 4.0 the reverse DNS broke.
The following code always returns the IP address as string rather than the HostName.
Dns.GetHostEntry("my ip address").HostName
// IP for google.com
var google = Dns.GetHostEntry("22.214.171.124");
Console.WriteLine("Hostname: " + google.HostName);
// outputs: "126.96.36.199" instead of "google.com"
(This is with the mono 4.0 beta update. I didn't see the 4.0 version when filing this bug so hopefully someone can correct the ticket)
Updating with test project
The following app demonstrates an issue within Mono 4, where the DNS.GetHostEntry method returns an incorrect result
### Test Case
### Steps to Reproduce
1. Open test case
2. Run with Mono
### Expected Results
A hostname should be returned
### Actual Results
The IP address is returned.
### Working Version
Do the above with either mono 3.x or on Windows using CSC/.Net
=== Xamarin Studio ===
Version 5.9.2 (build 0)
Installation UUID: 061f61cf-c366-4da7-b3c9-31033d0fc883
Mono 4.0.1 ((detached/6d5afc1)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400010034
=== Apple Developer Tools ===
Xcode 6.3.1 (7703)
=== Xamarin.iOS ===
Version: 188.8.131.52 (Business Edition)
Build date: 2015-05-14 08:50:11-0400
=== Xamarin.Android ===
Version: 184.108.40.206 (Business Edition)
Android SDK: /Users/beyerc/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.4 (API level 19)
5.0 (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
=== Xamarin Android Player ===
Version: Unknown version
Location: /Applications/Xamarin Android Player.app
=== Xamarin.Mac ===
Version: 220.127.116.11 (Business Edition)
=== Build Information ===
Release ID: 509020000
Git revision: f97f3598952edca4678fc9fdafffecb68ed24399
Build date: 2015-05-08 11:55:56-04
Xamarin addins: ab18ddff45f507ed74f36c2b65df9aee22e28a56
=== Operating System ===
Mac OS X 10.10.3
Darwin Codys-MBP.router 14.3.0 Darwin Kernel Version 14.3.0
Mon Mar 23 11:59:05 PDT 2015
Is Xamarin bugzilla the most appropriate place for this ticket? Is there a higher likelihood of this getting fixed if reported elsewhere?
It appears that the bug was introduced here:
Ok. It is not the case :). Sorry :).
Any idea when this will be fixed?
*** Bug 56299 has been marked as a duplicate of this bug. ***
*** Bug 56295 has been marked as a duplicate of this bug. ***
This is affecting me on Linux too. Currently standing in the way of an important ircd feature - reverse DNS lookups for blacklists (e.g. proxies). Version: mono 18.104.22.168.
The same code works on Windows.