[ 
https://issues.apache.org/jira/browse/NIFI-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183346#comment-17183346
 ] 

ASF subversion and git services commented on NIFI-7758:
-------------------------------------------------------

Commit 11a4127a9f89474a42f182c0b83e365a6b468e71 in nifi's branch 
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=11a4127 ]

NIFI-7758: Avoid calling InetAddress.getHostName() because doing so results in 
a reverse DNS Lookup, which can be expensive

Signed-off-by: Pierre Villard <[email protected]>

This closes #4487.


> Site-to-Site and ListenTCP unnecessarily perform Reverse DNS Lookup
> -------------------------------------------------------------------
>
>                 Key: NIFI-7758
>                 URL: https://issues.apache.org/jira/browse/NIFI-7758
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework, Extensions
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The SSLSocketChannel class in nifi-security-utils obtains the remote 
> address's hostname via a call to InetAddress.getHostName():
> {code}
> final Socket socket = socketChannel.socket();
> this.hostname = socket.getInetAddress().getHostName();
> {code}
> This hostname is captured only for use in the message of Exceptions or 
> logging and not programmatically. The use of this reverse DNS lookup, though, 
> can be expensive and cause long delays in an environment where reverse DNS 
> lookups are not available. As a result, we should use InetAddress.toString() 
> instead, which will provide the hostname, if it is available, and the IP 
> address without performing a reverse DNS lookup.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to