Metricbeat Unable to Connect to ElasticSearch, DNS Lookup Failed?

I finally found the issue. It turns out that metricbeat uses proxy defined in environment variable HTTP_PROXY, HTTPS_PROXY and NO_PROXY. It turns out that there are some proxy defined there that are not working anymore and I actually had to remove both variable value to fix this issue (since we don't need proxy to get to the machine)