1

I am not so into networking and I have the following problem. I am working on an Ubuntu 18.04.2 LTS server inside a network of my customer.

Here I have the following problems that seems to be related to the DNS resolution.

If I perform this command:

my.username@VHCLWSO2AS02:~$ nslookup google.com
;; connection timed out; no servers could be reached

it seems that nslookup is not working so I obtain a timeout.

The stange thing is that if I perform a wget command into my shell it works fine, infact:

my.username@VHCLWSO2AS02:~$ wget google.com
--2020-02-17 15:19:53--  http://google.com/
Connecting to 127.0.0.1:3128... connected.
Proxy request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.com/ [following]
--2020-02-17 15:19:53--  http://www.google.com/
Connecting to 127.0.0.1:3128... connected.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’

index.html                                  [ <=>                                                                           ]  11.52K  --.-KB/s    in 0s

2020-02-17 15:19:53 (214 MB/s) - ‘index.html’ saved [11800]

As you can see it works fine. My original doubt is: why nslookup is not working but wget using the same google.com name it is working fine?

Looking inside the output of the wget output it seems to me that it is passing through a proxy. In particular I think that it should be a CNTLM proxy installed on the same machine (running on the 3128 port of the same machine: 127.0.0.1). It make sense because on the customer networks should use a Windows firewall requiring authentication in order to access to the Internet.

So my assumption is that, for some reaon that I don't know, nslookup is not passing throunght this CNTLM proxy so it is not working.

Is my reasoning correct? In case why nslookup is not passing throunght my proxy (as done by wget)? What am I missing? In case do you have some ideas to solve this situation?

1 Answer 1

1

You're using an HTTP proxy, that is, a proxy meant to relay HTTP requests – but nslookup isn't an HTTP client in the first place, so it doesn't even look at your proxy settings.

Although technically HTTP proxies can often carry TCP streams using the 'CONNECT' method – which is how they usually handle HTTPS sites without having to break TLS security. – most non-HTTP tools do not support this natively, because 1) most proxies are configured to only allow stream connections to the HTTPS port; 2) this method cannot carry UDP datagrams (nslookup wants to use UDP as well as TCP).

If only TCP is wanted (and if the proxy allows connections to the needed port), you can probably use wrappers such as proxytunnel.

wget works because it doesn't actually have to perform DNS resolution for "google.com" at all: it simply gives the raw URL http://google.com to the proxy, and the proxy makes its own DNS lookup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .