Why is the 1st one returning null, while the 2nd one is returning mail.yahoo.com?
Isn\'t this weird? If not, what\'s the logic behind this
I don't think it's a bug in Java, I think Java is parsing hostnames correctly according to the spec, there are good explanations of the spec here: http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names and here: http://www.netregister.biz/faqit.htm#1
Specifically hostnames MUST NOT contain underscores.