Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does SOCK 5 proxy-ing of DNS work in browsers?

Tags:

dns

socks

Browsers can proxy DNS requests through SOCKS 5. What I don't understand is how the process works.

Correct me if I'm wrong. In normal DNS operation, a program does DNS resolution through its operating system, which in turn is configured to access a specific DNS server(s) and make queries there. So, in normal operation a browser should not do DNS queries over the network by himself.

Now, with a SOCKS proxy, the browser needs to do his own queries. How that the browser knows which DNS server will exist at the other end of the proxy tunnel?

like image 267
dsign Avatar asked Oct 13 '15 09:10

dsign


People also ask

How does a socks5 proxy work?

But with SOCKS5 proxy configured the browser simply asks to the SOCKS5 to connect to hosts using the host name of the host instead of its IP address. It's up to the SOCKS5 proxy then to do the lookup.

What is the difference between DNS and socks?

In normal DNS operation, a program does DNS resolution through its operating system, which in turn is configured to access a specific DNS server (s) and make queries there. So, in normal operation a browser should not do DNS queries over the network by himself. Now, with a SOCKS proxy, the browser needs to do his own queries.

What is the SOCKS protocol?

SOCKS is an internet protocol that routes packets between a server and a client using a proxy server. Your traffic is routed through a proxy server that generates an arbitrary IP address before you reach your destination.

What is the difference between SOCKS5 and HTTP?

SOCKS5 vs HTTP proxy Unlike HTTP proxies, which can only interpret and work with HTTP and HTTPS webpages, SOCKS5 proxies can work with any traffic. HTTP proxies are high-level proxies usually designed for a specific protocol. While this means you get better connection speeds, they’re not nearly as flexible and secure as SOCKS proxies.


2 Answers

The browser doesn't do his own DNS lookups then. I don't know if there are actual situations in which a browser will speak DNS to a DNS server. But with SOCKS5 proxy configured the browser simply asks to the SOCKS5 to connect to hosts using the host name of the host instead of its IP address. It's up to the SOCKS5 proxy then to do the lookup.

I know this because I maintain a SOCKS5 implementation.

like image 88
dsign Avatar answered Oct 12 '22 15:10

dsign


It depends on your browser. Firefox, for example, sends hostname to SOCKS proxy without resolving it. You can confirm that by Wireshark.

PS. assume you are using a SOCKS5/4a proxy. SOCKS4 does not support hostname. Ref: https://en.wikipedia.org/wiki/SOCKS#SOCKS4a

like image 5
petertc Avatar answered Oct 12 '22 15:10

petertc