host lookup on specific nameserver

Discussion in 'Java' started by Thilo Rusche, Jul 28, 2003.

  1. Thilo Rusche

    Thilo Rusche Guest

    Hi,

    is there a way to perform a host lookup using a specific DNS server
    instead of the default nameserver of the local machine in Java, short
    of implementing the DNS protocol? For example, if the local machine is
    configured to use /etc/hosts, 10.254.1.1 and 10.254.2.2, is there any
    API call that allows me to query a different server? As far as I am
    aware, the java.net package does not support this, and I could not
    find any third party API for this either. Any pointers would be
    appreciated.

    Thanks!
    Thilo
    Thilo Rusche, Jul 28, 2003
    #1
    1. Advertising

  2. On 28 Jul 2003 13:39:44 -0700, (Thilo Rusche) wrote:
    > is there a way to perform a host lookup using a specific DNS server
    > instead of the default nameserver of the local machine in Java, short
    > of implementing the DNS protocol? For example, if the local machine is
    > configured to use /etc/hosts, 10.254.1.1 and 10.254.2.2, is there any
    > API call that allows me to query a different server? As far as I am
    > aware, the java.net package does not support this, and I could not
    > find any third party API for this either. Any pointers would be
    > appreciated.


    I know of no way to do this in Java directly. There may be
    some 3rd party class out there that do it, or you can use
    various tools like nslookup using Runtime.exec().

    --Joe
    Joseph Millar, Jul 28, 2003
    #2
    1. Advertising

  3. On Tue, 29 Jul 2003 00:30:39 GMT, Roedy Green <> wrote:

    > Yes. The hard part is doing it WITHOUT knowing a hard coded DNS
    > server.

    [snip!]

    Very cool, didn't know about this. Guess I need to find out
    more about JNDI.

    --Joe
    Joseph Millar, Jul 29, 2003
    #3
  4. Thilo Rusche

    Thilo Rusche Guest

    Roedy Green <> wrote in message news:<>...

    > Yes. The hard part is doing it WITHOUT knowing a hard coded DNS
    > server.
    >
    > Here is how you do it:


    Thanks, just what I was looking for. I wasn't familiar with the
    javax.naming package yet.

    Cheers,
    Thilo
    Thilo Rusche, Jul 29, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Orpheus66
    Replies:
    0
    Views:
    4,422
    Orpheus66
    Jul 30, 2003
  2. Replies:
    0
    Views:
    340
  3. Chuckk Hubbard

    Pyro "could not find NameServer"

    Chuckk Hubbard, Nov 10, 2008, in forum: Python
    Replies:
    0
    Views:
    391
    Chuckk Hubbard
    Nov 10, 2008
  4. Chuckk Hubbard

    Re: Pyro "could not find NameServer"

    Chuckk Hubbard, Nov 10, 2008, in forum: Python
    Replies:
    0
    Views:
    463
    Chuckk Hubbard
    Nov 10, 2008
  5. eloelo
    Replies:
    1
    Views:
    128
    Michael Fuhr
    Aug 7, 2004
Loading...

Share This Page