7

If I configure the proxy, under Settings -> Network -> Proxy, and then try to access "http://google.com", the name resolution (IP of google.com) will happen there, at the proxy server but...

How can I change this behavior?

I mean, I need to resolve the DNS locally at my Desktop, BEFORE hitting the proxy.

But why?

This way, I'll configure "ignore-hosts with lots of subnets (IPv4 / IPv6), that don't need the proxy to reach them", then, Ubuntu first needs to:

1- Resolve the DNS locally (i.e. not via proxy too);

2- Try to match the locally discovered website IP with "ignore-hosts" settings;

Is it possible?

Tks! Thiago

5

This isn't possible when you use an HTTP proxy because:

  • The server you connect to is that of the proxy, not of the ultimate destination.
  • You send the full URL (including hostname) of your request to the proxy. The proxy then does the request on your behalf.

Therefore, it must be the proxy that does the DNS lookup.

It isn't possible to do the DNS lookup locally, and send only the IP address to the proxy server. Firstly, there is no mechanism to specify that the proxy should try a particular IP address for a particular host. You could change the URL from, say, http://example.com/mypage to http://33.33.33.33/mypage, but then the proxy server won't know which hostname to request, an importanta part of the modern web (HTTP/1.1 and later), which depends on a Host header always being present in a request, removing the restriction that all hostnames be served from different IP addresses.

Your best bet would be to configure the proxy server to use the DNS resolver of your choice. This would only be possible if you use a local proxy server that you control.

Note: When you use a SOCKS proxy or another lower-level tunnelling method, you can use a local DNS server. Just not with an HTTP proxy.

2
  • Thank you! Nice explanation... But, I'm still thinking that I it would be better to resolve the DNS locally, just to match the ignore-hosts settings. Like this: 1- If the site IP matches ignore-hosts settings, then, don't go via proxy. Otherwise: 2- if the site IP doesn't match ignore-hosts, then, go via proxy as usual. - Can I achieve this? Nevertheless, I'll take a look of socks... Tks again! – ThiagoCMC Apr 15 '14 at 0:56
  • I guess it's possible that you could do an additional DNS request locally in addition to the DNS request the HTTP proxy server does, I don't know if you have that option "out of the box" though. – thomasrutter Apr 15 '14 at 1:13
0

edit: Or you can use a PAC file to control usage of proxy or not depending on your criteria. Autoproxyresultcache if applicable must be off.

you can install Technitium and be the DNS server. https://technitium.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.