I parse various data sources with network information in them.
I have been using java.net.InetAddress to represent and parse hosts. It works fine being initialized with IP.
I have to parse a new source now. It contains hostnames instead of IP's. InetAddress.getByName() throws UnknownHostException if a hostname argument can't be resolved to an IP. Host IP isn't absolutely neccessary for my goal. Dropping the data just because of DNS failure is unacceptable for me.
I'd like to have an IP address if it is obtainable or a hostname otherwise.
How do I prevent resolve of given hostnames? Is there another class that is more suited for my needs?