Java-DNS Resolution Prevention

Question: how can I get Java to not resolve some hostnames to IP addresses.

In my application, I use the Socks proxy to connect to external sites. Our socks proxy is configured so that it can only accept the URL "www.google.com" and not the allowed IP addresses, such as "xxx.xxx.xx.xx".

This socks proxy connection is made inside another api whose code I don't have. I just wrote a proxyselector and made sure that whenever certain URLS are called, it will go through our proxy server. This logic seems to work in our lower environments. but in production boxes, somehow URLS that go to the socks proxy allow IP, not URLS.

My question is, how can I get Java to not resolve hostnames that go through the socks proxy.

Thanks.

Regards, Hariharan

+6
source share

Source: https://habr.com/ru/post/974006/


All Articles