Return-Path: Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: (qmail 94035 invoked from network); 1 Jun 2010 11:48:01 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Jun 2010 11:48:01 -0000 Received: (qmail 631 invoked by uid 500); 1 Jun 2010 11:48:00 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 309 invoked by uid 500); 1 Jun 2010 11:47:59 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 300 invoked by uid 99); 1 Jun 2010 11:47:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jun 2010 11:47:58 +0000 X-ASF-Spam-Status: No, hits=-1484.6 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jun 2010 11:47:57 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o51Blbxq017126 for ; Tue, 1 Jun 2010 11:47:37 GMT Message-ID: <15774197.101941275392857814.JavaMail.jira@thor> Date: Tue, 1 Jun 2010 07:47:37 -0400 (EDT) From: "Johannes Zillmann (JIRA)" To: common-dev@hadoop.apache.org Subject: [jira] Created: (HADOOP-6797) DNS#getHosts() fallback leads to mix of network-interface addresse in case reverse lookup fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 DNS#getHosts() fallback leads to mix of network-interface addresse in case reverse lookup fails ----------------------------------------------------------------------------------------------- Key: HADOOP-6797 URL: https://issues.apache.org/jira/browse/HADOOP-6797 Project: Hadoop Common Issue Type: Bug Affects Versions: 0.20.2 Reporter: Johannes Zillmann org.apache.hadoop.net.DNS#getHosts(): {noformat} public static String[] getHosts(String strInterface, String nameserver) throws UnknownHostException { String[] ips = getIPs(strInterface); Vector hosts = new Vector(); for (int ctr = 0; ctr < ips.length; ctr++) try { hosts.add(reverseDns(InetAddress.getByName(ips[ctr]), nameserver)); } catch (Exception e) { } if (hosts.size() == 0) return new String[] { InetAddress.getLocalHost().getCanonicalHostName() }; else return hosts.toArray(new String[] {}); } {noformat} I have the situation where i choosing eth1 as network interface (fs.datanode.dns.interface and mapred.tasktracker.dns.interface) which is the internal interface. The reverse lookup fails for eth1 so the fallback: {noformat} if (hosts.size() == 0) return new String[] { InetAddress.getLocalHost().getCanonicalHostName() }; {noformat} comes to action. The dns of eth0 is returned which is the external interface. This leads in my case to a combination of internal ip and external dns as the default ip/host. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.