diff --git a/src/Common/DNSResolver.cpp b/src/Common/DNSResolver.cpp index 9059d2838bb..f54d3e72df5 100644 --- a/src/Common/DNSResolver.cpp +++ b/src/Common/DNSResolver.cpp @@ -80,13 +80,7 @@ static void splitHostAndPort(const std::string & host_and_port, std::string & ou out_port = static_cast(port); } else - { - struct servent * se = getservbyname(port_str.c_str(), nullptr); - if (se) - out_port = ntohs(static_cast(se->s_port)); - else - throw Exception("Service not found", ErrorCodes::BAD_ARGUMENTS); - } + throw Exception("Port must be numeric", ErrorCodes::BAD_ARGUMENTS); } static DNSResolver::IPAddresses resolveIPAddressImpl(const std::string & host)