I used 5 threads to create new InetSocketAddress and store them in queue, but i found it is not enough. How to do a faster dns lookup?
Isn't a single thread enough for DNS lookup? because DNS Lookup just need to send a request to a DNS server to translate a domain name to IP address, once you get it, its should store by your OS for later use.
The speed of DNS lookup is most likely limited by the speed of your local DNS server and/or the network bandwidth and latency between it and the remote DNS servers you are talking to.
From Java, you may be able to get more InetSocketAddress's created (more DNS lookups done) by spawning more threads, but sooner or later you will run into external limits that become increasingly difficult to get around.
Question: why are you needing to create large numbers of InetSocketAddress objects?
EDIT - Based on your reply, I'm assuming these InetSocketAddress objects are all for the same remote host, and your want them fast to make application startup fast. In that case, you could avoid repeating the DNS lookup by fishing the IP address out of the first InetSocketAddress created and using that IP address to create the remaining InetSocketAddress objects.
Question 2: boosts the speed of what? Are you trying to talk to lots of servers at the same time? Why?