Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 1 of 1

Thread: DNS Resolution

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Thanked 0 Times in 0 Posts

    Default DNS Resolution


    I'm having some issue using DNS. I have to make a program which resolves DNS paths.
    In some way it would be like creating a GUI for the UNIX command "dig +trace www.myurl.com".

    I made lot of research on internet and I only found the dnsjava library which gives me some information (see below) but I am not able to determine which root-server I am going through.

    Information I can retrieve:

    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32345
    ;; flags: qr rd ra ; qd: 1 an: 2 au: 4 ad: 4
    ;; Google., type = A, class = IN

    ;; ANSWERS:
    Google. 133794 IN CNAME Google.
    Google. 115 IN A

    google.com. 207182 IN NS ns3.google.com.
    google.com. 207182 IN NS ns4.google.com.
    google.com. 207182 IN NS ns1.google.com.
    google.com. 207182 IN NS ns2.google.com.

    ns1.google.com. 50123 IN A
    ns2.google.com. 49577 IN A
    ns3.google.com. 52979 IN A
    ns4.google.com. 49928 IN A

    Information the command dig give me:

    MBP-Nima:~ Nima$ dig +trace Google

    ; <<>> DiG 9.6.0-APPLE-P2 <<>> +trace Google
    ;; global options: +cmd
    . 433874 IN NS j.root-servers.net.
    . 433874 IN NS k.root-servers.net.
    . 433874 IN NS l.root-servers.net.
    . 433874 IN NS m.root-servers.net.
    . 433874 IN NS a.root-servers.net.
    . 433874 IN NS b.root-servers.net.
    . 433874 IN NS c.root-servers.net.
    . 433874 IN NS d.root-servers.net.
    . 433874 IN NS e.root-servers.net.
    . 433874 IN NS f.root-servers.net.
    . 433874 IN NS g.root-servers.net.
    . 433874 IN NS h.root-servers.net.
    . 433874 IN NS i.root-servers.net.
    ;; Received 512 bytes from in 1 ms

    com. 172800 IN NS e.gtld-servers.net.
    com. 172800 IN NS c.gtld-servers.net.
    com. 172800 IN NS g.gtld-servers.net.
    com. 172800 IN NS i.gtld-servers.net.
    com. 172800 IN NS h.gtld-servers.net.
    com. 172800 IN NS a.gtld-servers.net.
    com. 172800 IN NS b.gtld-servers.net.
    com. 172800 IN NS l.gtld-servers.net.
    com. 172800 IN NS m.gtld-servers.net.
    com. 172800 IN NS f.gtld-servers.net.
    com. 172800 IN NS k.gtld-servers.net.
    com. 172800 IN NS d.gtld-servers.net.
    com. 172800 IN NS j.gtld-servers.net.
    ;; Received 504 bytes from in 211 ms

    google.com. 172800 IN NS ns2.google.com.
    google.com. 172800 IN NS ns1.google.com.
    google.com. 172800 IN NS ns3.google.com.
    google.com. 172800 IN NS ns4.google.com.
    ;; Received 168 bytes from in 293 ms

    Google. 604800 IN CNAME Google.
    Google. 300 IN A
    ;; Received 68 bytes from in 207 ms
    If you have any idea I will really appreciate your help.
    Last edited by nim.izadi; November 6th, 2010 at 02:30 PM.