diff --git a/core/src/main/java/org/elasticsearch/common/transport/InetSocketTransportAddress.java b/core/src/main/java/org/elasticsearch/common/transport/InetSocketTransportAddress.java index f4f686ff2e5..07db52b4fbe 100644 --- a/core/src/main/java/org/elasticsearch/common/transport/InetSocketTransportAddress.java +++ b/core/src/main/java/org/elasticsearch/common/transport/InetSocketTransportAddress.java @@ -94,7 +94,11 @@ public final class InetSocketTransportAddress implements TransportAddress { @Override public String getHost() { - return address.getHostName(); + if (resolveAddress) { + return address.getHostName(); + } else { + return getAddress(); + } } @Override