Any known incompatabilities with InetAddress and BIND 9?...

Discussion in 'Java' started by mclTunes, Feb 7, 2007.

  1. mclTunes

    mclTunes Guest

    Are there any known incompatibilities with InetAddres and BIND 9?
    We're regression testing an app in Solaris 10 which uses BIND 9. The
    app performs a simple DNS check by calling:

    InetAddress ia = InetAddress.getByName( hostname );

    followed by:

    String ipAddress = ia.getHostAddress();

    On the new server we can't resolve any name passed into it, although
    nslookup from a shell on the same server can lookup the names without
    a problem.
    mclTunes, Feb 7, 2007
    #1
    1. Advertising

  2. On 7 Feb 2007 10:24:04 -0800, mclTunes wrote:
    > On the new server we can't resolve any name passed into it, although
    > nslookup from a shell on the same server can lookup the names
    > without a problem.


    This sounds like a host configuration issue.

    AFAIK nslookup talks directly with your nameserver, whereas the Java
    methods you mention (and ultimately gethostbyname() & friends) use
    /etc/nsswitch.conf and other files on the host, which may lead to
    different results unless the host is configured correctly.

    /gordon

    --
    [ don't email me support questions or followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
    Gordon Beaton, Feb 8, 2007
    #2
    1. Advertising

  3. mclTunes

    mclTunes Guest

    On Feb 8, 2:14 am, Gordon Beaton <> wrote:
    > On 7 Feb 2007 10:24:04 -0800,mclTuneswrote:
    >
    > > On the new server we can't resolve any name passed into it, although
    > > nslookup from a shell on the same server can lookup the names
    > > without a problem.

    >
    > This sounds like a host configuration issue.
    >
    > AFAIK nslookup talks directly with your nameserver, whereas the Java
    > methods you mention (and ultimately gethostbyname() & friends) use
    > /etc/nsswitch.conf and other files on the host, which may lead to
    > different results unless the host is configured correctly.
    >
    > /gordon
    >
    > --
    > [ don't email me support questions or followups ]
    > g o r d o n + n e w s @ b a l d e r 1 3 . s e


    Gordon,

    Thank you so much! I also found this web resource which addresses
    how to configure /etc/nsswitch.conf to use DNS:
    http://www.faqs.org/docs/securing/chap6sec71.html

    So we changed this line:

    hosts: files

    to read:

    hosts: dns files

    and now the code resolves the name. Excellent!

    There appear to be performance issues right now, but we have other
    things going on with that box that could account for that.

    Thanks again for your contribution!
    -- Mark
    mclTunes, Feb 9, 2007
    #3
    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. David Jones

    Redhat 9.0 ftp Incompatabilities?

    David Jones, Dec 16, 2003, in forum: Perl
    Replies:
    1
    Views:
    508
    UnixFan
    Dec 17, 2003
  2. C
    Replies:
    1
    Views:
    829
  3. vertigo

    IP: long-> InetAddress

    vertigo, May 2, 2004, in forum: Java
    Replies:
    2
    Views:
    4,416
    Roedy Green
    May 3, 2004
  4. Madhur Ahuja
    Replies:
    1
    Views:
    728
    Paul Lutus
    Aug 29, 2004
  5. Linus

    InetAddress

    Linus, Jan 28, 2005, in forum: Java
    Replies:
    5
    Views:
    12,837
    Linus
    Jan 31, 2005
Loading...

Share This Page