From 85fe4e1fdc03fda5c7d511e3167d5c8c8800410f Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Tue, 22 Nov 2022 14:54:23 +0500 Subject: [PATCH] No need to do lookup if IP was provided --- lib/MySQL_Monitor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index f11785d95..17de415b9 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -5426,6 +5426,11 @@ void MySQL_Monitor::evaluate_aws_aurora_results(unsigned int wHG, unsigned int r } std::string MySQL_Monitor::dns_lookup(const std::string& hostname) { + + // if IP was provided, no need to do lookup + if (validate_ip(hostname)) + return hostname; + static thread_local std::shared_ptr dns_cache_thread; const std::string& hostname_trim = trim(hostname); std::string ip;