Bug 35536 - Dns.GetHostEntry no longer supports IPv6
Summary: Dns.GetHostEntry no longer supports IPv6
Status: CLOSED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 4.0.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 4.8.0 (C9)
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-11-04 11:49 UTC by matt
Modified: 2017-03-03 21:35 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
CLOSED FIXED

Description matt 2015-11-04 11:49:16 UTC
Dns.GetHostEntry used to return IPv4 and/or IPv6 addresses when appropriate. It now no longer works with IPv6.

This throws an exception
var hostEntry = Dns.GetHostEntry("ipv6.google.com").AddressList;

This returns a list of only IPv4 addresses
var hostEntry = Dns.GetHostEntry("google.com").AddressList;
Comment 1 Marek Safar 2016-11-15 12:29:35 UTC
Fixed in master and Mono 4.8
Comment 2 Saurabh 2016-11-21 11:26:53 UTC
I have checked this Issue with latest master build (Mono 4.9.0.970). I am still getting exception when using ipv6. 

Exception details: https://gist.github.com/saurabh360/0ae7d62eeff087adfcaa8de01e6efcbe

Environment Info: https://gist.github.com/c16d963aa7ea93d0ba15194248e76941
Comment 3 Marek Safar 2016-11-23 17:12:21 UTC
@Saurabh Do you really have IPv6 network working e.g does ping to ipv6 address work for you?
Comment 4 Saurabh 2017-02-07 07:40:25 UTC
I have checked it again and I am using IPv6 network and still getting exception.
Screencast: https://www.screencast.com/t/l6xhNKoRMc
Exception details: https://gist.github.com/AkhileshKumar01/ab907439486a2911c060ac4ae6c73f6f
Environment Info: https://gist.github.com/AkhileshKumar01/3f2844619e5665528b7f80d4855408e2
Comment 5 Marek Safar 2017-02-07 08:39:30 UTC
Does ping to ipv6 from terminal work ?
Comment 7 Marek Safar 2017-02-08 12:37:04 UTC
If you cannot ping ipv6 google server from terminal it'll hardly work from the app. You should see something like if your network is ipv6/dns6.

ping6 ipv6.google.com
PING6(56=40+8+8 bytes) 2a01:110:1008:40:5cb3:3661:6720:35ee --> 2a00:1450:4009:800::200e
16 bytes from 2a00:1450:4009:800::200e, icmp_seq=0 hlim=47 time=28.946 ms
16 bytes from 2a00:1450:4009:800::200e, icmp_seq=1 hlim=47 time=28.878 ms
16 bytes from 2a00:1450:4009:800::200e, icmp_seq=2 hlim=47 time=27.303 ms
16 bytes from 2a00:1450:4009:800::200e, icmp_seq=3 hlim=47 time=27.433 ms


You could also check http://ipv6-test.com/
Comment 8 Saurabh 2017-02-21 07:36:43 UTC
@Marek, I have again tried to setup ipv6 locally using mac with document: https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html and checked that ipv6 address appearing in network preference but when I am checking using http://ipv6-test.com/ It is showing me not supported for both ipv4 and ipv6. This is the screencast for the same: https://www.screencast.com/t/g7IltjZF

Could you please let me know how can I setup this ipv6 so that I can verify this Issue?
Comment 9 Marek Safar 2017-02-21 08:58:07 UTC
I have no idea how your local network is setup, it's best to talk to your network administrator how to make ipv6 work for you