Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jul 2007 14:19:40 -0700 (PDT)
From:      Nick Johnson <freebsd@spatula.net>
To:        freebsd-java@freebsd.org
Subject:   possible name resolution problem in 1.5.0_11-p5
Message-ID:  <20070724133740.B82369@turing>

next in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-498686103-1185311980=:82369
Content-Type: TEXT/PLAIN; charset=US-ASCII

I've attached a snippet of code that demonstrates the problem.

In the example, note this line:

    Attributes attrs = attrs = ictx.getAttributes("mac.com", new String[] { "MX", "A"});

The behaviour is that IF the name being resolved is already in the local 
name server's cache (and resolv.conf is pointing at the local name 
server), it will retrieve the records requested.

If it's not, some records will be retrieved, but they won't include an MX 
record.

If you request JUST an MX record (ie new String[] { "MX" } by itself), 
then the MX record will be found.

To use the test, you'd need to substitute "mac.com" for any foreign 
hostname that isn't already in your name server's cache.  This is with 
Java 1.5.0_11-p5 built from ports on Jun 19 running on 6.2-STABLE built on 
Sun Jan 21 2007.

I'm not entirely certain that this problem isn't something particular to 
my system / configuration.  If some others could play with the test a bit 
and see if they get the same behaviour, that would help.

   Nick

--0-498686103-1185311980=:82369
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=FreeBsdDnsTest.java
Content-Transfer-Encoding: BASE64
Content-ID: <20070724141939.J82369@turing>
Content-Description: 
Content-Disposition: attachment; filename=FreeBsdDnsTest.java

aW1wb3J0IGphdmEudXRpbC4qOw0KaW1wb3J0IGphdmF4Lm5hbWluZy4qOw0K
aW1wb3J0IGphdmF4Lm5hbWluZy5kaXJlY3RvcnkuKjsNCmltcG9ydCBqYXZh
Lm5ldC4qOw0KDQpwdWJsaWMgY2xhc3MgRnJlZUJzZERuc1Rlc3Qgew0KDQog
ICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgew0K
CVN5c3RlbS5zZXRQcm9wZXJ0eSgiamF2YS5uZXQucHJ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gbmV3IFN0cmluZ1tdIHsg
Ik1YIiwgIkEifSk7DQoNCiAgICAgICAgICAgIGlmIChhdHRycyA9PSBudWxs
KSB7DQoJCVN5c3RlbS5vdXQucHJpbnRsbigiTm8gcmVjb3JkcyByZXR1cm5l
ZCA6KCIpOw0KICAgICAgICAgICAgfQ0KDQogICAgICAgICAgICBBdHRyaWJ1
dGUgYXR0ciA9IGF0dHJzLmdldCgiTVgiKTsNCg0KCSAgICBpZiAoYXR0ciAh
PSBudWxsKSB7DQoJCVN5c3RlbS5vdXQucHJpbnRsbigiRm91bmQgTVggaG9z
dHMhIDopIik7DQoJICAgIH0gZWxzZSB7DQoJICAgIAlTeXN0ZW0ub3V0LnBy
aW50bG4oIkZvdW5kIG5vIE1YIGhvc3RzIDooIik7DQoJICAgIH0NCiAgICAg
ICAgfSBjYXRjaCAoTmFtaW5nRXhjZXB0aW9uIGUpIHsNCgkgICAgZS5wcmlu
dFN0YWNrVHJhY2UoKTsNCiAgICAgICAgfQ0KICAgIH0NCn0NCg==

--0-498686103-1185311980=:82369--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070724133740.B82369>