Consider the below URL as an example. http://www.test1.example.com
Is there any method by which I can get \"example.com\" as an output. I know there is
import java.net.InetAddress; void Func() { InetAddress ia = InetAddress.getLocalHost(); System.out.println (ia.getHostName()); }
Hope this helps.