I'm making a project in java using Sockets that consist in connect a DNS server having a url and receive the IP, but that IP will be from a host where the picture is hosted in internet (doesn't matter what picture) and the last step is to get that image and save it in a text file, in binary. The thing here is that I need to show the PDU that I send to the DNS server and the answer. Also need the PDU from the others HTTP querys to download the picture. I'm quite confused, I have never use Sockets before, if anyone can show me how to do or give me where find information about I'll be very thankful. Thanks.
Asked
Active
Viewed 446 times
0
-
Pictures don't have IP addresses. The DNS lookup in Java is automatic. Your question doesn't make sense. – user207421 Nov 16 '15 at 22:18
-
I refer to the IP where the picture is hosted. What I need is to make the DNS lookup manually. – CarolineGM Nov 16 '15 at 22:44
-
Then you need to acquaint yourself with Java `DatagramSockets` and `DatagramPackets` and the DNS RFC. Too broad to answer here. – user207421 Nov 16 '15 at 23:50